|
9 | 9 |
|
10 | 10 | import * as path from 'path';
|
11 | 11 | import * as os from 'os';
|
12 |
| -import { copyFile } from 'fs/promises'; |
13 | 12 | import * as fg from 'fast-glob';
|
14 | 13 | import { exec } from 'shelljs';
|
15 | 14 | import { TestSession, execCmd } from '@salesforce/cli-plugins-testkit';
|
@@ -149,6 +148,15 @@ export class Nutshell extends AsyncCreatable<Nutshell.Options> {
|
149 | 148 | return this.execute('force:apex:class:create', options);
|
150 | 149 | }
|
151 | 150 |
|
| 151 | + /** |
| 152 | + * Create a Lightning Web Component |
| 153 | + */ |
| 154 | + public async createLWC( |
| 155 | + options: Partial<Nutshell.CommandOpts> = {} |
| 156 | + ): Promise<Result<{ created: string[]; outputDir: string }>> { |
| 157 | + return this.execute('force:lightning:component:create', options); |
| 158 | + } |
| 159 | + |
152 | 160 | /**
|
153 | 161 | * Installs a package into the scratch org. This method uses shelljs instead of testkit because
|
154 | 162 | * we can't add plugin-package as a dev plugin yet.
|
@@ -332,10 +340,10 @@ export class Nutshell extends AsyncCreatable<Nutshell.Options> {
|
332 | 340 | const src = path.join(this.testMetadataFolder, file);
|
333 | 341 | this.debug(`addTestFiles: ${src} -> ${dest}`);
|
334 | 342 | try {
|
335 |
| - await copyFile(src, dest); |
| 343 | + fs.copyFileSync(src, dest); |
336 | 344 | } catch {
|
337 | 345 | await fs.mkdirp(path.dirname(dest));
|
338 |
| - await copyFile(src, dest); |
| 346 | + fs.copyFileSync(src, dest); |
339 | 347 | }
|
340 | 348 | }
|
341 | 349 | await this.trackFiles(this.testMetadataFiles);
|
|
0 commit comments