sandstone-cli 2.1.1 → 2.1.2
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/README.md +3 -8
- package/lib/create.js +1 -1
- package/lib/index.js +14 -1
- package/package.json +3 -3
- package/src/commands/build.ts +16 -0
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -9,23 +9,18 @@ The CLI for Sandstone - the minecraft pack creation library.
|
|
|
9
9
|
|
|
10
10
|
<!-- toc -->
|
|
11
11
|
* [Usage](#usage)
|
|
12
|
-
* [Commands](#commands)
|
|
13
12
|
<!-- tocstop -->
|
|
14
13
|
# Usage
|
|
15
14
|
<!-- usage -->
|
|
16
15
|
```sh-session
|
|
17
|
-
$
|
|
16
|
+
$ bun i -g sandstone-cli
|
|
18
17
|
$ sand COMMAND
|
|
19
18
|
running command...
|
|
20
|
-
$ sand
|
|
21
|
-
|
|
19
|
+
$ sand -v
|
|
20
|
+
2.1.1
|
|
22
21
|
$ sand --help [COMMAND]
|
|
23
22
|
USAGE
|
|
24
23
|
$ sand COMMAND
|
|
25
24
|
...
|
|
26
25
|
```
|
|
27
26
|
<!-- usagestop -->
|
|
28
|
-
# Commands
|
|
29
|
-
<!-- commands -->
|
|
30
|
-
|
|
31
|
-
<!-- commandsstop -->
|
package/lib/create.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -22574,7 +22574,7 @@ var {
|
|
|
22574
22574
|
import figlet from "figlet";
|
|
22575
22575
|
|
|
22576
22576
|
// src/version.ts
|
|
22577
|
-
var CLI_VERSION = "2.1.
|
|
22577
|
+
var CLI_VERSION = "2.1.2";
|
|
22578
22578
|
|
|
22579
22579
|
// src/commands/build.ts
|
|
22580
22580
|
var import_fs_extra2 = __toESM(require_lib(), 1);
|
|
@@ -23598,6 +23598,19 @@ ${e.stack || e.message || e}`;
|
|
|
23598
23598
|
}
|
|
23599
23599
|
newCache.canUseSymlinks = symlinksAvailable;
|
|
23600
23600
|
await scripts?.beforeSave?.();
|
|
23601
|
+
const resourcesFolder = path3.join(folder, "resources");
|
|
23602
|
+
if (await import_fs_extra2.default.pathExists(path3.join(resourcesFolder, "resourcepack"))) {
|
|
23603
|
+
const files = await import_fs_extra2.default.readdir(path3.join(resourcesFolder, "resourcepack"));
|
|
23604
|
+
if (files.length > 0) {
|
|
23605
|
+
sandstonePack.resourcePack();
|
|
23606
|
+
}
|
|
23607
|
+
}
|
|
23608
|
+
if (await import_fs_extra2.default.pathExists(path3.join(resourcesFolder, "datapack"))) {
|
|
23609
|
+
const files = await import_fs_extra2.default.readdir(path3.join(resourcesFolder, "datapack"));
|
|
23610
|
+
if (files.length > 0) {
|
|
23611
|
+
sandstonePack.dataPack();
|
|
23612
|
+
}
|
|
23613
|
+
}
|
|
23601
23614
|
const excludeOption = resources?.exclude;
|
|
23602
23615
|
const fileExclusions = excludeOption ? {
|
|
23603
23616
|
generated: "generated" in excludeOption ? excludeOption.generated : excludeOption,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sandstone-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "The CLI for Sandstone - the minecraft pack creation library.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/index.js",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"create-sandstone": "./lib/create.js"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
|
-
"
|
|
13
|
-
"dev:build": "tsc && bun
|
|
12
|
+
"bundle": "bun scripts/version.ts && bun build src/index.ts --outfile=lib/index.js --target=bun --external=@parcel/watcher --external=figlet --external=@inquirer/prompts && bun build src/create.ts --outfile=lib/create.js --target=bun --external=@parcel/watcher --external=figlet --external=@inquirer/prompts",
|
|
13
|
+
"dev:build": "tsc && bun bundle"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
package/src/commands/build.ts
CHANGED
|
@@ -438,6 +438,22 @@ async function _buildProject(
|
|
|
438
438
|
// Run beforeSave script
|
|
439
439
|
await scripts?.beforeSave?.()
|
|
440
440
|
|
|
441
|
+
// Auto-register pack types if existing resources are present
|
|
442
|
+
// This ensures handleResources() is called even when no resources are created programmatically
|
|
443
|
+
const resourcesFolder = path.join(folder, 'resources')
|
|
444
|
+
if (await fs.pathExists(path.join(resourcesFolder, 'resourcepack'))) {
|
|
445
|
+
const files = await fs.readdir(path.join(resourcesFolder, 'resourcepack'))
|
|
446
|
+
if (files.length > 0) {
|
|
447
|
+
sandstonePack.resourcePack()
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
if (await fs.pathExists(path.join(resourcesFolder, 'datapack'))) {
|
|
451
|
+
const files = await fs.readdir(path.join(resourcesFolder, 'datapack'))
|
|
452
|
+
if (files.length > 0) {
|
|
453
|
+
sandstonePack.dataPack()
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
441
457
|
// File exclusion setup
|
|
442
458
|
const excludeOption = resources?.exclude
|
|
443
459
|
const fileExclusions = excludeOption
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = '2.1.
|
|
1
|
+
export const CLI_VERSION = '2.1.2'
|