@forge/bundler 7.0.2-next.5-experimental-a1600ff → 7.0.2-next.7

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.
package/CHANGELOG.md CHANGED
@@ -1,20 +1,19 @@
1
1
  # @forge/bundler
2
2
 
3
- ## 7.0.2-next.5-experimental-a1600ff
3
+ ## 7.0.2-next.7
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [4c5ba1c]
8
- - Updated dependencies [903d6c1]
9
- - Updated dependencies [8826ca3]
10
- - Updated dependencies [d415c89]
11
- - Updated dependencies [757223b]
12
- - Updated dependencies [7195f29]
13
- - Updated dependencies [3252a62]
14
- - Updated dependencies [3991f92]
15
- - @forge/manifest@13.1.1-next.2-experimental-a1600ff
16
- - @forge/cli-shared@9.2.0-next.5-experimental-a1600ff
17
- - @forge/lint@6.0.2-next.5-experimental-a1600ff
7
+ - @forge/lint@6.0.2-next.7
8
+
9
+ ## 7.0.2-next.6
10
+
11
+ ### Patch Changes
12
+
13
+ - 6e5b5a4: Better interface for packaging the runtime code
14
+ - Updated dependencies [6e5b5a4]
15
+ - @forge/cli-shared@9.2.0-next.6
16
+ - @forge/lint@6.0.2-next.6
18
17
 
19
18
  ## 7.0.2-next.5
20
19
 
@@ -1,6 +1,10 @@
1
1
  type CopyDepsOptions = {
2
2
  exclude?: string[];
3
3
  };
4
+ export declare const DEFAULT_COPY_DEPENDENCIES_OPTIONS: {
5
+ exclude: string[];
6
+ };
7
+ export declare function getProductionDependencies(moduleDir: string, options?: CopyDepsOptions): Promise<Map<string, string>>;
4
8
  export declare function copyProductionDependencies(moduleDir: string, target: string, options?: CopyDepsOptions): Promise<void>;
5
9
  export {};
6
10
  //# sourceMappingURL=dependencies.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../src/dependencies.ts"],"names":[],"mappings":"AAwDA,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAaF,wBAAsB,0BAA0B,CAC9C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,IAAI,CAAC,CAuBf"}
1
+ {"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../src/dependencies.ts"],"names":[],"mappings":"AA2CA,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAyBF,eAAO,MAAM,iCAAiC;;CAE7C,CAAC;AAYF,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAI9B;AAoDD,wBAAsB,0BAA0B,CAC9C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,IAAI,CAAC,CAKf"}
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_COPY_DEPENDENCIES_OPTIONS = void 0;
4
+ exports.getProductionDependencies = getProductionDependencies;
3
5
  exports.copyProductionDependencies = copyProductionDependencies;
4
6
  const tslib_1 = require("tslib");
5
7
  const fs_1 = require("fs");
@@ -25,11 +27,15 @@ async function dependencyDir(moduleDir, dependency) {
25
27
  }
26
28
  return null;
27
29
  }
28
- function transplantDir(source, destination, directory) {
29
- const relative = path_1.default.relative(source, directory);
30
- return path_1.default.join(destination, relative);
30
+ exports.DEFAULT_COPY_DEPENDENCIES_OPTIONS = {
31
+ exclude: ['@forge/react', '@forge/bridge']
32
+ };
33
+ async function getProductionDependencies(moduleDir, options) {
34
+ const result = new Map();
35
+ await enumerateProductionDependencies(moduleDir, options ?? {}, moduleDir, result, new Set());
36
+ return result;
31
37
  }
32
- async function copyProductionDependencies(moduleDir, target, options) {
38
+ async function enumerateProductionDependencies(moduleDir, options, root, result, visited) {
33
39
  const packageDef = await readPackageJSON(moduleDir);
34
40
  if (!packageDef) {
35
41
  return;
@@ -41,14 +47,24 @@ async function copyProductionDependencies(moduleDir, target, options) {
41
47
  }
42
48
  const source = await dependencyDir(moduleDir, dependency);
43
49
  if (source) {
44
- const destination = transplantDir(moduleDir, target, source);
45
- if ((0, fs_1.existsSync)(destination)) {
50
+ const destination = path_1.default.relative(root, source);
51
+ if (visited.has(destination)) {
46
52
  continue;
47
53
  }
48
- await (0, fs_extra_1.copy)(source, destination, {
49
- filter: (src) => path_1.default.basename(src) !== common_1.NODE_MODULES_DIR
50
- });
51
- await copyProductionDependencies(source, destination, options);
54
+ visited.add(destination);
55
+ for (const entry of await (0, promises_1.readdir)(source)) {
56
+ if (entry === common_1.NODE_MODULES_DIR) {
57
+ continue;
58
+ }
59
+ result.set(path_1.default.join(destination, entry), path_1.default.join(source, entry));
60
+ }
61
+ await enumerateProductionDependencies(source, options, root, result, visited);
52
62
  }
53
63
  }
54
64
  }
65
+ async function copyProductionDependencies(moduleDir, target, options) {
66
+ const dependencies = await getProductionDependencies(moduleDir, options);
67
+ for (const [destination, source] of dependencies.entries()) {
68
+ await (0, fs_extra_1.copy)(source, path_1.default.join(target, destination));
69
+ }
70
+ }
package/out/runtime.d.ts CHANGED
@@ -2,6 +2,5 @@ import { ConfigReader, Logger, StatsigService } from '@forge/cli-shared';
2
2
  import { Bundler } from './types';
3
3
  import { WrapperProvider } from './wrapper-provider';
4
4
  export declare const NODE_RUNTIME_CODE_FILE = "__forge__.cjs";
5
- export declare function userCodePath(entryKey: string): string;
6
5
  export declare function getNodeBundler(logger: Logger, wrapperProvider: WrapperProvider, configReader: ConfigReader, statsigService: StatsigService): Bundler;
7
6
  //# sourceMappingURL=runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,YAAY,EAEZ,MAAM,EAEN,cAAc,EAEf,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,OAAO,EAAkF,MAAM,SAAS,CAAC;AAGlH,OAAO,EAAiB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAMpE,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AAoBtD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErD;AA6JD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,GAC7B,OAAO,CAET"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,YAAY,EAEZ,MAAM,EAEN,cAAc,EAEf,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,OAAO,EAAkF,MAAM,SAAS,CAAC;AAGlH,OAAO,EAAiB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAMpE,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AAkLtD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,GAC7B,OAAO,CAET"}
package/out/runtime.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NODE_RUNTIME_CODE_FILE = void 0;
4
- exports.userCodePath = userCodePath;
5
4
  exports.getNodeBundler = getNodeBundler;
6
5
  const tslib_1 = require("tslib");
7
6
  const path_1 = tslib_1.__importDefault(require("path"));
@@ -18,10 +17,6 @@ exports.NODE_RUNTIME_CODE_FILE = '__forge__.cjs';
18
17
  const NODE_RUNTIME_BACKUP_WRAPPER_FILE = '__forge_wrapper__.cjs';
19
18
  const NODE_RUNTIME_USE_LOCAL_WRAPPER_FILE = '__forge_use_local_wrapper.txt';
20
19
  const NODE_RUNTIME_VERSION_FILE = 'runtime.json';
21
- const NODE_WEBPACK_USER_CODE_DIR = 'bundled';
22
- function userCodePath(entryKey) {
23
- return path_1.default.join(path_1.default.dirname(entryKey), NODE_WEBPACK_USER_CODE_DIR, path_1.default.basename(entryKey));
24
- }
25
20
  async function emitWrapperFiles(provider, emit) {
26
21
  const wrapper = await provider.getNodeRuntimeWrapper();
27
22
  const loader = await provider.getNodeRuntimeLoader();
@@ -82,8 +77,8 @@ class TypeScriptNodeBundler extends typescript_1.TypeScriptBundler {
82
77
  super(logger);
83
78
  this.wrapperProvider = wrapperProvider;
84
79
  }
85
- async getResult(args, outputDir, output) {
86
- const result = await super.getResult(args, outputDir, output);
80
+ async getResult(args, outputDir, output, additionalOutputs) {
81
+ const result = await super.getResult(args, outputDir, output, additionalOutputs);
87
82
  const emit = async (name, contents) => {
88
83
  const outputPath = path_1.default.join(outputDir, name);
89
84
  await promises_1.default.mkdir(path_1.default.dirname(outputPath), { recursive: true });
package/out/types.d.ts CHANGED
@@ -14,6 +14,7 @@ export declare function emptyMetadata(): BundlerMetadata;
14
14
  export declare function mergeMetadata(metadata1: BundlerMetadata, metadata2: BundlerMetadata): BundlerMetadata;
15
15
  export interface BundlerOutput {
16
16
  outputDir: string;
17
+ additionalOutputs?: Map<string, string>;
17
18
  metadata?: BundlerMetadata;
18
19
  }
19
20
  export type BundlerWatchMode = 'watch' | 'debug';
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,CA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GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACjF,CAAC;AAEF,qBAAa,YAAa,SAAQ,SAAS;CAAG"}
@@ -8,7 +8,7 @@ export declare abstract class TypeScriptBundler implements Bundler {
8
8
  constructor(logger: Logger);
9
9
  protected runTypeScript(args: BundlerArgs, outputDir: string): OutputProcess;
10
10
  protected isListedFile(line: string): string | null;
11
- protected getResult(args: BundlerArgs, outputDir: string, output?: string): Promise<BundlerOutput>;
11
+ protected getResult(args: BundlerArgs, outputDir: string, output?: string, additionalOutputs?: Map<string, string>): Promise<BundlerOutput>;
12
12
  bundle(args: BundlerArgs): Promise<BundlerOutput>;
13
13
  watch(args: BundlerWatchArgs, watch: BundlerWatch): Promise<BundlerWatchOutput>;
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../src/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAIpD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAIlC,OAAO,EAA4B,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAKrE,OAAO,EACL,OAAO,EACP,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AAGjB,KAAK,aAAa,GAAG,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;AA6B/D,8BAAsB,iBAAkB,YAAW,OAAO;IAC5C,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;IAE7C,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,aAAa;IAwB5E,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;cAWnC,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,M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AK,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA2DtF"}
package/out/typescript.js CHANGED
@@ -12,9 +12,6 @@ const dependencies_1 = require("./dependencies");
12
12
  const text_1 = require("./text");
13
13
  const types_1 = require("./types");
14
14
  const metadata_1 = require("./metadata");
15
- const COPY_DEPENDENCIES_OPTIONS = {
16
- exclude: ['@forge/react', '@forge/bridge']
17
- };
18
15
  class TypeScriptBundler {
19
16
  logger;
20
17
  constructor(logger) {
@@ -48,7 +45,7 @@ class TypeScriptBundler {
48
45
  }
49
46
  return line;
50
47
  }
51
- async getResult(args, outputDir, output) {
48
+ async getResult(args, outputDir, output, additionalOutputs) {
52
49
  let metadata;
53
50
  if (output) {
54
51
  const files = new Set();
@@ -64,11 +61,11 @@ class TypeScriptBundler {
64
61
  metadata = (0, types_1.emptyMetadata)();
65
62
  }
66
63
  metadata.bundler = 'typescript';
67
- return { outputDir, metadata };
64
+ return { outputDir, metadata, additionalOutputs };
68
65
  }
69
66
  async bundle(args) {
70
67
  const outputDir = (0, common_1.getOutputDir)(args);
71
- await (0, dependencies_1.copyProductionDependencies)(args.appDirectory, outputDir, COPY_DEPENDENCIES_OPTIONS);
68
+ const additionalOutputs = await (0, dependencies_1.getProductionDependencies)(args.appDirectory, dependencies_1.DEFAULT_COPY_DEPENDENCIES_OPTIONS);
72
69
  const compiler = this.runTypeScript(args, outputDir);
73
70
  let output = '';
74
71
  compiler.stdout.on('data', (data) => (output += data.toString()));
@@ -78,7 +75,7 @@ class TypeScriptBundler {
78
75
  const errors = output.split('\n').filter((line) => !this.isListedFile(line));
79
76
  throw new cli_shared_1.BundlerTSError(text_1.Text.typescriptError(errors));
80
77
  }
81
- const result = await this.getResult(args, outputDir, output);
78
+ const result = await this.getResult(args, outputDir, output, additionalOutputs);
82
79
  resolve(result);
83
80
  }
84
81
  catch (e) {
@@ -88,7 +85,7 @@ class TypeScriptBundler {
88
85
  }
89
86
  async watch(args, watch) {
90
87
  const outputDir = (0, common_1.getOutputDir)(args);
91
- await (0, dependencies_1.copyProductionDependencies)(args.appDirectory, outputDir, COPY_DEPENDENCIES_OPTIONS);
88
+ await (0, dependencies_1.copyProductionDependencies)(args.appDirectory, outputDir, dependencies_1.DEFAULT_COPY_DEPENDENCIES_OPTIONS);
92
89
  const compiler = this.runTypeScript(args, outputDir);
93
90
  let isFirstRun = true;
94
91
  const output = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/bundler",
3
- "version": "7.0.2-next.5-experimental-a1600ff",
3
+ "version": "7.0.2-next.7",
4
4
  "description": "Default bundler for Forge apps",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "Atlassian",
@@ -21,10 +21,10 @@
21
21
  "@babel/plugin-transform-react-jsx": "^7.23.4",
22
22
  "@babel/traverse": "^7.24.0",
23
23
  "@babel/types": "^7.24.0",
24
- "@forge/cli-shared": "9.2.0-next.5-experimental-a1600ff",
24
+ "@forge/cli-shared": "9.2.0-next.6",
25
25
  "@forge/i18n": "1.0.0",
26
- "@forge/lint": "6.0.2-next.5-experimental-a1600ff",
27
- "@forge/manifest": "13.1.1-next.2-experimental-a1600ff",
26
+ "@forge/lint": "6.0.2-next.7",
27
+ "@forge/manifest": "13.1.1-next.2",
28
28
  "babel-loader": "^8.3.0",
29
29
  "cheerio": "^1.2.0",
30
30
  "cross-spawn": "^7.0.6",