@journeyapps/cloudcode-build-agent 0.0.0-dev.9188dcc → 0.0.0-dev.9202033

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/dist/builder.d.ts CHANGED
@@ -1 +1,21 @@
1
- export declare function buildTasks(src: string, dest: string, only?: string): Promise<void>;
1
+ import { DetectedTask } from './detect_tasks';
2
+ export type GeneralTaskConfig = {
3
+ app_id: string;
4
+ env: string;
5
+ backend_id: string;
6
+ backend_url: string;
7
+ };
8
+ export type BuildOptions = {
9
+ only?: string;
10
+ custom_node_installation_path?: string;
11
+ };
12
+ type ToolPaths = {
13
+ bin_path: string;
14
+ node_bin: string;
15
+ npm_bin: string;
16
+ };
17
+ export declare function buildTasks(project_path: string, dest: string, config: GeneralTaskConfig, options?: BuildOptions): Promise<void>;
18
+ export declare function buildTask(task: DetectedTask, project_path: string, dest: string, config: GeneralTaskConfig, node_context: {
19
+ node_version: string;
20
+ } & ToolPaths): Promise<void>;
21
+ export {};
package/dist/builder.js CHANGED
@@ -1,9 +1,101 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildTasks = void 0;
4
- // Detect tasks in given path and build them.
5
- async function buildTasks(src, dest, only) { }
26
+ exports.buildTask = exports.buildTasks = void 0;
27
+ const path = __importStar(require("node:path"));
28
+ const jetpack = __importStar(require("fs-jetpack"));
29
+ const semver = __importStar(require("semver"));
30
+ const installer_1 = require("./installer");
31
+ const detect_tasks_1 = require("./detect_tasks");
32
+ const run_1 = require("./run");
33
+ async function buildTasks(project_path, dest, config, options) {
34
+ const tasks = await (0, detect_tasks_1.detectTasks)(project_path, options?.only);
35
+ // Use the version of nodejs that's running this script as the default.
36
+ const default_tool_paths = {
37
+ bin_path: path.dirname(process.execPath),
38
+ node_bin: process.execPath,
39
+ npm_bin: path.join(path.dirname(process.execPath), 'npm')
40
+ };
41
+ for (const task of tasks) {
42
+ let custom_tool_paths;
43
+ if (task.required_node_version) {
44
+ // FIXME: when defaulting to project_path, the custom node installation is copied into the builder's workdir as well.
45
+ const custom_node_installation_path = options?.custom_node_installation_path ?? project_path;
46
+ const custom_node_path = path.resolve(custom_node_installation_path, `node-${semver.major(task.required_node_version)}`);
47
+ custom_tool_paths = await (0, installer_1.ensureCustomNodeVersion)(task.required_node_version, custom_node_path);
48
+ }
49
+ const node_version = task.required_node_version ?? process.version;
50
+ await buildTask(task, project_path, dest, config, {
51
+ node_version,
52
+ ...(custom_tool_paths ?? default_tool_paths)
53
+ });
54
+ }
55
+ }
6
56
  exports.buildTasks = buildTasks;
7
- // Build a single task in the specified subdirectory.
8
- async function buildTask(src, dest, config) { }
57
+ async function buildTask(task, project_path, dest, config, node_context) {
58
+ const builder_package = task.builder_package;
59
+ const builder_script = task.builder_script;
60
+ const { bin_path, node_bin, npm_bin } = node_context;
61
+ const builder_bin = path.resolve(bin_path, builder_script);
62
+ if (!jetpack.exists(node_bin)) {
63
+ throw new Error(`Node binary not found: ${node_bin}`);
64
+ }
65
+ console.debug(`[${task.task_name}] Installing builder script "${builder_package}" for node ${node_context.node_version}`);
66
+ const stream1 = (0, run_1.runCommand)(node_bin, [npm_bin, '--global', 'install', builder_package], {
67
+ cwd: project_path,
68
+ env: process.env
69
+ });
70
+ for await (let event of stream1) {
71
+ const log = event.stdout ?? event.stderr;
72
+ if (log) {
73
+ console.log(`[${task.task_name} - install]`, log.trimRight());
74
+ }
75
+ }
76
+ if (!jetpack.exists(builder_bin)) {
77
+ console.error(`[${task.task_name}] ${builder_bin} not found`);
78
+ throw new Error(`Builder script not found for task ${task.task_name}`);
79
+ }
80
+ const builder_args = [];
81
+ builder_args.push(builder_bin);
82
+ builder_args.push('--src', project_path);
83
+ builder_args.push(`--out`, path.join(dest, task.task_name));
84
+ builder_args.push(`--zip`, path.join(dest, `${task.task_name}.zip`));
85
+ builder_args.push(`--task`, `${task.task_name}`);
86
+ builder_args.push(`--appId`, config.app_id);
87
+ builder_args.push(`--env`, config.env);
88
+ builder_args.push(`--backendId`, config.backend_id);
89
+ builder_args.push(`--backendUrl`, config.backend_url);
90
+ builder_args.push(`--runInstallScripts`, 'true');
91
+ console.debug(`[${task.task_name}] Trying: ${node_bin} ${builder_args.join(' ')}`);
92
+ const stream2 = (0, run_1.runCommand)(node_bin, builder_args, { cwd: project_path, env: process.env });
93
+ for await (let event of stream2) {
94
+ const log = event.stdout ?? event.stderr;
95
+ if (log) {
96
+ console.log(`[${task.task_name} - build]`, log.trimRight());
97
+ }
98
+ }
99
+ }
100
+ exports.buildTask = buildTask;
9
101
  //# sourceMappingURL=builder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":";;;AAEA,6CAA6C;AACtC,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,IAAY,EAAE,IAAa,IAAG,CAAC;AAA7E,gCAA6E;AAE7E,qDAAqD;AACrD,KAAK,UAA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GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAE5F,IAAI,KAAK,EAAE,IAAI,KAAK,IAAI,OAAO,EAAE;QAC/B,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC;QACzC,IAAI,GAAG,EAAE;YACP,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,SAAS,WAAW,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC;SAC7D;KACF;AACH,CAAC;AA1DD,8BA0DC"}
package/dist/cli.js CHANGED
@@ -27,26 +27,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
27
27
  const yargs = __importStar(require("yargs"));
28
28
  const _1 = require("./");
29
29
  const DEFAULT_SRC_PATH = './';
30
- const DEFAULT_OUT_PATH = '';
30
+ const DEFAULT_OUT_PATH = './dist/cloudcode';
31
+ const DEFAULT_TMP_PATH = '/tmp/cloudcode-build-agent/node';
31
32
  yargs
32
33
  .command(['build', '$0'], // $0 means this is the default command
33
34
  'build tasks', (yargs) => {
34
- return yargs
35
+ return (yargs
35
36
  .option('only', { string: true })
36
37
  .option('path', { default: DEFAULT_SRC_PATH })
37
- .option('out', { default: DEFAULT_OUT_PATH });
38
+ .option('out', { default: DEFAULT_OUT_PATH })
39
+ .option('node_work_dir', { default: DEFAULT_TMP_PATH })
40
+ // TODO: investigate yargs.config() for reading task config blob from a file. But how to ensure required args?
41
+ .option('appId', { string: true, demandOption: true, describe: "CloudCode's reference id" })
42
+ .option('env', { string: true, demandOption: true })
43
+ .option('backendId', { string: true, demandOption: true })
44
+ .option('backendUrl', { string: true, demandOption: true }));
38
45
  }, handled(async (argv) => {
39
- // iterate over task directories and run: 'yarn cloudcode-build'.
40
- // optionally filtered by `argv.only` to build a single task.
41
- await (0, _1.buildTasks)(argv.path, argv.out, argv.only);
42
- }))
43
- .command('prepare-env', 'Install node environments and packages for each task', (yargs) => {
44
- return yargs.option('only', { string: true }).option('path', { default: DEFAULT_SRC_PATH });
45
- }, handled(async (argv) => {
46
- // iterate over task directories:
47
- // ensure required node version for task CC version is installed - What if too old - error?
48
- // run yarn install
49
- await (0, _1.prepareBuildEnvForTasks)(argv.path, argv.only);
46
+ const config = {
47
+ app_id: argv.appId,
48
+ env: argv.env,
49
+ backend_id: argv.backendId,
50
+ backend_url: argv.backendUrl
51
+ };
52
+ await (0, _1.buildTasks)(argv.path, argv.out, config, {
53
+ only: argv.only,
54
+ custom_node_installation_path: argv.node_work_dir
55
+ });
50
56
  }))
51
57
  .option('verbose', {
52
58
  alias: 'v',
@@ -58,14 +64,8 @@ function handled(fn) {
58
64
  await fn(argv);
59
65
  }
60
66
  catch (err) {
61
- if (err instanceof _1.ProcessError) {
62
- console.error(err.message);
63
- process.exit(err.status);
64
- }
65
- else {
66
- console.error(err.stack);
67
- process.exit(1);
68
- }
67
+ console.error(err.stack);
68
+ process.exit(1);
69
69
  }
70
70
  };
71
71
  }
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,6CAA+B;AAE/B,yBAAuE;AAEvE,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B,KAAK;KACF,OAAO,CACN,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,uCAAuC;AACxD,aAAa,EACb,CAAC,KAAK,EAAE,EAAE;IACR,OAAO,KAAK;SACT,MAAM,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;SAChC,MAAM,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;SAC7C,MAAM,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAClD,CAAC,EACD,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;IACrB,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IAAI,CAAC,UAAU;KAC7B,CAAC;IACF,MAAM,IAAA,aAAU,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE;QAC5C,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,6BAA6B,EAAE,IAAI,CAAC,aAAa;KAClD,CAAC,CAAC;AACL,CAAC,CAAC,CACH;KACA,MAAM,CAAC,SAAS,EAAE;IACjB,KAAK,EAAE,GAAG;IACV,OAAO,EAAE,KAAK;CACf,CAAC,CAAC,IAAI,CAAC;AAEV,SAAS,OAAO,CAAI,EAA8B;IAChD,OAAO,KAAK,EAAE,IAAO,EAAE,EAAE;QACvB,IAAI;YACF,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC;SAChB;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjB;IACH,CAAC,CAAC;AACJ,CAAC"}
package/dist/defs.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export declare const SUPPORTED_VERSIONS: {
2
+ version: string;
3
+ node: string;
4
+ builder_package: string;
5
+ builder_script: string;
6
+ }[];
package/dist/defs.js ADDED
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SUPPORTED_VERSIONS = void 0;
4
+ // TODO: maybe publish (some of) this from the CC service?
5
+ exports.SUPPORTED_VERSIONS = [
6
+ // {
7
+ // // proposed
8
+ // version: '1.13.0',
9
+ // node: '16.19.1',
10
+ // builder_package: '@journeyapps/cloudcode-build@1.13.0',
11
+ // builder_script: 'cloudcode-build'
12
+ // },
13
+ {
14
+ version: '1.12.0',
15
+ node: '16.19.1',
16
+ builder_package: '@journeyapps/cloudcode-build-legacy@1.12.0',
17
+ builder_script: 'cloudcode-build-legacy'
18
+ },
19
+ {
20
+ version: '1.11.2',
21
+ node: '14.21.3',
22
+ builder_package: '@journeyapps/cloudcode-build-legacy@1.12.0',
23
+ builder_script: 'cloudcode-build-legacy'
24
+ },
25
+ {
26
+ version: '1.11.1',
27
+ node: '14.21.3',
28
+ builder_package: '@journeyapps/cloudcode-build-legacy@1.12.0',
29
+ builder_script: 'cloudcode-build-legacy'
30
+ },
31
+ {
32
+ version: '1.11.0',
33
+ node: '14.21.3',
34
+ builder_package: '@journeyapps/cloudcode-build-legacy@1.12.0',
35
+ builder_script: 'cloudcode-build-legacy'
36
+ }
37
+ ];
38
+ //# sourceMappingURL=defs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defs.js","sourceRoot":"","sources":["../src/defs.ts"],"names":[],"mappings":";;;AAAA,0DAA0D;AAC7C,QAAA,kBAAkB,GAAG;IAChC,IAAI;IACJ,gBAAgB;IAChB,uBAAuB;IACvB,qBAAqB;IACrB,4DAA4D;IAC5D,sCAAsC;IACtC,KAAK;IACL;QACE,OAAO,EAAE,QAAQ;QACjB,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,4CAA4C;QAC7D,cAAc,EAAE,wBAAwB;KACzC;IACD;QACE,OAAO,EAAE,QAAQ;QACjB,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,4CAA4C;QAC7D,cAAc,EAAE,wBAAwB;KACzC;IACD;QACE,OAAO,EAAE,QAAQ;QACjB,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,4CAA4C;QAC7D,cAAc,EAAE,wBAAwB;KACzC;IACD;QACE,OAAO,EAAE,QAAQ;QACjB,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,4CAA4C;QAC7D,cAAc,EAAE,wBAAwB;KACzC;CACF,CAAC"}
@@ -0,0 +1,9 @@
1
+ export type DetectedTask = {
2
+ pkg_path: string;
3
+ task_name: string;
4
+ task_version: string;
5
+ required_node_version?: string;
6
+ builder_package: string;
7
+ builder_script: string;
8
+ };
9
+ export declare function detectTasks(project_path: string, only?: string): Promise<DetectedTask[]>;
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.detectTasks = void 0;
27
+ const fs = __importStar(require("node:fs"));
28
+ const path = __importStar(require("node:path"));
29
+ const jetpack = __importStar(require("fs-jetpack"));
30
+ const semver = __importStar(require("semver"));
31
+ const defs = __importStar(require("./defs"));
32
+ async function readPackage(path) {
33
+ try {
34
+ const content = await fs.promises.readFile(path, { encoding: 'utf-8' });
35
+ return JSON.parse(content);
36
+ }
37
+ catch (err) {
38
+ console.error(`ERROR: ${err}`);
39
+ throw err;
40
+ // todo: check for enoent and skip?
41
+ // todo: if json error, throw a CC build error?
42
+ }
43
+ }
44
+ async function detectTasks(project_path, only) {
45
+ const package_files = await jetpack.findAsync(path.join(project_path, 'cloudcode'), { matching: '**/package.json' });
46
+ const filtered_package_files = package_files.filter((pkg_path) => {
47
+ // FIXME: this is kinda clunky.
48
+ const pm = /^\/?cloudcode\/([^\/]+)\/package\.json$/.exec(pkg_path);
49
+ if (!pm) {
50
+ return false;
51
+ }
52
+ const taskName = pm[1];
53
+ if (only != null && only != taskName) {
54
+ // !(only.indexOf(taskName) >= 0) // TODO: support a specific list of tasks to build?
55
+ return false;
56
+ }
57
+ return true;
58
+ });
59
+ return Promise.all(filtered_package_files.map(async (pkg_path) => {
60
+ const task_package = await readPackage(pkg_path);
61
+ const task_name = task_package.name; // CAVEAT: the pkg name _must_ match the dir.
62
+ const task_version = task_package?.cloudcode?.runtime;
63
+ // FIXME: Do we want to filter out disabled tasks from the build process?
64
+ console.debug(`Detected task version ${task_version}`);
65
+ const matching = defs.SUPPORTED_VERSIONS.find((v) => {
66
+ return semver.satisfies(v.version, task_version);
67
+ });
68
+ if (!matching) {
69
+ throw new Error('FIXME: unsupported version');
70
+ }
71
+ console.debug(`Matching versions: ${JSON.stringify(matching)}`);
72
+ const running_node_version = process.versions.node;
73
+ let required_node_version;
74
+ if (matching?.node && semver.major(matching.node) !== semver.major(running_node_version)) {
75
+ console.debug(`Task requires different node version: v${matching.node}. Running: ${running_node_version}`);
76
+ required_node_version = matching.node;
77
+ }
78
+ return {
79
+ pkg_path,
80
+ task_name,
81
+ task_version,
82
+ required_node_version,
83
+ builder_package: matching.builder_package,
84
+ builder_script: matching.builder_script
85
+ };
86
+ }));
87
+ }
88
+ exports.detectTasks = detectTasks;
89
+ //# sourceMappingURL=detect_tasks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect_tasks.js","sourceRoot":"","sources":["../src/detect_tasks.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,gDAAkC;AAClC,oDAAsC;AACtC,+CAAiC;AACjC,6CAA+B;AAE/B,KAAK,UAAU,WAAW,CAAC,IAAY;IACrC,IAAI;QACF,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,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AG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;YAClD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,EAAE;YACb,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;SAC/C;QAED,OAAO,CAAC,KAAK,CAAC,sBAAsB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAEhE,MAAM,oBAAoB,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;QACnD,IAAI,qBAAqB,CAAC;QAC1B,IAAI,QAAQ,EAAE,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,EAAE;YACxF,OAAO,CAAC,KAAK,CAAC,0CAA0C,QAAQ,CAAC,IAAI,cAAc,oBAAoB,EAAE,CAAC,CAAC;YAE3G,qBAAqB,GAAG,QAAQ,CAAC,IAAI,CAAC;SACvC;QACD,OAAO;YACL,QAAQ;YACR,SAAS;YACT,YAAY;YACZ,qBAAqB;YACrB,eAAe,EAAE,QAAQ,CAAC,eAAe;YACzC,cAAc,EAAE,QAAQ,CAAC,cAAc;SACxC,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AArDD,kCAqDC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1 @@
1
- export * from './errors';
2
1
  export * from './builder';
3
- export * from './installer';
package/dist/index.js CHANGED
@@ -14,7 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./errors"), exports);
18
17
  __exportStar(require("./builder"), exports);
19
- __exportStar(require("./installer"), exports);
20
18
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,4CAA0B;AAC1B,8CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B"}
@@ -1 +1,16 @@
1
- export declare function prepareBuildEnvForTasks(project_path: string, only?: string): Promise<void>;
1
+ export declare function ensureCustomNodeVersion(node_version: string, install_path: string): Promise<{
2
+ bin_path: string;
3
+ node_bin: string;
4
+ npm_bin: string;
5
+ }>;
6
+ export declare function downloadAndInstallNode(node_version: string, destination: string): Promise<{
7
+ bin_path: string;
8
+ node_bin: string;
9
+ npm_bin: string;
10
+ }>;
11
+ export declare function nodePaths(destination: string): {
12
+ bin_path: string;
13
+ node_bin: string;
14
+ npm_bin: string;
15
+ };
16
+ export declare function downloadAndExtractTarball(url: string, dest: string): Promise<void>;
package/dist/installer.js CHANGED
@@ -22,67 +22,117 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
25
28
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.prepareBuildEnvForTasks = void 0;
27
- const fs = __importStar(require("node:fs/promises"));
28
- const path = __importStar(require("node:path"));
29
+ exports.downloadAndExtractTarball = exports.nodePaths = exports.downloadAndInstallNode = exports.ensureCustomNodeVersion = void 0;
29
30
  const jetpack = __importStar(require("fs-jetpack"));
30
- const SUPPORTED_VERSIONS = [
31
- {
32
- version: '1.12.0',
33
- node: '16'
34
- },
35
- {
36
- version: '1.11.2',
37
- node: '14'
38
- },
39
- {
40
- version: '1.11.1',
41
- node: '14'
42
- },
43
- {
44
- version: '1.11.0',
45
- node: '14'
31
+ const path = __importStar(require("node:path"));
32
+ const URL = __importStar(require("node:url"));
33
+ const node_fetch_1 = __importDefault(require("node-fetch"));
34
+ const fs = __importStar(require("node:fs"));
35
+ const os = __importStar(require("node:os"));
36
+ const tar = __importStar(require("tar"));
37
+ async function ensureCustomNodeVersion(node_version, install_path) {
38
+ if (!jetpack.exists(path.join(install_path, 'bin/node'))) {
39
+ console.debug(`[node ${node_version}] Installing to ${install_path}`);
40
+ await jetpack.dirAsync(install_path);
41
+ await downloadAndInstallNode(node_version, install_path);
46
42
  }
47
- ];
48
- async function prepareBuildEnvForTasks(project_path, only) {
49
- // const subdirs = (await fs.readdir(project_path, { withFileTypes: true }))
50
- // .filter((dirent) => dirent.isDirectory())
51
- // .map((d) => d.name);
52
- // for (const dir of subdirs) {
53
- // try {
54
- // } catch (err) {
55
- // console.error(`ERROR: ${err}`)
56
- // // todo: check for enoent and skip
57
- // // todo: if json error, throw a CC build error
58
- // }
59
- // }
60
- const package_files = await jetpack.findAsync(path.join(project_path, 'cloudcode'), { matching: '**/package.json' });
61
- for (const pkg_path of package_files) {
62
- console.log(pkg_path);
63
- const pm = /^\/?cloudcode\/([^\/]+)\/package\.json$/.exec(pkg_path);
64
- if (!pm) {
65
- continue;
66
- }
67
- const taskName = pm[1];
68
- if (only != null && only != taskName) {
69
- // !(only.indexOf(taskName) >= 0)
70
- continue;
71
- }
72
- try {
73
- const content = await fs.readFile(pkg_path, { encoding: 'utf-8' });
74
- const task_package = JSON.parse(content);
75
- const task_version = task_package?.cloudcode?.runtime;
76
- // check task version against supported versions, install relevant node version and yarn
77
- // cwd into directory and run the correct node's yarn.
78
- console.log(`Detected task version ${task_version}`);
79
- }
80
- catch (err) {
81
- console.error(`ERROR: ${err}`);
82
- // todo: check for enoent and skip
83
- // todo: if json error, throw a CC build error
84
- }
43
+ else {
44
+ console.debug(`[node ${node_version}] Already installed in ${install_path}`);
45
+ }
46
+ return nodePaths(install_path);
47
+ }
48
+ exports.ensureCustomNodeVersion = ensureCustomNodeVersion;
49
+ /* Basically this, but for different dirs.
50
+ curl https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${PLATFORM}64.tar.gz -L | tar -xzC /node-dedicated && \
51
+ mv /node-dedicated/node-v${NODE_VERSION}-linux-${PLATFORM}64/bin/node /node-dedicated/node
52
+ */
53
+ // TODO: feature to find the latest minor and patch for a given major version?
54
+ async function downloadAndInstallNode(node_version, destination) {
55
+ // eg. https://nodejs.org/dist/v18.14.2/node-v18.14.2-linux-x64.tar.xz
56
+ const ARCH = os.arch();
57
+ const PLATFORM = os.platform();
58
+ const node_download_url = `https://nodejs.org/dist/v${node_version}/node-v${node_version}-${PLATFORM}-${ARCH}.tar.gz`;
59
+ await downloadAndExtractTarball(node_download_url, destination);
60
+ return nodePaths(destination);
61
+ }
62
+ exports.downloadAndInstallNode = downloadAndInstallNode;
63
+ function nodePaths(destination) {
64
+ return {
65
+ bin_path: path.resolve(destination, 'bin'),
66
+ node_bin: path.resolve(destination, 'bin', 'node'),
67
+ npm_bin: path.resolve(destination, 'bin', 'npm')
68
+ };
69
+ }
70
+ exports.nodePaths = nodePaths;
71
+ async function downloadAndExtractTarball(url, dest) {
72
+ const tmpdir = os.tmpdir();
73
+ const filename = path.basename(URL.parse(url).pathname);
74
+ const base = path.basename(filename, '.tar.gz');
75
+ const download = path.join(tmpdir, filename);
76
+ if (fs.existsSync(download)) {
77
+ console.debug(`deleting old ${download}`);
78
+ fs.unlinkSync(download);
85
79
  }
80
+ await new Promise(async (resolve, reject) => {
81
+ console.log(`fetching ${url} into ${download}`);
82
+ const response = await (0, node_fetch_1.default)(url);
83
+ if (!response.ok) {
84
+ const errorBody = await response.statusText;
85
+ throw new Error(`Failed to download: ${errorBody}`);
86
+ }
87
+ const file = fs.createWriteStream(download); // Sink the download stream into a file, so it can be extracted.
88
+ response.body.pipe(file);
89
+ file.on('finish', async () => {
90
+ try {
91
+ console.debug('Extracting...', download);
92
+ tar.extract({
93
+ cwd: tmpdir,
94
+ file: download,
95
+ sync: true
96
+ });
97
+ const uncomp = path.join(tmpdir, base);
98
+ const dist = path.resolve(dest);
99
+ // FIXME: dangerous. Add protection or replace.
100
+ // if (fs.existsSync(dist)) {
101
+ // fs.rmSync(dist, { recursive: true });
102
+ // }
103
+ if (fs.existsSync(uncomp)) {
104
+ console.debug(`Moving extracted files from ${uncomp} to ${dist}`);
105
+ fs.renameSync(uncomp, dist);
106
+ }
107
+ else {
108
+ console.debug(`Can't find extract dir ${uncomp}`);
109
+ }
110
+ /*
111
+ FIXME: this seems to sometimes cause errors: eg.
112
+ ```
113
+ node:events:505
114
+ throw er; // Unhandled 'error' event
115
+ ^
116
+
117
+ Error: ENOENT: no such file or directory, open '/var/folders/kc/h6m4zpmd23v13s63mygvkslm0000gn/T/node-v16.19.1-darwin-arm64.tar.gz'
118
+ Emitted 'error' event on ReadStream instance at:
119
+ at emitErrorNT (node:internal/streams/destroy:157:8)
120
+ at emitErrorCloseNT (node:internal/streams/destroy:122:3)
121
+ at processTicksAndRejections (node:internal/process/task_queues:83:21) {
122
+ errno: -2,
123
+ code: 'ENOENT',
124
+ syscall: 'open',
125
+ path: '/var/folders/kc/h6m4zpmd23v13s63mygvkslm0000gn/T/node-v16.19.1-darwin-arm64.tar.gz'
126
+ ```
127
+ */
128
+ // fs.unlinkSync(file.path);
129
+ resolve(null);
130
+ }
131
+ catch (err) {
132
+ reject(err);
133
+ }
134
+ });
135
+ });
86
136
  }
87
- exports.prepareBuildEnvForTasks = prepareBuildEnvForTasks;
137
+ exports.downloadAndExtractTarball = downloadAndExtractTarball;
88
138
  //# sourceMappingURL=installer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"installer.js","sourceRoot":"","sources":["../src/installer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qDAAuC;AACvC,gDAAkC;AAClC,oDAAsC;AAEtC,MAAM,k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L,CAAC,CAAC,CAAC;AACL,CAAC;AA1ED,8DA0EC"}
package/dist/run.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ /// <reference types="node" />
2
+ import { SpawnStreamEvent } from './spawn-stream';
3
+ import { SpawnOptions } from 'child_process';
4
+ export declare function runCommand(command: string, args: string[], options?: Partial<SpawnOptions>): AsyncIterable<SpawnStreamEvent>;
package/dist/run.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runCommand = void 0;
4
+ const spawn_stream_1 = require("./spawn-stream");
5
+ async function* runCommand(command, args, options) {
6
+ const { childProcess, stream } = (0, spawn_stream_1.spawnStream)(command, args, { cwd: options?.cwd, splitLines: true, ...options });
7
+ let exitCode = null;
8
+ for await (let event of stream) {
9
+ yield event;
10
+ if (event.exitCode != null) {
11
+ exitCode = event.exitCode;
12
+ }
13
+ }
14
+ if (exitCode != 0) {
15
+ throw new Error(`Command failed with code ${exitCode}`);
16
+ }
17
+ }
18
+ exports.runCommand = runCommand;
19
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":";;;AAAA,iDAA+D;AAGxD,KAAK,SAAS,CAAC,CAAC,UAAU,CAC/B,OAAe,EACf,IAAc,EACd,OAA+B;IAE/B,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,IAAA,0BAAW,EAAC,OAAO,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAEjH,IAAI,QAAQ,GAAkB,IAAI,CAAC;IAEnC,IAAI,KAAK,EAAE,IAAI,KAAK,IAAI,MAAM,EAAE;QAC9B,MAAM,KAAK,CAAC;QACZ,IAAI,KAAK,CAAC,QAAQ,IAAI,IAAI,EAAE;YAC1B,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;SAC3B;KACF;IAED,IAAI,QAAQ,IAAI,CAAC,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,4BAA4B,QAAQ,EAAE,CAAC,CAAC;KACzD;AACH,CAAC;AAnBD,gCAmBC"}
@@ -0,0 +1,15 @@
1
+ /// <reference types="node" />
2
+ import { SpawnOptions } from 'child_process';
3
+ export interface StreamOptions {
4
+ splitLines?: boolean;
5
+ }
6
+ export declare function spawnStream(command: string, args: string[], options: SpawnOptions & StreamOptions): {
7
+ childProcess: import("child_process").ChildProcessWithoutNullStreams;
8
+ stream: AsyncIterable<SpawnStreamEvent>;
9
+ };
10
+ export interface SpawnStreamEvent {
11
+ event: 'stdout' | 'stderr' | 'exit';
12
+ stdout?: string;
13
+ stderr?: string;
14
+ exitCode?: number;
15
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.spawnStream = void 0;
4
+ const child_process_1 = require("child_process");
5
+ const stream_1 = require("stream");
6
+ function spawnStream(command, args, options) {
7
+ const process = (0, child_process_1.spawn)(command, args, {
8
+ ...options,
9
+ stdio: 'pipe'
10
+ });
11
+ return {
12
+ childProcess: process,
13
+ stream: processToStream(process, options)
14
+ };
15
+ }
16
+ exports.spawnStream = spawnStream;
17
+ function processToStream(process, options) {
18
+ const combinedStream = new stream_1.PassThrough({ objectMode: true });
19
+ async function* transform(stream, key) {
20
+ stream.setEncoding('utf-8');
21
+ let iterable = stream;
22
+ if (options.splitLines) {
23
+ iterable = splitLines(iterable);
24
+ }
25
+ for await (const chunk of iterable) {
26
+ yield {
27
+ event: key,
28
+ [key]: chunk
29
+ };
30
+ }
31
+ }
32
+ if (process.stdout) {
33
+ stream_1.Readable.from(transform(process.stdout, 'stdout')).pipe(combinedStream, { end: false });
34
+ }
35
+ if (process.stderr) {
36
+ stream_1.Readable.from(transform(process.stderr, 'stderr')).pipe(combinedStream, { end: false });
37
+ }
38
+ process.on('exit', (code) => {
39
+ combinedStream.write({ exitCode: code }, () => {
40
+ combinedStream.end();
41
+ });
42
+ });
43
+ return combinedStream;
44
+ }
45
+ async function* splitLines(stream) {
46
+ let buffer = '';
47
+ for await (const chunk of stream) {
48
+ buffer += chunk;
49
+ const lines = buffer.split('\n');
50
+ buffer = lines.pop();
51
+ for (let line of lines) {
52
+ yield `${line}\n`;
53
+ }
54
+ }
55
+ if (buffer) {
56
+ yield buffer;
57
+ }
58
+ }
59
+ //# sourceMappingURL=spawn-stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spawn-stream.js","sourceRoot":"","sources":["../src/spawn-stream.ts"],"names":[],"mappings":";;;AAAA,iDAAkE;AAClE,mCAA+C;AAM/C,SAAgB,WAAW,CAAC,OAAe,EAAE,IAAc,EAAE,OAAqC;IAChG,MAAM,OAAO,GAAG,IAAA,qBAAK,EAAC,OAAO,EAAE,IAAI,EAAE;QACnC,GAAG,OAAO;QACV,KAAK,EAAE,MAAM;KACd,CAAC,CAAC;IAEH,OAAO;QACL,YAAY,EAAE,OAAO;QACrB,MAAM,EAAE,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC;KAC1C,CAAC;AACJ,CAAC;AAVD,kCAUC;AASD,SAAS,eAAe,CAAC,OAAqB,EAAE,OAAsB;IACpE,MAAM,cAAc,GAAG,IAAI,oBAAW,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAE7D,KAAK,SAAS,CAAC,CAAC,SAAS,CAAC,MAAgB,EAAE,GAAwB;QAClE,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC5B,IAAI,QAAQ,GAA0B,MAAM,CAAC;QAC7C,IAAI,OAAO,CAAC,UAAU,EAAE;YACtB,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;SACjC;QACD,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,QAAQ,EAAE;YAClC,MAAM;gBACJ,KAAK,EAAE,GAAG;gBACV,CAAC,GA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": "0.0.0-dev.9188dcc",
4
- "description": "",
3
+ "version": "0.0.0-dev.9202033",
4
+ "description": "Detect CloudCode tasks in a JourneyApps App and build them for installation on AWS Lambda",
5
5
  "main": "./dist/index",
6
6
  "types": "./dist/index",
7
- "license": "MIT",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
8
10
  "bin": {
9
11
  "cloudcode-build-agent": "./bin.js"
10
12
  },
13
+ "files": [
14
+ "bin.js",
15
+ "dist"
16
+ ],
11
17
  "dependencies": {
18
+ "child-process-promise": "^2.2.1",
12
19
  "fs-jetpack": "5.1.0",
20
+ "lodash": "4.17.21",
21
+ "node-fetch": "<3",
22
+ "semver": "7.3.8",
23
+ "tar": "6.1.13",
13
24
  "yargs": "17.6.2"
14
25
  },
15
26
  "devDependencies": {
16
- "@types/node": "^18.6.3",
27
+ "@types/child-process-promise": "2.2.2",
28
+ "@types/lodash": "4.14.191",
29
+ "@types/node": "14.18.36",
30
+ "@types/node-fetch": "2.6.2",
31
+ "@types/semver": "7.3.13",
32
+ "@types/tar": "6.1.4",
17
33
  "@types/yargs": "17.0.22",
18
34
  "typescript": "4.9.5"
19
35
  },
package/dist/errors.d.ts DELETED
@@ -1,8 +0,0 @@
1
- /// <reference types="node" />
2
- import { SpawnSyncReturns } from 'child_process';
3
- export declare class ProcessError extends Error {
4
- result: SpawnSyncReturns<string>;
5
- cause?: Error;
6
- status: number;
7
- constructor(result: SpawnSyncReturns<string>);
8
- }
package/dist/errors.js DELETED
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProcessError = void 0;
4
- class ProcessError extends Error {
5
- constructor(result) {
6
- super(constructMessage(result));
7
- this.result = result;
8
- if (result.error) {
9
- this.cause = result.error;
10
- }
11
- this.status = result.status || 1;
12
- }
13
- }
14
- exports.ProcessError = ProcessError;
15
- function constructMessage(result) {
16
- if (result.error) {
17
- return result.error.message;
18
- }
19
- return `${result.stdout}${result.stderr}`.trim();
20
- }
21
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAEA,MAAa,YAAa,SAAQ,KAAK;IAIrC,YAAmB,MAAgC;QACjD,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;QADf,WAAM,GAAN,MAAM,CAA0B;QAGjD,IAAI,MAAM,CAAC,KAAK,EAAE;YAChB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;SAC3B;QACD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;IACnC,CAAC;CACF;AAZD,oCAYC;AAED,SAAS,gBAAgB,CAAC,MAAgC;IACxD,IAAI,MAAM,CAAC,KAAK,EAAE;QAChB,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;KAC7B;IACD,OAAO,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;AACnD,CAAC"}
package/src/builder.ts DELETED
@@ -1,7 +0,0 @@
1
- import { spawnSync } from 'child_process';
2
-
3
- // Detect tasks in given path and build them.
4
- export async function buildTasks(src: string, dest: string, only?: string) {}
5
-
6
- // Build a single task in the specified subdirectory.
7
- async function buildTask(src: string, dest: string, config: any) {}
package/src/cli.ts DELETED
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import * as yargs from 'yargs';
4
-
5
- import { ProcessError, buildTasks, prepareBuildEnvForTasks } from './';
6
-
7
- const DEFAULT_SRC_PATH = './';
8
- const DEFAULT_OUT_PATH = '';
9
-
10
- yargs
11
- .command(
12
- ['build', '$0'], // $0 means this is the default command
13
- 'build tasks',
14
- (yargs) => {
15
- return yargs
16
- .option('only', { string: true })
17
- .option('path', { default: DEFAULT_SRC_PATH })
18
- .option('out', { default: DEFAULT_OUT_PATH });
19
- },
20
- handled(async (argv) => {
21
- // iterate over task directories and run: 'yarn cloudcode-build'.
22
- // optionally filtered by `argv.only` to build a single task.
23
-
24
- await buildTasks(argv.path, argv.out, argv.only);
25
- })
26
- )
27
- .command(
28
- 'prepare-env',
29
- 'Install node environments and packages for each task',
30
- (yargs) => {
31
- return yargs.option('only', { string: true }).option('path', { default: DEFAULT_SRC_PATH });
32
- },
33
- handled(async (argv) => {
34
- // iterate over task directories:
35
- // ensure required node version for task CC version is installed - What if too old - error?
36
- // run yarn install
37
-
38
- await prepareBuildEnvForTasks(argv.path, argv.only);
39
- })
40
- )
41
- .option('verbose', {
42
- alias: 'v',
43
- default: false
44
- }).argv;
45
-
46
- function handled<T>(fn: (argv: T) => Promise<void>): (argv: T) => Promise<void> {
47
- return async (argv: T) => {
48
- try {
49
- await fn(argv);
50
- } catch (err) {
51
- if (err instanceof ProcessError) {
52
- console.error(err.message);
53
- process.exit(err.status);
54
- } else {
55
- console.error(err.stack);
56
- process.exit(1);
57
- }
58
- }
59
- };
60
- }
package/src/errors.ts DELETED
@@ -1,22 +0,0 @@
1
- import { SpawnSyncReturns } from 'child_process';
2
-
3
- export class ProcessError extends Error {
4
- cause?: Error;
5
- status: number;
6
-
7
- constructor(public result: SpawnSyncReturns<string>) {
8
- super(constructMessage(result));
9
-
10
- if (result.error) {
11
- this.cause = result.error;
12
- }
13
- this.status = result.status || 1;
14
- }
15
- }
16
-
17
- function constructMessage(result: SpawnSyncReturns<string>): string {
18
- if (result.error) {
19
- return result.error.message;
20
- }
21
- return `${result.stdout}${result.stderr}`.trim();
22
- }
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './errors';
2
- export * from './builder';
3
- export * from './installer';
package/src/installer.ts DELETED
@@ -1,68 +0,0 @@
1
- import { spawnSync } from 'child_process';
2
- import * as fs from 'node:fs/promises';
3
- import * as path from 'node:path';
4
- import * as jetpack from 'fs-jetpack';
5
-
6
- const SUPPORTED_VERSIONS = [
7
- {
8
- version: '1.12.0',
9
- node: '16'
10
- },
11
- {
12
- version: '1.11.2',
13
- node: '14'
14
- },
15
- {
16
- version: '1.11.1',
17
- node: '14'
18
- },
19
- {
20
- version: '1.11.0',
21
- node: '14'
22
- }
23
- ];
24
-
25
- export async function prepareBuildEnvForTasks(project_path: string, only?: string) {
26
- // const subdirs = (await fs.readdir(project_path, { withFileTypes: true }))
27
- // .filter((dirent) => dirent.isDirectory())
28
- // .map((d) => d.name);
29
-
30
- // for (const dir of subdirs) {
31
- // try {
32
- // } catch (err) {
33
- // console.error(`ERROR: ${err}`)
34
- // // todo: check for enoent and skip
35
- // // todo: if json error, throw a CC build error
36
- // }
37
- // }
38
-
39
- const package_files = await jetpack.findAsync(path.join(project_path, 'cloudcode'), { matching: '**/package.json' });
40
-
41
- for (const pkg_path of package_files) {
42
- console.log(pkg_path);
43
- const pm = /^\/?cloudcode\/([^\/]+)\/package\.json$/.exec(pkg_path);
44
- if (!pm) {
45
- continue;
46
- }
47
- const taskName = pm[1];
48
-
49
- if (only != null && only != taskName) {
50
- // !(only.indexOf(taskName) >= 0)
51
- continue;
52
- }
53
-
54
- try {
55
- const content = await fs.readFile(pkg_path, { encoding: 'utf-8' });
56
- const task_package = JSON.parse(content);
57
- const task_version = task_package?.cloudcode?.runtime;
58
-
59
- // check task version against supported versions, install relevant node version and yarn
60
- // cwd into directory and run the correct node's yarn.
61
- console.log(`Detected task version ${task_version}`);
62
- } catch (err) {
63
- console.error(`ERROR: ${err}`);
64
- // todo: check for enoent and skip
65
- // todo: if json error, throw a CC build error
66
- }
67
- }
68
- }
package/tsconfig.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "@journeyapps-platform/micro-dev/tsconfig.base.json",
3
- "compilerOptions": {
4
- "outDir": "dist",
5
- "declarationDir": "dist",
6
- "rootDir": "src",
7
- "lib": ["es2019", "dom"],
8
- },
9
- }
@@ -1 +0,0 @@
1
- {"program":{"fileNames":["../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib/lib.esnext.intl.d.ts","./src/builder.ts","../../node_modules/.pnpm/@types+yargs-parser@21.0.0/node_modules/@types/yargs-parser/index.d.ts","../../node_modules/.pnpm/@types+yargs@17.0.22/node_modules/@types/yargs/index.d.ts","./src/errors.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/assert.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/assert/strict.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/globals.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/async_hooks.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/buffer.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/child_process.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/cluster.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/console.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/constants.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/crypto.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/dgram.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/dns.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/dns/promises.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/domain.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/events.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/fs.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/fs/promises.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/http.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/http2.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/https.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/inspector.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/module.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/net.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/os.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/path.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/perf_hooks.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/process.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/punycode.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/querystring.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/readline.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/repl.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/stream.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/stream/promises.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/stream/consumers.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/stream/web.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/string_decoder.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/test.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/timers.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/timers/promises.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/tls.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/trace_events.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/tty.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/url.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/util.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/v8.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/vm.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/wasi.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/worker_threads.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/zlib.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/globals.global.d.ts","../../node_modules/.pnpm/@types+node@18.6.3/node_modules/@types/node/index.d.ts","../../node_modules/.pnpm/fs-jetpack@5.1.0/node_modules/fs-jetpack/types.d.ts","../../node_modules/.pnpm/fs-jetpack@5.1.0/node_modules/fs-jetpack/index.d.ts","./src/installer.ts","./src/index.ts","./src/cli.ts","../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/index.d.ts","../../node_modules/.pnpm/@sinclair+typebox@0.24.23/node_modules/@sinclair/typebox/typebox.d.ts","../../node_modules/.pnpm/@jest+schemas@28.1.3/node_modules/@jest/schemas/build/index.d.ts","../../node_modules/.pnpm/pretty-format@28.1.3/node_modules/pretty-format/build/index.d.ts","../../node_modules/.pnpm/jest-diff@28.1.3/node_modules/jest-diff/build/index.d.ts","../../node_modules/.pnpm/jest-matcher-utils@28.1.3/node_modules/jest-matcher-utils/build/index.d.ts","../../node_modules/.pnpm/@types+jest@28.1.6/node_modules/@types/jest/index.d.ts","../../node_modules/.pnpm/@types+prettier@2.6.4/node_modules/@types/prettier/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","impliedFormat":1},{"version":"7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","impliedFormat":1},{"version":"8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","impliedFormat":1},{"version":"5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","impliedFormat":1},{"version":"4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","impliedFormat":1},{"version":"1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","impliedFormat":1},{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true,"impliedFormat":1},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true,"impliedFormat":1},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true,"impliedFormat":1},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true,"impliedFormat":1},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true,"impliedFormat":1},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true,"impliedFormat":1},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true,"impliedFormat":1},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true,"impliedFormat":1},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true,"impliedFormat":1},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true,"impliedFormat":1},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true,"impliedFormat":1},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true,"impliedFormat":1},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true,"impliedFormat":1},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true,"impliedFormat":1},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true,"impliedFormat":1},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true,"impliedFormat":1},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true,"impliedFormat":1},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true,"impliedFormat":1},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true,"impliedFormat":1},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true,"impliedFormat":1},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true,"impliedFormat":1},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true,"impliedFormat":1},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true,"impliedFormat":1},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true,"impliedFormat":1},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7a607233ff7e087b3f65b7e38d2291b0c09f9634fcb7a548ae418a37e059414","signature":"1029fbf85262cc49e783cdb0e0e8f0a4278449ee28e575836f5173e6954146c5","impliedFormat":1},{"version":"70e9a18da08294f75bf23e46c7d69e67634c0765d355887b9b41f0d959e1426e","impliedFormat":1},{"version":"ae84439d1ae42b30ced3df38c4285f35b805be40dfc95b0647d0e59c70b11f97","impliedFormat":1},{"version":"725d5a2bb4563d472bd727395c22c5a77be564723bbf7560900575be2441e7ca","signature":"ba73503beba4e6aca24507bd6605aaa460cde478439c00d7d8755740efc4542c","impliedFormat":1},{"version":"9122ed7070e054b73ebab37c2373a196def2d90e7d1a9a7fcd9d46b0e51fae78","impliedFormat":1},{"version":"a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a","impliedFormat":1},{"version":"77f0b5c6a193a699c9f7d7fb0578e64e562d271afa740783665d2a827104a873","affectsGlobalScope":true,"impliedFormat":1},{"version":"21a167fec8f933752fb8157f06d28fab6817af3ad9b0bdb1908a10762391eab9","impliedFormat":1},{"version":"3e4624c306340ad303cc536a07004e81336c3f088308a9e4a9f4c957a3cda2fd","affectsGlobalScope":true,"impliedFormat":1},{"version":"0c0cee62cb619aed81133b904f644515ba3064487002a7da83fd8aa07b1b4abd","impliedFormat":1},{"version":"5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713","impliedFormat":1},{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true,"impliedFormat":1},{"version":"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","impliedFormat":1},{"version":"34ec1daf3566f26c43dbab380af0de1aac29166e57e4f9ef379a2f154e0cb290","impliedFormat":1},{"version":"bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","impliedFormat":1},{"version":"75ecef44f126e2ae018b4abbd85b6e8a2e2ba1638ebec56cc64274643ce3567b","impliedFormat":1},{"version":"f30bb836526d930a74593f7b0f5c1c46d10856415a8f69e5e2fc3db80371e362","impliedFormat":1},{"version":"14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","impliedFormat":1},{"version":"5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea","impliedFormat":1},{"version":"249a2b90439cdfd51709539fbfa4dfe0791cbae6efce1e9b327ba8f8cd703f49","affectsGlobalScope":true,"impliedFormat":1},{"version":"acc8fa7e1d03f0d8c4af03c75027086d80bf1cb17edd2d71313bee7bd12dfb91","impliedFormat":1},{"version":"a9b6b0f7b1e30359283b131ba6d1c51ee2d3601a2f12e1623141e6a1a60c92a5","impliedFormat":1},{"version":"aeee0090b38de0dd47ca9a79ad5c2d156e3e09d92306719b0b45a3e96098e564","impliedFormat":1},{"version":"7bac475dcdd9f7e4e9da934d32c305bc889c4ce3c8ac0ef45a93a8d670fff607","impliedFormat":1},{"version":"09416dd69576b03a3f485adf329a02f043e4a481e060ef5b208194e488d31fd9","impliedFormat":1},{"version":"8acf99b1c8682276a63ea5bb68433782715892726b97e4604a415e4e56bce41c","impliedFormat":1},{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true,"impliedFormat":1},{"version":"3b145a2351f5cf16abf999c8d5f4481c74dffdc54ec1e9a89992e2622e1226c5","impliedFormat":1},{"version":"a907bf91df26df2400858ef75f749498fb5cf00062bf90a737ac3949cc07978d","impliedFormat":1},{"version":"cb92bc2e42b261e4299025756f1beb826b3d9666a3f0d46f8a7254ca512f57e4","impliedFormat":1},{"version":"4275d5f964e7fc7afc18538e26b3748c207dd772998346d17f409749aa1f3a63","impliedFormat":1},{"version":"59a638a504490fecaacf0020b9814b6abee37edb66047eb1ab9f7c2274bf1da0","affectsGlobalScope":true,"impliedFormat":1},{"version":"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","impliedFormat":1},{"version":"d1a78a3c5708807e8de3e399f91df4797c62e44b02195eefc2209b2e713e54ee","impliedFormat":1},{"version":"8c4c1a64db28930732033c31418f817dcb9d09d706766707ae6d38f23faf0c53","impliedFormat":1},{"version":"25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","impliedFormat":1},{"version":"556bf5c36deb62cffa1bf697c1789fe008ec82db0273025001db66732714e9d9","impliedFormat":1},{"version":"1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","impliedFormat":1},{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true,"impliedFormat":1},{"version":"44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","impliedFormat":1},{"version":"23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","impliedFormat":1},{"version":"653968fc1b35c5eb3d273d36fac1c1dc66f9537edf28f33485b8776bd956e23d","impliedFormat":1},{"version":"970a90f76d4d219ad60819d61f5994514087ba94c985647a3474a5a3d12714ed","affectsGlobalScope":true,"impliedFormat":1},{"version":"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","impliedFormat":1},{"version":"a381f079c4804442f179d742fdb2e495fe28d67a47cac673485f75ae2e77aeca","impliedFormat":1},{"version":"3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","impliedFormat":1},{"version":"5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2","impliedFormat":1},{"version":"bfe39beb986d2a2e512c091cbe924f1c415bc65de54de0e2f6a0dc6f84c183d9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2af17363f8a062e3a8cd1b26030af0058b3f86e783f4fc6aa9f57247f240ebaa","impliedFormat":1},{"version":"06d7c42d256f0ce6afe1b2b6cfbc97ab391f29dadb00dd0ae8e8f23f5bc916c3","impliedFormat":1},{"version":"dfe08140492cdc135fb7fd9c4a652c05207b61a436906079b87da1d3111314bf","impliedFormat":1},{"version":"e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa","impliedFormat":1},{"version":"089e1f8603cbc35ab977c8dcc662eb754b82fca32ed1dfb16bd682726c2d5432","impliedFormat":1},{"version":"8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e","impliedFormat":1},{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true,"impliedFormat":1},{"version":"64d5585e08ad1ab194b18bf4e851f22a626eae33ac7312ca4ba90bb7ea7daf64","impliedFormat":1},{"version":"e11aba8607f523fc03872ecc6c4c3f6b2f34150de8b914a47c5b2d575b99b348","impliedFormat":1},{"version":"1de20e515e0873439a53cd0c877a86099aa11b503a888e784d664b8a252e0197","impliedFormat":1},{"version":"28475ff3a7a006ff08b20b8a274c5714a2c35a73238ff00fa0f008f3fe9ca537","signature":"dc835f4c3e0e4992c6031dbba01652f81cd2d8e9ee26f149775597e11dc8cb50","impliedFormat":1},{"version":"3a9dcc3d705417c6464b9b769cde5cc865b9e191dfb833b1278888385a19dd5c","impliedFormat":1},{"version":"e7bba1184d0db93cf66ac1a8d0ade553df167d1bcce7e9c7ecdae86832f666c7","signature":"43e818adf60173644896298637f47b01d5819b17eda46eaa32d0c7d64724d012","impliedFormat":1},{"version":"0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","impliedFormat":1},{"version":"d982cdd2610155b3cbcbfa62ccabcf2d2b739f821518ef113348d160ef0010d9","impliedFormat":1},{"version":"ffcc5500e77223169833fc6eb59b3a507944a1f89574e0a1276b0ea7fc22c4a4","impliedFormat":1},{"version":"22f13de9e2fe5f0f4724797abd3d34a1cdd6e47ef81fc4933fea3b8bf4ad524b","impliedFormat":1},{"version":"e3ba509d3dce019b3190ceb2f3fc88e2610ab717122dabd91a9efaa37804040d","impliedFormat":1},{"version":"cda0cb09b995489b7f4c57f168cd31b83dcbaa7aad49612734fb3c9c73f6e4f2","impliedFormat":1},{"version":"1de1ad6a1929317171d8cfcd55bb2732257680c1bf89bcd53e1d46a4d8dbda22","affectsGlobalScope":true,"impliedFormat":1},{"version":"89877326fed87fa9601cf958e3af77d5901e24c1ba9a4099f69325f0c0e39b0a","impliedFormat":1}],"options":{"composite":true,"declaration":true,"declarationDir":"./dist","module":199,"outDir":"./dist","rootDir":"./src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":7,"useUnknownInCatchVariables":false},"fileIdsList":[[91,105],[91],[91,107,109],[47,91],[50,91],[51,56,91],[52,62,63,70,79,90,91],[52,53,62,70,91],[54,91],[55,56,63,71,91],[56,79,87,91],[57,59,62,70,91],[58,91],[59,60,91],[61,62,91],[62,91],[62,63,64,79,90,91],[62,63,64,79,82,91],[91,95],[65,70,79,90,91],[62,63,65,66,70,79,87,90,91],[65,67,79,87,90,91],[47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97],[62,68,91],[69,90,91],[59,62,70,79,91],[71,91],[72,91],[50,73,91],[74,89,91,95],[75,91],[76,91],[62,77,91],[77,78,91,93],[62,79,80,81,82,91],[79,81,91],[79,80,91],[82,91],[83,91],[62,85,86,91],[85,86,91],[56,70,79,87,91],[88,91],[70,89,91],[51,65,76,90,91],[56,91],[79,91,92],[91,93],[91,94],[51,56,62,64,73,79,90,91,93,95],[79,91,96],[44,91],[91,98,99],[63,91,98],[91,107],[91,104,108],[91,106],[52,91],[45,91,102],[43,46,91,101],[52,64,72,91,100],[52]],"referencedMap":[[106,1],[105,2],[110,3],[47,4],[48,4],[50,5],[51,6],[52,7],[53,8],[54,9],[55,10],[56,11],[57,12],[58,13],[59,14],[60,14],[61,15],[62,16],[63,17],[64,18],[49,19],[97,2],[65,20],[66,21],[67,22],[98,23],[68,24],[69,25],[70,26],[71,27],[72,28],[73,29],[74,30],[75,31],[76,32],[77,33],[78,34],[79,35],[81,36],[80,37],[82,38],[83,39],[84,2],[85,40],[86,41],[87,42],[88,43],[89,44],[90,45],[91,46],[92,47],[93,48],[94,49],[95,50],[96,51],[111,2],[44,2],[45,52],[104,2],[100,53],[99,54],[108,55],[109,56],[107,57],[8,2],[10,2],[9,2],[2,2],[11,2],[12,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[3,2],[4,2],[22,2],[19,2],[20,2],[21,2],[23,2],[24,2],[25,2],[5,2],[26,2],[27,2],[28,2],[29,2],[6,2],[33,2],[30,2],[31,2],[32,2],[34,2],[7,2],[35,2],[40,2],[41,2],[36,2],[37,2],[38,2],[39,2],[1,2],[42,2],[43,58],[103,59],[46,58],[102,60],[101,61]],"exportedModulesMap":[[106,1],[105,2],[110,3],[47,4],[48,4],[50,5],[51,6],[52,7],[53,8],[54,9],[55,10],[56,11],[57,12],[58,13],[59,14],[60,14],[61,15],[62,16],[63,17],[64,18],[49,19],[97,2],[65,20],[66,21],[67,22],[98,23],[68,24],[69,25],[70,26],[71,27],[72,28],[73,29],[74,30],[75,31],[76,32],[77,33],[78,34],[79,35],[81,36],[80,37],[82,38],[83,39],[84,2],[85,40],[86,41],[87,42],[88,43],[89,44],[90,45],[91,46],[92,47],[93,48],[94,49],[95,50],[96,51],[111,2],[44,2],[45,52],[104,2],[100,53],[99,54],[108,55],[109,56],[107,57],[8,2],[10,2],[9,2],[2,2],[11,2],[12,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[3,2],[4,2],[22,2],[19,2],[20,2],[21,2],[23,2],[24,2],[25,2],[5,2],[26,2],[27,2],[28,2],[29,2],[6,2],[33,2],[30,2],[31,2],[32,2],[34,2],[7,2],[35,2],[40,2],[41,2],[36,2],[37,2],[38,2],[39,2],[1,2],[42,2],[46,62],[102,60]],"semanticDiagnosticsPerFile":[106,105,110,47,48,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,49,97,65,66,67,98,68,69,70,71,72,73,74,75,76,77,78,79,81,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,111,44,45,104,100,99,108,109,107,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,42,43,103,46,102,101],"latestChangedDtsFile":"./dist/cli.d.ts"},"version":"4.9.5"}