sandstone-cli 1.0.1 → 1.0.3
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/lib/build/index.js +3 -2
- package/package.json +8 -8
- package/src/build/index.ts +3 -2
package/lib/build/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import * as os from 'os';
|
|
3
3
|
import crypto from 'crypto';
|
|
4
|
+
import { pathToFileURL } from 'url';
|
|
4
5
|
import fs from 'fs-extra';
|
|
5
6
|
import PrettyError from 'pretty-error';
|
|
6
7
|
import walk from 'klaw';
|
|
@@ -85,7 +86,7 @@ async function getClientPath() {
|
|
|
85
86
|
async function _buildProject(cliOptions, { absProjectFolder, rootFolder, sandstoneConfigFolder }) {
|
|
86
87
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
87
88
|
// First, read sandstone.config.ts to get all properties
|
|
88
|
-
const sandstoneConfig = (await import(path.join(sandstoneConfigFolder, 'sandstone.config.ts'))).default;
|
|
89
|
+
const sandstoneConfig = (await import(pathToFileURL(path.join(sandstoneConfigFolder, 'sandstone.config.ts')).toString())).default;
|
|
89
90
|
const { scripts } = sandstoneConfig;
|
|
90
91
|
let { saveOptions } = sandstoneConfig;
|
|
91
92
|
if (saveOptions === undefined)
|
|
@@ -171,7 +172,7 @@ async function _buildProject(cliOptions, { absProjectFolder, rootFolder, sandsto
|
|
|
171
172
|
try {
|
|
172
173
|
// Sometimes, a file might not exist because it has been deleted.
|
|
173
174
|
if (await fs.pathExists(filePath)) {
|
|
174
|
-
sandstonePack = (await import(filePath)).default;
|
|
175
|
+
sandstonePack = (await import(pathToFileURL(filePath).toString())).default;
|
|
175
176
|
}
|
|
176
177
|
}
|
|
177
178
|
catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sandstone-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "The CLI for Sandstone - the minecraft pack creation library.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"delete-empty": "^3.0.0",
|
|
51
51
|
"figlet": "^1.6.0",
|
|
52
52
|
"fs-extra": "^11.1.1",
|
|
53
|
-
"inquirer": "^9.2.
|
|
53
|
+
"inquirer": "^9.2.11",
|
|
54
54
|
"klaw": "^4.1.0",
|
|
55
55
|
"nanoid": "^4.0.2",
|
|
56
56
|
"pretty-error": "^4.0.0",
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
"ts-node": "^10.9.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@types/adm-zip": "^0.5.
|
|
61
|
+
"@types/adm-zip": "^0.5.2",
|
|
62
62
|
"@types/delete-empty": "^3.0.2",
|
|
63
63
|
"@types/figlet": "^1.5.6",
|
|
64
|
-
"@types/fs-extra": "^11.0.
|
|
65
|
-
"@types/inquirer": "^9.0.
|
|
66
|
-
"@types/klaw": "^3.0.
|
|
67
|
-
"@types/semver": "^7.5.
|
|
68
|
-
"typescript": "^5.
|
|
64
|
+
"@types/fs-extra": "^11.0.2",
|
|
65
|
+
"@types/inquirer": "^9.0.4",
|
|
66
|
+
"@types/klaw": "^3.0.4",
|
|
67
|
+
"@types/semver": "^7.5.3",
|
|
68
|
+
"typescript": "^5.2.2"
|
|
69
69
|
}
|
|
70
70
|
}
|
package/src/build/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from 'path'
|
|
2
2
|
import * as os from 'os'
|
|
3
3
|
import crypto from 'crypto'
|
|
4
|
+
import { pathToFileURL } from 'url'
|
|
4
5
|
import fs from 'fs-extra'
|
|
5
6
|
import PrettyError from 'pretty-error'
|
|
6
7
|
import walk from 'klaw'
|
|
@@ -134,7 +135,7 @@ async function getClientPath() {
|
|
|
134
135
|
async function _buildProject(cliOptions: BuildOptions, { absProjectFolder, rootFolder, sandstoneConfigFolder }: ProjectFolders) {
|
|
135
136
|
|
|
136
137
|
// First, read sandstone.config.ts to get all properties
|
|
137
|
-
const sandstoneConfig = (await import(path.join(sandstoneConfigFolder, 'sandstone.config.ts'))).default
|
|
138
|
+
const sandstoneConfig = (await import(pathToFileURL(path.join(sandstoneConfigFolder, 'sandstone.config.ts')).toString())).default
|
|
138
139
|
|
|
139
140
|
const { scripts } = sandstoneConfig
|
|
140
141
|
|
|
@@ -241,7 +242,7 @@ async function _buildProject(cliOptions: BuildOptions, { absProjectFolder, rootF
|
|
|
241
242
|
try {
|
|
242
243
|
// Sometimes, a file might not exist because it has been deleted.
|
|
243
244
|
if (await fs.pathExists(filePath)) {
|
|
244
|
-
sandstonePack = (await import(filePath)).default
|
|
245
|
+
sandstonePack = (await import(pathToFileURL(filePath).toString())).default
|
|
245
246
|
}
|
|
246
247
|
}
|
|
247
248
|
catch (e: any) {
|