@minecraft/core-build-tasks 5.3.1 → 5.4.0
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 +31 -1
- package/CHANGELOG.md +18 -2
- package/lib/index.js +36 -5
- package/lib/tasks/helpers/copyFiles.d.ts +1 -1
- package/lib-cjs/index.js +36 -5
- package/package.json +2 -2
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,37 @@
|
|
|
2
2
|
"name": "@minecraft/core-build-tasks",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Wed, 10 Sep 2025 20:47:16 GMT",
|
|
6
|
+
"version": "5.4.0",
|
|
7
|
+
"tag": "@minecraft/core-build-tasks_v5.4.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "keyyard8888@gmail.com",
|
|
12
|
+
"package": "@minecraft/core-build-tasks",
|
|
13
|
+
"commit": "70f1d4de332cc4477f02729a42c28b13b13fd64b",
|
|
14
|
+
"comment": "added sizeCheck as a flag"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Thu, 04 Sep 2025 23:12:17 GMT",
|
|
21
|
+
"version": "5.3.2",
|
|
22
|
+
"tag": "@minecraft/core-build-tasks_v5.3.2",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "mc-npm@microsoft.com",
|
|
27
|
+
"package": "@minecraft/core-build-tasks",
|
|
28
|
+
"commit": "c4906fa36084307b5a29c18c5daca82004205cae",
|
|
29
|
+
"comment": "build(dependabot): bump just-scripts from 2.3.3 to 2.4.1"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Thu, 24 Jul 2025 18:29:00 GMT",
|
|
6
36
|
"version": "5.3.1",
|
|
7
37
|
"tag": "@minecraft/core-build-tasks_v5.3.1",
|
|
8
38
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
# Change Log - @minecraft/core-build-tasks
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Wed, 10 Sep 2025 20:47:16 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 5.4.0
|
|
8
|
+
|
|
9
|
+
Wed, 10 Sep 2025 20:47:16 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- added sizeCheck as a flag (keyyard8888@gmail.com)
|
|
14
|
+
|
|
15
|
+
## 5.3.2
|
|
16
|
+
|
|
17
|
+
Thu, 04 Sep 2025 23:12:17 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- build(dependabot): bump just-scripts from 2.3.3 to 2.4.1 (mc-npm@microsoft.com)
|
|
22
|
+
|
|
7
23
|
## 5.3.1
|
|
8
24
|
|
|
9
|
-
Thu, 24 Jul 2025 18:
|
|
25
|
+
Thu, 24 Jul 2025 18:29:00 GMT
|
|
10
26
|
|
|
11
27
|
### Patches
|
|
12
28
|
|
package/lib/index.js
CHANGED
|
@@ -53779,8 +53779,9 @@ import path5 from "path";
|
|
|
53779
53779
|
// src/tasks/helpers/copyFiles.ts
|
|
53780
53780
|
var import_node_core_library = __toESM(require_lib2());
|
|
53781
53781
|
import path3 from "path";
|
|
53782
|
-
function copyFiles(originPaths, outputPath) {
|
|
53783
|
-
|
|
53782
|
+
function copyFiles(originPaths, outputPath, skipIfPossible = true) {
|
|
53783
|
+
const destinationPath = path3.resolve(outputPath);
|
|
53784
|
+
const MTIME_TOLERANCE_MS = 1e3;
|
|
53784
53785
|
for (const originPath of originPaths) {
|
|
53785
53786
|
const inputPath = path3.resolve(originPath);
|
|
53786
53787
|
const pathStats = import_node_core_library.FileSystem.getLinkStatistics(inputPath);
|
|
@@ -53788,12 +53789,42 @@ function copyFiles(originPaths, outputPath) {
|
|
|
53788
53789
|
console.log(`Copying folder ${inputPath} to ${destinationPath}`);
|
|
53789
53790
|
} else {
|
|
53790
53791
|
const filename = path3.parse(inputPath).base;
|
|
53791
|
-
|
|
53792
|
-
|
|
53792
|
+
const fileDestinationPath = path3.resolve(destinationPath, filename);
|
|
53793
|
+
let shouldCopy = true;
|
|
53794
|
+
if (skipIfPossible) {
|
|
53795
|
+
try {
|
|
53796
|
+
const destFileStats = import_node_core_library.FileSystem.getStatistics(fileDestinationPath);
|
|
53797
|
+
if (destFileStats.size !== pathStats.size) {
|
|
53798
|
+
shouldCopy = true;
|
|
53799
|
+
} else {
|
|
53800
|
+
const srcMtime = pathStats.mtimeMs ?? pathStats.mtime.getTime();
|
|
53801
|
+
const destMtime = destFileStats.mtimeMs ?? destFileStats.mtime.getTime();
|
|
53802
|
+
if (Math.abs(srcMtime - destMtime) > MTIME_TOLERANCE_MS) {
|
|
53803
|
+
shouldCopy = true;
|
|
53804
|
+
} else {
|
|
53805
|
+
shouldCopy = false;
|
|
53806
|
+
}
|
|
53807
|
+
}
|
|
53808
|
+
} catch {
|
|
53809
|
+
shouldCopy = true;
|
|
53810
|
+
}
|
|
53811
|
+
}
|
|
53812
|
+
if (!shouldCopy) {
|
|
53813
|
+
console.log(`Skipping copy for ${inputPath}; no change detected`);
|
|
53814
|
+
continue;
|
|
53815
|
+
}
|
|
53816
|
+
console.log(`Copying file ${inputPath} to ${fileDestinationPath}`);
|
|
53817
|
+
import_node_core_library.FileSystem.copyFiles({
|
|
53818
|
+
sourcePath: inputPath,
|
|
53819
|
+
destinationPath: fileDestinationPath,
|
|
53820
|
+
preserveTimestamps: true
|
|
53821
|
+
});
|
|
53822
|
+
continue;
|
|
53793
53823
|
}
|
|
53794
53824
|
import_node_core_library.FileSystem.copyFiles({
|
|
53795
53825
|
sourcePath: inputPath,
|
|
53796
|
-
destinationPath
|
|
53826
|
+
destinationPath,
|
|
53827
|
+
preserveTimestamps: true
|
|
53797
53828
|
});
|
|
53798
53829
|
}
|
|
53799
53830
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function copyFiles(originPaths: string[], outputPath: string): void;
|
|
1
|
+
export declare function copyFiles(originPaths: string[], outputPath: string, skipIfPossible?: boolean): void;
|
package/lib-cjs/index.js
CHANGED
|
@@ -53806,8 +53806,9 @@ var import_path5 = __toESM(require("path"));
|
|
|
53806
53806
|
// src/tasks/helpers/copyFiles.ts
|
|
53807
53807
|
var import_node_core_library = __toESM(require_lib2());
|
|
53808
53808
|
var import_path3 = __toESM(require("path"));
|
|
53809
|
-
function copyFiles(originPaths, outputPath) {
|
|
53810
|
-
|
|
53809
|
+
function copyFiles(originPaths, outputPath, skipIfPossible = true) {
|
|
53810
|
+
const destinationPath = import_path3.default.resolve(outputPath);
|
|
53811
|
+
const MTIME_TOLERANCE_MS = 1e3;
|
|
53811
53812
|
for (const originPath of originPaths) {
|
|
53812
53813
|
const inputPath = import_path3.default.resolve(originPath);
|
|
53813
53814
|
const pathStats = import_node_core_library.FileSystem.getLinkStatistics(inputPath);
|
|
@@ -53815,12 +53816,42 @@ function copyFiles(originPaths, outputPath) {
|
|
|
53815
53816
|
console.log(`Copying folder ${inputPath} to ${destinationPath}`);
|
|
53816
53817
|
} else {
|
|
53817
53818
|
const filename = import_path3.default.parse(inputPath).base;
|
|
53818
|
-
|
|
53819
|
-
|
|
53819
|
+
const fileDestinationPath = import_path3.default.resolve(destinationPath, filename);
|
|
53820
|
+
let shouldCopy = true;
|
|
53821
|
+
if (skipIfPossible) {
|
|
53822
|
+
try {
|
|
53823
|
+
const destFileStats = import_node_core_library.FileSystem.getStatistics(fileDestinationPath);
|
|
53824
|
+
if (destFileStats.size !== pathStats.size) {
|
|
53825
|
+
shouldCopy = true;
|
|
53826
|
+
} else {
|
|
53827
|
+
const srcMtime = pathStats.mtimeMs ?? pathStats.mtime.getTime();
|
|
53828
|
+
const destMtime = destFileStats.mtimeMs ?? destFileStats.mtime.getTime();
|
|
53829
|
+
if (Math.abs(srcMtime - destMtime) > MTIME_TOLERANCE_MS) {
|
|
53830
|
+
shouldCopy = true;
|
|
53831
|
+
} else {
|
|
53832
|
+
shouldCopy = false;
|
|
53833
|
+
}
|
|
53834
|
+
}
|
|
53835
|
+
} catch {
|
|
53836
|
+
shouldCopy = true;
|
|
53837
|
+
}
|
|
53838
|
+
}
|
|
53839
|
+
if (!shouldCopy) {
|
|
53840
|
+
console.log(`Skipping copy for ${inputPath}; no change detected`);
|
|
53841
|
+
continue;
|
|
53842
|
+
}
|
|
53843
|
+
console.log(`Copying file ${inputPath} to ${fileDestinationPath}`);
|
|
53844
|
+
import_node_core_library.FileSystem.copyFiles({
|
|
53845
|
+
sourcePath: inputPath,
|
|
53846
|
+
destinationPath: fileDestinationPath,
|
|
53847
|
+
preserveTimestamps: true
|
|
53848
|
+
});
|
|
53849
|
+
continue;
|
|
53820
53850
|
}
|
|
53821
53851
|
import_node_core_library.FileSystem.copyFiles({
|
|
53822
53852
|
sourcePath: inputPath,
|
|
53823
|
-
destinationPath
|
|
53853
|
+
destinationPath,
|
|
53854
|
+
preserveTimestamps: true
|
|
53824
53855
|
});
|
|
53825
53856
|
}
|
|
53826
53857
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minecraft/core-build-tasks",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"description": "Common build tasks used for minecraft-scripting-libraries",
|
|
5
5
|
"exports": {
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dotenv": "^16.4.5",
|
|
38
38
|
"esbuild": "^0.25.0",
|
|
39
39
|
"eslint": "^9.17.0",
|
|
40
|
-
"just-scripts": "^2.
|
|
40
|
+
"just-scripts": "^2.4.1",
|
|
41
41
|
"prettier": "^3.5.3",
|
|
42
42
|
"rimraf": "^3.0.2",
|
|
43
43
|
"typescript": "^5.7.2",
|