sandstone-cli 2.1.1 → 2.1.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/README.md +3 -8
- package/lib/create.js +2 -2
- package/lib/index.js +15 -2
- package/package.json +3 -3
- package/src/commands/build.ts +16 -0
- package/src/commands/create.ts +1 -1
- 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
|
@@ -5680,7 +5680,7 @@ var {
|
|
|
5680
5680
|
import figlet from "figlet";
|
|
5681
5681
|
|
|
5682
5682
|
// src/version.ts
|
|
5683
|
-
var CLI_VERSION = "2.1.
|
|
5683
|
+
var CLI_VERSION = "2.1.3";
|
|
5684
5684
|
|
|
5685
5685
|
// src/commands/create.ts
|
|
5686
5686
|
var import_semver = __toESM(require_semver2(), 1);
|
|
@@ -6533,7 +6533,7 @@ async function createCommand2(_project, opts) {
|
|
|
6533
6533
|
const exec = (cmd) => child.execSync(cmd, { cwd: projectPath });
|
|
6534
6534
|
exec("git clone https://github.com/sandstone-mc/sandstone-template.git .");
|
|
6535
6535
|
exec(`git checkout ${projectType}-${version[0]}`);
|
|
6536
|
-
await import_fs_extra.default.rm(".git", { force: true, recursive: true });
|
|
6536
|
+
await import_fs_extra.default.rm(path2.join(projectPath, ".git"), { force: true, recursive: true });
|
|
6537
6537
|
exec(`${packageManager} install`);
|
|
6538
6538
|
const configPath = path2.join(projectPath, `${projectType === "library" ? "test/" : ""}sandstone.config.ts`);
|
|
6539
6539
|
let templateConfig = await import_fs_extra.default.readFile(configPath, "utf8");
|
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.3";
|
|
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,
|
|
@@ -24193,7 +24206,7 @@ async function createCommand2(_project, opts) {
|
|
|
24193
24206
|
const exec = (cmd) => child.execSync(cmd, { cwd: projectPath });
|
|
24194
24207
|
exec("git clone https://github.com/sandstone-mc/sandstone-template.git .");
|
|
24195
24208
|
exec(`git checkout ${projectType}-${version[0]}`);
|
|
24196
|
-
await import_fs_extra3.default.rm(".git", { force: true, recursive: true });
|
|
24209
|
+
await import_fs_extra3.default.rm(path4.join(projectPath, ".git"), { force: true, recursive: true });
|
|
24197
24210
|
exec(`${packageManager} install`);
|
|
24198
24211
|
const configPath = path4.join(projectPath, `${projectType === "library" ? "test/" : ""}sandstone.config.ts`);
|
|
24199
24212
|
let templateConfig = await import_fs_extra3.default.readFile(configPath, "utf8");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sandstone-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
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/commands/create.ts
CHANGED
|
@@ -177,7 +177,7 @@ export async function createCommand(_project: string, opts: CreateOptions) {
|
|
|
177
177
|
|
|
178
178
|
exec(`git checkout ${projectType}-${version[0]}`)
|
|
179
179
|
|
|
180
|
-
await fs.rm('.git', { force: true, recursive: true })
|
|
180
|
+
await fs.rm(path.join(projectPath, '.git'), { force: true, recursive: true })
|
|
181
181
|
|
|
182
182
|
exec(`${packageManager} install`)
|
|
183
183
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = '2.1.
|
|
1
|
+
export const CLI_VERSION = '2.1.3'
|