@dcl/sdk-commands 7.1.4-4546888614.commit-9751782 → 7.1.4-4566053119.commit-f66a565
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/logic/bundle.d.ts +2 -1
- package/dist/logic/bundle.js +11 -6
- package/package.json +3 -3
package/dist/logic/bundle.d.ts
CHANGED
@@ -19,7 +19,8 @@ export declare function bundleProject(components: BundleComponents, options: Com
|
|
19
19
|
platform: "browser";
|
20
20
|
format: "cjs";
|
21
21
|
preserveSymlinks: false;
|
22
|
-
outfile: string;
|
22
|
+
outfile: string | undefined;
|
23
|
+
outdir: string | undefined;
|
23
24
|
allowOverwrite: false;
|
24
25
|
sourcemap: "external" | "inline";
|
25
26
|
minify: boolean;
|
package/dist/logic/bundle.js
CHANGED
@@ -16,6 +16,7 @@ const path_1 = require("path");
|
|
16
16
|
const beautiful_logs_1 = require("./beautiful-logs");
|
17
17
|
const log_1 = require("../components/log");
|
18
18
|
const url_1 = require("url");
|
19
|
+
const glob_1 = require("glob");
|
19
20
|
const MAX_STEP = 3;
|
20
21
|
async function bundleProject(components, options) {
|
21
22
|
const sceneJson = await (0, scene_validations_1.getValidSceneJson)(components, options.workingDirectory);
|
@@ -30,17 +31,18 @@ async function bundleProject(components, options) {
|
|
30
31
|
if (!(await components.fs.fileExists(tsconfig))) {
|
31
32
|
throw new error_1.CliError(`File ${tsconfig} must exist to compile the Typescript project`);
|
32
33
|
}
|
33
|
-
const input = options.single ?? 'src/index.ts';
|
34
|
+
const input = (0, glob_1.globSync)(options.single ?? 'src/index.ts');
|
34
35
|
const output = !options.single ? sceneJson.main : options.single.replace(/\.ts$/, '.js');
|
35
36
|
const outfile = (0, path_1.join)(options.workingDirectory, output);
|
36
|
-
(0, beautiful_logs_1.printProgressStep)(components.logger, `Bundling file ${log_1.colors.bold(input)}`, 2, MAX_STEP);
|
37
|
+
(0, beautiful_logs_1.printProgressStep)(components.logger, `Bundling file ${log_1.colors.bold(input.join(','))}`, 2, MAX_STEP);
|
37
38
|
const context = await esbuild_1.default.context({
|
38
|
-
entryPoints:
|
39
|
+
entryPoints: input,
|
39
40
|
bundle: true,
|
40
41
|
platform: 'browser',
|
41
42
|
format: 'cjs',
|
42
43
|
preserveSymlinks: false,
|
43
|
-
outfile,
|
44
|
+
outfile: input.length > 1 ? undefined : outfile,
|
45
|
+
outdir: input.length > 1 ? (0, path_1.dirname)(outfile) : undefined,
|
44
46
|
allowOverwrite: false,
|
45
47
|
sourcemap: options.production ? 'external' : 'inline',
|
46
48
|
minify: options.production,
|
@@ -71,17 +73,20 @@ async function bundleProject(components, options) {
|
|
71
73
|
});
|
72
74
|
if (options.watch) {
|
73
75
|
await context.watch({});
|
76
|
+
(0, beautiful_logs_1.printProgressInfo)(components.logger, `Bundle saved ${log_1.colors.bold(output)}`);
|
74
77
|
}
|
75
78
|
else {
|
76
79
|
try {
|
77
|
-
await context.rebuild();
|
80
|
+
const ctx = await context.rebuild();
|
81
|
+
(0, beautiful_logs_1.printProgressInfo)(components.logger, `Bundle saved ${log_1.colors.bold(Object.keys(ctx.metafile.outputs)
|
82
|
+
.filter((_) => _.endsWith('.js'))
|
83
|
+
.join(',') || outfile)}`);
|
78
84
|
}
|
79
85
|
catch (err) {
|
80
86
|
throw new error_1.CliError(err.toString());
|
81
87
|
}
|
82
88
|
await context.dispose();
|
83
89
|
}
|
84
|
-
(0, beautiful_logs_1.printProgressInfo)(components.logger, `Bundle saved ${log_1.colors.bold(output)}`);
|
85
90
|
if (options.watch)
|
86
91
|
(0, beautiful_logs_1.printProgressInfo)(components.logger, `The compiler is watching for changes`);
|
87
92
|
await runTypeChecker(components, options);
|
package/package.json
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dcl/sdk-commands",
|
3
3
|
"description": "",
|
4
|
-
"version": "7.1.4-
|
4
|
+
"version": "7.1.4-4566053119.commit-f66a565",
|
5
5
|
"author": "Decentraland",
|
6
6
|
"bin": {
|
7
7
|
"sdk-commands": "./dist/index.js"
|
8
8
|
},
|
9
9
|
"dependencies": {
|
10
10
|
"@dcl/hashing": "1.1.3",
|
11
|
-
"@dcl/inspector": "7.1.4-
|
11
|
+
"@dcl/inspector": "7.1.4-4566053119.commit-f66a565",
|
12
12
|
"@dcl/linker-dapp": "0.7.0",
|
13
13
|
"@dcl/mini-comms": "1.0.1-20230216163137.commit-a4c75be",
|
14
14
|
"@dcl/protocol": "1.0.0-4493564897.commit-c858f8a",
|
@@ -60,5 +60,5 @@
|
|
60
60
|
"displayName": "SDK",
|
61
61
|
"tsconfig": "./tsconfig.json"
|
62
62
|
},
|
63
|
-
"commit": "
|
63
|
+
"commit": "f66a56590699f658a10976b6b436f456f7707443"
|
64
64
|
}
|