@dcl/sdk-commands 7.0.0-4295573637.commit-6d503ad → 7.0.0-4314569031.commit-e8aeb07
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,7 +7,6 @@ const dcl_catalyst_client_1 = require("dcl-catalyst-client");
|
|
|
7
7
|
const crypto_1 = require("@dcl/crypto");
|
|
8
8
|
const eth_connect_1 = require("eth-connect");
|
|
9
9
|
const crypto_2 = require("@dcl/crypto/dist/crypto");
|
|
10
|
-
const build_1 = require("../build");
|
|
11
10
|
const scene_validations_1 = require("../../logic/scene-validations");
|
|
12
11
|
const args_1 = require("../../logic/args");
|
|
13
12
|
const project_validations_1 = require("../../logic/project-validations");
|
|
@@ -15,6 +14,7 @@ const api_1 = require("./linker-dapp/api");
|
|
|
15
14
|
const error_1 = require("../../logic/error");
|
|
16
15
|
const beautiful_logs_1 = require("../../logic/beautiful-logs");
|
|
17
16
|
const account_1 = require("../../logic/account");
|
|
17
|
+
const project_files_1 = require("../../logic/project-files");
|
|
18
18
|
exports.args = (0, args_1.getArgs)({
|
|
19
19
|
'--dir': String,
|
|
20
20
|
'--help': Boolean,
|
|
@@ -56,24 +56,28 @@ function help() {
|
|
|
56
56
|
}
|
|
57
57
|
exports.help = help;
|
|
58
58
|
async function main(options) {
|
|
59
|
-
const
|
|
59
|
+
const projectRoot = (0, path_1.resolve)(process.cwd(), options.args['--dir'] || '.');
|
|
60
60
|
const openBrowser = !options.args['--no-browser'];
|
|
61
61
|
const skipBuild = options.args['--skip-build'];
|
|
62
62
|
const linkerPort = options.args['--port'];
|
|
63
63
|
const { error } = options.components.logger;
|
|
64
|
-
const comps = { components: options.components };
|
|
65
|
-
if (!skipBuild) {
|
|
66
|
-
await (0, project_validations_1.npmRun)(dir, 'build');
|
|
67
|
-
}
|
|
68
|
-
await (0, build_1.main)({ args: { '--dir': dir }, ...comps });
|
|
69
64
|
if (options.args['--target'] && options.args['--target-content']) {
|
|
70
65
|
throw new error_1.CliError(`You can't set both the 'target' and 'target-content' arguments.`);
|
|
71
66
|
}
|
|
67
|
+
const sceneJson = await (0, scene_validations_1.getValidSceneJson)(options.components, projectRoot);
|
|
68
|
+
const coords = (0, scene_validations_1.getBaseCoords)(sceneJson);
|
|
69
|
+
const analyticsOpts = {
|
|
70
|
+
projectHash: await (0, project_files_1.b64HashingFunction)(projectRoot),
|
|
71
|
+
coords
|
|
72
|
+
};
|
|
73
|
+
await options.components.analytics.track('Scene deploy started', analyticsOpts);
|
|
74
|
+
if (!skipBuild) {
|
|
75
|
+
await (0, project_validations_1.npmRun)(projectRoot, 'build');
|
|
76
|
+
}
|
|
72
77
|
// Obtain list of files to deploy
|
|
73
|
-
const files = await (0, scene_validations_1.getFiles)(options.components,
|
|
78
|
+
const files = await (0, scene_validations_1.getFiles)(options.components, projectRoot);
|
|
74
79
|
(0, scene_validations_1.validateFilesSizes)(files);
|
|
75
80
|
const contentFiles = new Map(files.map((file) => [file.path, file.content]));
|
|
76
|
-
const sceneJson = await (0, scene_validations_1.getValidSceneJson)(options.components, dir);
|
|
77
81
|
const { entityId, files: entityFiles } = await dcl_catalyst_client_1.DeploymentBuilder.buildEntity({
|
|
78
82
|
type: schemas_1.EntityType.SCENE,
|
|
79
83
|
pointers: sceneJson.scene.parcels,
|
|
@@ -109,6 +113,7 @@ async function main(options) {
|
|
|
109
113
|
error('Could not upload content:');
|
|
110
114
|
console.log(e);
|
|
111
115
|
}
|
|
116
|
+
await options.components.analytics.track('Scene deploy success', analyticsOpts);
|
|
112
117
|
}
|
|
113
118
|
exports.main = main;
|
|
114
119
|
async function getCatalyst(target, targetContent) {
|
|
@@ -33,6 +33,20 @@ type Events = {
|
|
|
33
33
|
y: number;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
+
'Scene deploy started': {
|
|
37
|
+
projectHash: string;
|
|
38
|
+
coords: {
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
'Scene deploy success': {
|
|
44
|
+
projectHash: string;
|
|
45
|
+
coords: {
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
36
50
|
};
|
|
37
51
|
export declare function createAnalyticsComponent({ dclInfoConfig }: Pick<CliComponents, 'dclInfoConfig'>): Promise<IAnalyticsComponent>;
|
|
38
52
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/sdk-commands",
|
|
3
|
-
"version": "7.0.0-
|
|
3
|
+
"version": "7.0.0-4314569031.commit-e8aeb07",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc -p tsconfig.json",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"author": "Decentraland",
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@dcl/dcl-rollup": "7.0.6-
|
|
19
|
+
"@dcl/dcl-rollup": "7.0.6-4314569031.commit-e8aeb07",
|
|
20
20
|
"@dcl/hashing": "1.1.3",
|
|
21
21
|
"@dcl/linker-dapp": "0.7.0",
|
|
22
22
|
"@dcl/mini-comms": "1.0.1-20230216163137.commit-a4c75be",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"files": [
|
|
55
55
|
"dist"
|
|
56
56
|
],
|
|
57
|
-
"commit": "
|
|
57
|
+
"commit": "e8aeb07d8dc9bf6eb1b021853d9957ed2828c1e4"
|
|
58
58
|
}
|