@minecraft/core-build-tasks 1.2.1 → 3.0.1
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.json +237 -0
- package/CHANGELOG.md +115 -0
- package/README.md +4 -2
- package/lib/index.js +41892 -22
- package/lib/tasks/helpers/getGameDeploymentRootPaths.d.ts +1 -1
- package/lib/tasks/index.d.ts +2 -1
- package/lib/tasks/publishRelease.d.ts +22 -0
- package/lib/tasks/zip.d.ts +1 -1
- package/lib-cjs/index.js +41919 -0
- package/package.json +19 -18
- package/lib/index.js.map +0 -1
- package/lib/index.test.js +0 -11
- package/lib/index.test.js.map +0 -1
- package/lib/platforms/MinecraftProduct.js +0 -15
- package/lib/platforms/MinecraftProduct.js.map +0 -1
- package/lib/platforms/index.js +0 -20
- package/lib/platforms/index.js.map +0 -1
- package/lib/setupEnvironment.js +0 -18
- package/lib/setupEnvironment.js.map +0 -1
- package/lib/tasks/api-extractor.js +0 -35
- package/lib/tasks/api-extractor.js.map +0 -1
- package/lib/tasks/bundle.js +0 -98
- package/lib/tasks/bundle.js.map +0 -1
- package/lib/tasks/bundle.test.js +0 -344
- package/lib/tasks/bundle.test.js.map +0 -1
- package/lib/tasks/clean.js +0 -26
- package/lib/tasks/clean.js.map +0 -1
- package/lib/tasks/cleanCollateral.js +0 -88
- package/lib/tasks/cleanCollateral.js.map +0 -1
- package/lib/tasks/copy.js +0 -41
- package/lib/tasks/copy.js.map +0 -1
- package/lib/tasks/coreLint.js +0 -64
- package/lib/tasks/coreLint.js.map +0 -1
- package/lib/tasks/helpers/copyFiles.js +0 -31
- package/lib/tasks/helpers/copyFiles.js.map +0 -1
- package/lib/tasks/helpers/getGameDeploymentRootPaths.js +0 -65
- package/lib/tasks/helpers/getGameDeploymentRootPaths.js.map +0 -1
- package/lib/tasks/helpers/getOrThrowFromProcess.js +0 -22
- package/lib/tasks/helpers/getOrThrowFromProcess.js.map +0 -1
- package/lib/tasks/helpers/index.js +0 -22
- package/lib/tasks/helpers/index.js.map +0 -1
- package/lib/tasks/index.js +0 -30
- package/lib/tasks/index.js.map +0 -1
- package/lib/tasks/updateWorld.js +0 -26
- package/lib/tasks/updateWorld.js.map +0 -1
- package/lib/tasks/vitest.js +0 -13
- package/lib/tasks/vitest.js.map +0 -1
- package/lib/tasks/watch.js +0 -62
- package/lib/tasks/watch.js.map +0 -1
- package/lib/tasks/zip.js +0 -82
- package/lib/tasks/zip.js.map +0 -1
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT License.
|
|
4
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
-
};
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.copyFiles = void 0;
|
|
9
|
-
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
10
|
-
const path_1 = __importDefault(require("path"));
|
|
11
|
-
function copyFiles(originPaths, outputPath) {
|
|
12
|
-
let destinationPath = path_1.default.resolve(outputPath);
|
|
13
|
-
for (const originPath of originPaths) {
|
|
14
|
-
const inputPath = path_1.default.resolve(originPath);
|
|
15
|
-
const pathStats = node_core_library_1.FileSystem.getLinkStatistics(inputPath);
|
|
16
|
-
if (pathStats.isDirectory()) {
|
|
17
|
-
console.log(`Copying folder ${inputPath} to ${destinationPath}`);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
const filename = path_1.default.parse(inputPath).base;
|
|
21
|
-
destinationPath = path_1.default.resolve(destinationPath, filename);
|
|
22
|
-
console.log(`Copying file ${inputPath} to ${destinationPath}`);
|
|
23
|
-
}
|
|
24
|
-
node_core_library_1.FileSystem.copyFiles({
|
|
25
|
-
sourcePath: inputPath,
|
|
26
|
-
destinationPath: destinationPath,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.copyFiles = copyFiles;
|
|
31
|
-
//# sourceMappingURL=copyFiles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copyFiles.js","sourceRoot":"","sources":["../../../src/tasks/helpers/copyFiles.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;;;AAElC,oEAA0D;AAC1D,gDAAwB;AAExB,SAAgB,SAAS,CAAC,WAAqB,EAAE,UAAkB;IAC/D,IAAI,eAAe,GAAG,cAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/C,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACnC,MAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC3C,MAAM,SAAS,GAAG,8BAAU,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAC1D,IAAI,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;YAC1B,OAAO,CAAC,GAAG,CAAC,kBAAkB,SAAS,OAAO,eAAe,EAAE,CAAC,CAAC;QACrE,CAAC;aAAM,CAAC;YACJ,MAAM,QAAQ,GAAG,cAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC;YAC5C,eAAe,GAAG,cAAI,CAAC,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;YAC1D,OAAO,CAAC,GAAG,CAAC,gBAAgB,SAAS,OAAO,eAAe,EAAE,CAAC,CAAC;QACnE,CAAC;QAED,8BAAU,CAAC,SAAS,CAAC;YACjB,UAAU,EAAE,SAAS;YACrB,eAAe,EAAE,eAAe;SACnC,CAAC,CAAC;IACP,CAAC;AACL,CAAC;AAlBD,8BAkBC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT License.
|
|
4
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
-
if (k2 === undefined) k2 = k;
|
|
6
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
-
}
|
|
10
|
-
Object.defineProperty(o, k2, desc);
|
|
11
|
-
}) : (function(o, m, k, k2) {
|
|
12
|
-
if (k2 === undefined) k2 = k;
|
|
13
|
-
o[k2] = m[k];
|
|
14
|
-
}));
|
|
15
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
-
}) : function(o, v) {
|
|
18
|
-
o["default"] = v;
|
|
19
|
-
});
|
|
20
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
21
|
-
if (mod && mod.__esModule) return mod;
|
|
22
|
-
var result = {};
|
|
23
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
24
|
-
__setModuleDefault(result, mod);
|
|
25
|
-
return result;
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.getTargetWorldPath = exports.getGameDeploymentRootPaths = void 0;
|
|
29
|
-
const platforms_1 = require("../../platforms");
|
|
30
|
-
const path_1 = __importStar(require("path"));
|
|
31
|
-
const getOrThrowFromProcess_1 = require("./getOrThrowFromProcess");
|
|
32
|
-
function getGameDeploymentRootPaths() {
|
|
33
|
-
const localAppDataPath = process.env['LOCALAPPDATA'];
|
|
34
|
-
const customDeploymentPath = process.env['CUSTOM_DEPLOYMENT_PATH'];
|
|
35
|
-
return {
|
|
36
|
-
BedrockUWP: localAppDataPath
|
|
37
|
-
? (0, path_1.resolve)(localAppDataPath, 'Packages/Microsoft.MinecraftUWP_8wekyb3d8bbwe/LocalState/games/com.mojang/')
|
|
38
|
-
: undefined,
|
|
39
|
-
PreviewUWP: localAppDataPath
|
|
40
|
-
? (0, path_1.resolve)(localAppDataPath, 'Packages/Microsoft.MinecraftWindowsBeta_8wekyb3d8bbwe/LocalState/games/com.mojang/')
|
|
41
|
-
: undefined,
|
|
42
|
-
Custom: customDeploymentPath ? customDeploymentPath : undefined,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
exports.getGameDeploymentRootPaths = getGameDeploymentRootPaths;
|
|
46
|
-
function getTargetWorldPath() {
|
|
47
|
-
let deploymentPath = undefined;
|
|
48
|
-
let product;
|
|
49
|
-
try {
|
|
50
|
-
product = (0, getOrThrowFromProcess_1.getOrThrowFromProcess)('MINECRAFT_PRODUCT');
|
|
51
|
-
deploymentPath = getGameDeploymentRootPaths()[product];
|
|
52
|
-
}
|
|
53
|
-
catch (_) {
|
|
54
|
-
throw new Error('Unable to get deployment path. Make sure to configure package root correctly.');
|
|
55
|
-
}
|
|
56
|
-
if (deploymentPath === undefined) {
|
|
57
|
-
throw new Error('Deployment path is undefined. Make sure to configure package root correctly.');
|
|
58
|
-
}
|
|
59
|
-
const projectName = (0, getOrThrowFromProcess_1.getOrThrowFromProcess)('PROJECT_NAME');
|
|
60
|
-
const worldsFolderName = product === platforms_1.MinecraftProduct.Custom ? 'worlds' : 'minecraftWorlds';
|
|
61
|
-
const activeWorldFolderName = product === platforms_1.MinecraftProduct.Custom ? 'Bedrock level' : `${projectName}world`;
|
|
62
|
-
return path_1.default.join(deploymentPath, worldsFolderName, activeWorldFolderName);
|
|
63
|
-
}
|
|
64
|
-
exports.getTargetWorldPath = getTargetWorldPath;
|
|
65
|
-
//# sourceMappingURL=getGameDeploymentRootPaths.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getGameDeploymentRootPaths.js","sourceRoot":"","sources":["../../../src/tasks/helpers/getGameDeploymentRootPaths.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;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BAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,WAAW,OAAO,CAAC;IAC5G,OAAO,cAAI,CAAC,IAAI,CAAC,cAAc,EAAE,gBAAgB,EAAE,qBAAqB,CAAC,CAAC;AAC9E,CAAC;AAlBD,gDAkBC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT License.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.getOrThrowFromProcess = void 0;
|
|
6
|
-
/**
|
|
7
|
-
* Checks process.env for the desired key and returns the value if it exists, otherwise throws an error. Generic parameter
|
|
8
|
-
* is used to ensure the correct type is returned
|
|
9
|
-
*
|
|
10
|
-
* @param key - The key to query from process env
|
|
11
|
-
* @param message - Message to include in thrown error on failure
|
|
12
|
-
* @returns Value from process env or throws an error
|
|
13
|
-
*/
|
|
14
|
-
function getOrThrowFromProcess(key, messageOverride) {
|
|
15
|
-
const value = process.env[key];
|
|
16
|
-
if (!value) {
|
|
17
|
-
throw new Error(messageOverride ?? `Missing environment variable ${key}. Make sure to configure project.`);
|
|
18
|
-
}
|
|
19
|
-
return value;
|
|
20
|
-
}
|
|
21
|
-
exports.getOrThrowFromProcess = getOrThrowFromProcess;
|
|
22
|
-
//# sourceMappingURL=getOrThrowFromProcess.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getOrThrowFromProcess.js","sourceRoot":"","sources":["../../../src/tasks/helpers/getOrThrowFromProcess.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CAAa,GAAW,EAAE,eAAwB;IACnF,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,KAAK,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,eAAe,IAAI,gCAAgC,GAAG,mCAAmC,CAAC,CAAC;IAC/G,CAAC;IAED,OAAO,KAAU,CAAC;AACtB,CAAC;AAPD,sDAOC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT License.
|
|
4
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
-
if (k2 === undefined) k2 = k;
|
|
6
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
-
}
|
|
10
|
-
Object.defineProperty(o, k2, desc);
|
|
11
|
-
}) : (function(o, m, k, k2) {
|
|
12
|
-
if (k2 === undefined) k2 = k;
|
|
13
|
-
o[k2] = m[k];
|
|
14
|
-
}));
|
|
15
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
__exportStar(require("./copyFiles"), exports);
|
|
20
|
-
__exportStar(require("./getOrThrowFromProcess"), exports);
|
|
21
|
-
__exportStar(require("./getGameDeploymentRootPaths"), exports);
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tasks/helpers/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;AAElC,8CAA4B;AAC5B,0DAAwC;AACxC,+DAA6C"}
|
package/lib/tasks/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT License.
|
|
4
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
-
if (k2 === undefined) k2 = k;
|
|
6
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
-
}
|
|
10
|
-
Object.defineProperty(o, k2, desc);
|
|
11
|
-
}) : (function(o, m, k, k2) {
|
|
12
|
-
if (k2 === undefined) k2 = k;
|
|
13
|
-
o[k2] = m[k];
|
|
14
|
-
}));
|
|
15
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
__exportStar(require("./api-extractor"), exports);
|
|
20
|
-
__exportStar(require("./bundle"), exports);
|
|
21
|
-
__exportStar(require("./clean"), exports);
|
|
22
|
-
__exportStar(require("./cleanCollateral"), exports);
|
|
23
|
-
__exportStar(require("./copy"), exports);
|
|
24
|
-
__exportStar(require("./coreLint"), exports);
|
|
25
|
-
__exportStar(require("./helpers"), exports);
|
|
26
|
-
__exportStar(require("./vitest"), exports);
|
|
27
|
-
__exportStar(require("./updateWorld"), exports);
|
|
28
|
-
__exportStar(require("./watch"), exports);
|
|
29
|
-
__exportStar(require("./zip"), exports);
|
|
30
|
-
//# sourceMappingURL=index.js.map
|
package/lib/tasks/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tasks/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;AAElC,kDAAgC;AAChC,2CAAyB;AACzB,0CAAwB;AACxB,oDAAkC;AAClC,yCAAuB;AACvB,6CAA2B;AAC3B,4CAA0B;AAC1B,2CAAyB;AACzB,gDAA8B;AAC9B,0CAAwB;AACxB,wCAAsB"}
|
package/lib/tasks/updateWorld.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT License.
|
|
4
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
-
};
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.updateWorldTask = void 0;
|
|
9
|
-
const just_scripts_1 = require("just-scripts");
|
|
10
|
-
const clean_1 = require("./clean");
|
|
11
|
-
const helpers_1 = require("./helpers");
|
|
12
|
-
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
13
|
-
const path_1 = __importDefault(require("path"));
|
|
14
|
-
/**
|
|
15
|
-
* A just task which updates the world in the game from the development path. Original world is backed up.
|
|
16
|
-
*/
|
|
17
|
-
function updateWorldTask(params) {
|
|
18
|
-
const targetWorldPath = path_1.default.resolve((0, helpers_1.getTargetWorldPath)());
|
|
19
|
-
(0, just_scripts_1.task)('clean_localmc_world_backup', (0, clean_1.cleanTask)([params.backupPath]));
|
|
20
|
-
(0, just_scripts_1.task)('backup_localmc_world', () => (0, helpers_1.copyFiles)([targetWorldPath], params.backupPath));
|
|
21
|
-
(0, just_scripts_1.task)('clean_localmc_world', (0, clean_1.cleanTask)([targetWorldPath]));
|
|
22
|
-
(0, just_scripts_1.task)('deploy_localmc_world', () => (0, helpers_1.copyFiles)([params.devWorldPath], targetWorldPath));
|
|
23
|
-
return (0, just_scripts_1.series)('clean_localmc_world_backup', (0, just_scripts_1.condition)('backup_localmc_world', () => node_core_library_1.FileSystem.exists(targetWorldPath)), 'clean_localmc_world', 'deploy_localmc_world');
|
|
24
|
-
}
|
|
25
|
-
exports.updateWorldTask = updateWorldTask;
|
|
26
|
-
//# sourceMappingURL=updateWorld.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updateWorld.js","sourceRoot":"","sources":["../../src/tasks/updateWorld.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;;;AAElC,+CAAqE;AACrE,mCAAoC;AACpC,uCAA0D;AAC1D,oEAA0D;AAC1D,gDAAwB;AAcxB;;GAEG;AACH,SAAgB,eAAe,CAAC,MAA6B;IACzD,MAAM,eAAe,GAAG,cAAI,CAAC,OAAO,CAAC,IAAA,4BAAkB,GAAE,CAAC,CAAC;IAC3D,IAAA,mBAAI,EAAC,4BAA4B,EAAE,IAAA,iBAAS,EAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACnE,IAAA,mBAAI,EAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,IAAA,mBAAS,EAAC,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IACpF,IAAA,mBAAI,EAAC,qBAAqB,EAAE,IAAA,iBAAS,EAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAC1D,IAAA,mBAAI,EAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,IAAA,mBAAS,EAAC,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC;IACtF,OAAO,IAAA,qBAAM,EACT,4BAA4B,EAC5B,IAAA,wBAAS,EAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,8BAAU,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAC3E,qBAAqB,EACrB,sBAAsB,CACzB,CAAC;AACN,CAAC;AAZD,0CAYC"}
|
package/lib/tasks/vitest.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT License.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.vitestTask = void 0;
|
|
6
|
-
const child_process_1 = require("child_process");
|
|
7
|
-
function vitestTask() {
|
|
8
|
-
return () => {
|
|
9
|
-
(0, child_process_1.execSync)('vitest', { stdio: 'inherit' });
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
exports.vitestTask = vitestTask;
|
|
13
|
-
//# sourceMappingURL=vitest.js.map
|
package/lib/tasks/vitest.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vitest.js","sourceRoot":"","sources":["../../src/tasks/vitest.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,iDAAyC;AAEzC,SAAgB,UAAU;IACtB,OAAO,GAAG,EAAE;QACR,IAAA,wBAAQ,EAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC;AACN,CAAC;AAJD,gCAIC"}
|
package/lib/tasks/watch.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT License.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.watchTask = void 0;
|
|
6
|
-
const just_scripts_1 = require("just-scripts");
|
|
7
|
-
const WATCH_TASK_NAME = 'watch-task';
|
|
8
|
-
(0, just_scripts_1.option)('watch');
|
|
9
|
-
/**
|
|
10
|
-
* If command line parameter `option` is present, watch for changes in the specified files and run the specified task.
|
|
11
|
-
* Otherwise, just run the task.
|
|
12
|
-
* @param globs The file globs to watch.
|
|
13
|
-
* @param taskFunction The task to run when changes are detected.
|
|
14
|
-
*/
|
|
15
|
-
function watchTask(globs, taskFunction) {
|
|
16
|
-
return () => {
|
|
17
|
-
if (!(0, just_scripts_1.argv)().watch) {
|
|
18
|
-
return taskFunction;
|
|
19
|
-
}
|
|
20
|
-
let taskInProgress = true;
|
|
21
|
-
let pendingWork = false;
|
|
22
|
-
const onFinished = (args) => {
|
|
23
|
-
if (args.name === WATCH_TASK_NAME) {
|
|
24
|
-
if (pendingWork) {
|
|
25
|
-
just_scripts_1.logger.info('Processing pending changes...');
|
|
26
|
-
pendingWork = false;
|
|
27
|
-
origTask.call();
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
just_scripts_1.logger.info('Waiting for new changes...');
|
|
31
|
-
taskInProgress = false;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
just_scripts_1.undertaker.on('start', function (args) {
|
|
36
|
-
if (args.name === WATCH_TASK_NAME) {
|
|
37
|
-
taskInProgress = true;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
just_scripts_1.undertaker.on('stop', function (args) {
|
|
41
|
-
onFinished(args);
|
|
42
|
-
});
|
|
43
|
-
just_scripts_1.undertaker.on('error', function (args) {
|
|
44
|
-
onFinished(args);
|
|
45
|
-
});
|
|
46
|
-
(0, just_scripts_1.task)(WATCH_TASK_NAME, (0, just_scripts_1.series)(taskFunction));
|
|
47
|
-
let origTask = (0, just_scripts_1.series)(WATCH_TASK_NAME);
|
|
48
|
-
// Start execution.
|
|
49
|
-
origTask.call();
|
|
50
|
-
(0, just_scripts_1.watch)(globs, () => {
|
|
51
|
-
if (!taskInProgress) {
|
|
52
|
-
origTask.call();
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
pendingWork = true;
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
return Promise.resolve();
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
exports.watchTask = watchTask;
|
|
62
|
-
//# sourceMappingURL=watch.js.map
|
package/lib/tasks/watch.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../../src/tasks/watch.ts"],"names":[],"mappings":";A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,EAAE,IAAA,qBAAM,EAAC,YAAY,CAAC,CAAC,CAAC;QAC5C,IAAI,QAAQ,GAAG,IAAA,qBAAM,EAAC,eAAe,CAAC,CAAC;QAEvC,mBAAmB;QAClB,QAAgB,CAAC,IAAI,EAAE,CAAC;QAEzB,IAAA,oBAAK,EAAC,KAAK,EAAE,GAAG,EAAE;YACd,IAAI,CAAC,cAAc,EAAE,CAAC;gBACjB,QAAgB,CAAC,IAAI,EAAE,CAAC;YAC7B,CAAC;iBAAM,CAAC;gBACJ,WAAW,GAAG,IAAI,CAAC;YACvB,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC,CAAC;AACN,CAAC;AAnDD,8BAmDC"}
|
package/lib/tasks/zip.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT License.
|
|
4
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
-
};
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.mcaddonTask = exports.zipTask = void 0;
|
|
9
|
-
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
10
|
-
const path_1 = __importDefault(require("path"));
|
|
11
|
-
const zip_lib_1 = require("zip-lib");
|
|
12
|
-
const just_scripts_1 = require("just-scripts");
|
|
13
|
-
function addContentsToZip(zipContents, zip) {
|
|
14
|
-
for (const content of zipContents) {
|
|
15
|
-
for (const originPath of content.contents) {
|
|
16
|
-
const inputPath = path_1.default.resolve(originPath);
|
|
17
|
-
const pathStats = node_core_library_1.FileSystem.getLinkStatistics(inputPath);
|
|
18
|
-
if (pathStats.isDirectory()) {
|
|
19
|
-
console.log(`Adding folder ${inputPath} to package`);
|
|
20
|
-
zip.addFolder(inputPath, content.targetPath);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
const metadataPath = content.targetPath
|
|
24
|
-
? path_1.default.join(content.targetPath, path_1.default.parse(inputPath).base)
|
|
25
|
-
: undefined;
|
|
26
|
-
console.log(`Adding file ${inputPath} to package`);
|
|
27
|
-
zip.addFile(inputPath, metadataPath);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* A just task which compresses files into a specified output file.
|
|
34
|
-
*/
|
|
35
|
-
function zipTask(outputFile, zipContents) {
|
|
36
|
-
return async function zip() {
|
|
37
|
-
if (zipContents.length === 0 || !zipContents.some(content => content.contents.length > 0)) {
|
|
38
|
-
process.exitCode = 0;
|
|
39
|
-
return Promise.resolve();
|
|
40
|
-
}
|
|
41
|
-
const zip = new zip_lib_1.Zip();
|
|
42
|
-
addContentsToZip(zipContents, zip);
|
|
43
|
-
let isSucceeded = true;
|
|
44
|
-
let errorMessage = '';
|
|
45
|
-
await zip.archive(outputFile).then(function () {
|
|
46
|
-
console.error(`Compressed file created at ${outputFile}`);
|
|
47
|
-
}, function (err) {
|
|
48
|
-
isSucceeded = false;
|
|
49
|
-
errorMessage = `Compressed file failed to be created at ${outputFile}: ${err}`;
|
|
50
|
-
console.error(errorMessage);
|
|
51
|
-
});
|
|
52
|
-
if (isSucceeded) {
|
|
53
|
-
process.exitCode = 0;
|
|
54
|
-
return Promise.resolve();
|
|
55
|
-
}
|
|
56
|
-
process.exitCode = 1;
|
|
57
|
-
return Promise.reject(new Error(errorMessage));
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
exports.zipTask = zipTask;
|
|
61
|
-
/**
|
|
62
|
-
* A just task which creates the mcaddon file.
|
|
63
|
-
*/
|
|
64
|
-
function mcaddonTask(params) {
|
|
65
|
-
const targetFolder = path_1.default.parse(params.outputFile).dir;
|
|
66
|
-
const outputFileName = path_1.default.parse(params.outputFile).name;
|
|
67
|
-
const behaviorPackFile = path_1.default.join(targetFolder, `${outputFileName}_bp.mcpack`);
|
|
68
|
-
const resourcePackFile = path_1.default.join(targetFolder, `${outputFileName}_rp.mcpack`);
|
|
69
|
-
const mcaddonContents = { contents: [behaviorPackFile] };
|
|
70
|
-
if (params.copyToResourcePacks && params.copyToResourcePacks.length > 0) {
|
|
71
|
-
mcaddonContents.contents.push(resourcePackFile);
|
|
72
|
-
}
|
|
73
|
-
(0, just_scripts_1.task)('packBP', zipTask(behaviorPackFile, [
|
|
74
|
-
{ contents: params.copyToBehaviorPacks },
|
|
75
|
-
{ contents: params.copyToScripts, targetPath: 'scripts' },
|
|
76
|
-
]));
|
|
77
|
-
(0, just_scripts_1.task)('packRP', zipTask(resourcePackFile, [{ contents: params.copyToResourcePacks ?? [] }]));
|
|
78
|
-
(0, just_scripts_1.task)('packMcaddon', zipTask(params.outputFile, [mcaddonContents]));
|
|
79
|
-
return (0, just_scripts_1.series)((0, just_scripts_1.parallel)('packBP', 'packRP'), 'packMcaddon');
|
|
80
|
-
}
|
|
81
|
-
exports.mcaddonTask = mcaddonTask;
|
|
82
|
-
//# sourceMappingURL=zip.js.map
|
package/lib/tasks/zip.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zip.js","sourceRoot":"","sources":["../../src/tasks/zip.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;;;AAElC,oEAA0D;AAC1D,gDAAwB;AAExB,qCAA8B;AAC9B,+CAAoE;AAoBpE,SAAS,gBAAgB,CAAC,WAAyB,EAAE,GAAQ;IACzD,KAAK,MAAM,OAAO,IAAI,WAAW,EAAE,CAAC;QAChC,KAAK,MAAM,UAAU,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACxC,MAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YAC3C,MAAM,SAAS,GAAG,8BAAU,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;YAE1D,IAAI,SAAS,CAAC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