@forge/cli-shared 6.8.0-next.12 → 6.8.0-next.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,8 +7,9 @@ declare type TestApp = {
7
7
  path: string;
8
8
  }[];
9
9
  };
10
- export declare function createTestApp({ userCode, packages, withI18nBundle }: {
10
+ export declare function createTestApp({ userCode, userCodeFilename, packages, withI18nBundle }: {
11
11
  userCode: string;
12
+ userCodeFilename?: string;
12
13
  packages?: string[];
13
14
  withI18nBundle?: boolean;
14
15
  }): Promise<TestApp>;
@@ -1 +1 @@
1
- {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/shared/test.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B,wBAAgB,UAAU,CAAC,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,GAAG,MAAM,CAW/E;AAED,aAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/C,CAAC;AAEF,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,QAAQ,EACR,cAAsB,EACvB,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,OAAO,CAAC,OAAO,CAAC,CA8CnB"}
1
+ {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/shared/test.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B,wBAAgB,UAAU,CAAC,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,GAAG,MAAM,CAW/E;AAED,aAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/C,CAAC;AAEF,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,gBAA0B,EAC1B,QAAQ,EACR,cAAsB,EACvB,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,OAAO,CAAC,OAAO,CAAC,CA+CnB"}
@@ -19,11 +19,12 @@ function mockLogger(traceEnabled, debugEnabled) {
19
19
  };
20
20
  }
21
21
  exports.mockLogger = mockLogger;
22
- async function createTestApp({ userCode, packages, withI18nBundle = false }) {
22
+ async function createTestApp({ userCode, userCodeFilename = 'index', packages, withI18nBundle = false }) {
23
23
  const appDirectory = (0, directories_1.tmpDir)();
24
- const srcDirectory = path_1.default.join(appDirectory, 'src');
25
- await (0, fs_extra_1.ensureDir)(srcDirectory);
26
- const userCodePath = path_1.default.join(srcDirectory, 'index.ts');
24
+ const userCodeDir = path_1.default.join(appDirectory, 'src', path_1.default.dirname(userCodeFilename));
25
+ const userCodeBaseName = path_1.default.basename(userCodeFilename);
26
+ await (0, fs_extra_1.ensureDir)(userCodeDir);
27
+ const userCodePath = path_1.default.join(userCodeDir, `${userCodeBaseName}.ts`);
27
28
  await (0, promises_1.writeFile)(userCodePath, userCode);
28
29
  await (0, promises_1.writeFile)(path_1.default.join(appDirectory, 'tsconfig.json'), JSON.stringify({}));
29
30
  const allPackages = ['@types/node', ...(packages ?? [])];
@@ -51,7 +52,7 @@ async function createTestApp({ userCode, packages, withI18nBundle = false }) {
51
52
  }
52
53
  return {
53
54
  appDirectory,
54
- entryPoints: [{ name: 'main', path: userCodePath }]
55
+ entryPoints: [{ name: userCodeFilename, path: path_1.default.join(userCodeDir, userCodeBaseName) }]
55
56
  };
56
57
  }
57
58
  exports.createTestApp = createTestApp;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/cli-shared",
3
- "version": "6.8.0-next.12",
3
+ "version": "6.8.0-next.13",
4
4
  "description": "Common functionality for Forge CLI",
5
5
  "author": "Atlassian",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",