sandstone-cli 2.0.1 → 2.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.
@@ -419,7 +419,7 @@ async function _buildProject(cliOptions, folder, silent = false, existingContext
419
419
  const outputPath = path.join(outputFolder, packType.type);
420
420
  await fs.ensureDir(outputPath);
421
421
  if (packType.handleOutput) {
422
- await packType.handleOutput('output', async (relativePath, encoding = 'utf8') => await fs.readFile(path.join(outputPath, relativePath), encoding), async (relativePath, contents) => {
422
+ await packType.handleOutput('output', (async (relativePath, encoding = 'utf8') => await fs.readFile(path.join(outputPath, relativePath), encoding)), async (relativePath, contents) => {
423
423
  if (contents === undefined) {
424
424
  await fs.unlink(path.join(outputPath, relativePath));
425
425
  }
@@ -488,7 +488,7 @@ async function _buildProject(cliOptions, folder, silent = false, existingContext
488
488
  for await (const [, packType] of packTypes) {
489
489
  const outputPath = path.join(outputFolder, packType.type);
490
490
  if (packType.handleOutput) {
491
- await packType.handleOutput('output', async (relativePath, encoding = 'utf8') => await fs.readFile(path.join(outputPath, relativePath), encoding), async (relativePath, contents) => {
491
+ await packType.handleOutput('output', (async (relativePath, encoding = 'utf8') => await fs.readFile(path.join(outputPath, relativePath), encoding)), async (relativePath, contents) => {
492
492
  if (contents === undefined) {
493
493
  await fs.unlink(path.join(outputPath, relativePath));
494
494
  }
@@ -118,7 +118,7 @@ export async function createCommand(_project, opts) {
118
118
  const yarn = hasYarn();
119
119
  const pnpm = hasPnpm();
120
120
  const bun = hasBun();
121
- if (yarn || pnpm) {
121
+ if (yarn || pnpm || bun) {
122
122
  const choices = ['npm'];
123
123
  if (yarn)
124
124
  choices.unshift('yarn');
package/lib/create.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env bun
2
2
  export {};
package/lib/create.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env bun
2
2
  import { Argument, Command } from 'commander';
3
3
  import figlet from 'figlet';
4
4
  import { createCommand } from './commands/index.js';
package/lib/index.d.ts CHANGED
@@ -1 +1,2 @@
1
+ #!/usr/bin/env bun
1
2
  export {};
package/lib/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env bun
1
2
  import { Argument, Command } from 'commander';
2
3
  import figlet from 'figlet';
3
4
  import { buildCommand, createCommand, watchCommand, installNativeCommand, installVanillaCommand, uninstallVanillaCommand, refreshCommand } from './commands/index.js';
@@ -5,7 +6,7 @@ import { BuildDeclares } from './shared.js';
5
6
  const commander = new Command();
6
7
  console.log(figlet.textSync('Sandstone'));
7
8
  const CLI = commander
8
- .version('2.0.1')
9
+ .version('2.0.2', '-v, --version')
9
10
  .description('The CLI for Sandstone - the minecraft pack creation library.');
10
11
  const build = CLI
11
12
  .command('build')
package/lib/shared.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export const BuildDeclares = {
2
2
  // Flags
3
3
  dry: ['-d, --dry', 'Do not save the pack. Mostly useful with `verbose`.'],
4
- verbose: ['-v, --verbose', 'Log all resulting resources: functions, advancements...'],
4
+ verbose: ['-f, --verbose', 'Fully log all resulting resources: functions, advancements...'],
5
5
  root: ['-r, --root', 'Save the pack & resource pack in the .minecraft/datapacks & .minecraft/resource_packs folders. Override the value specified in the configuration file.'],
6
6
  fullTrace: ['-t, --full-trace', 'Show the full stack trace on errors.'],
7
7
  strictErrors: ['-s, --strict-errors', 'Stop pack compilation on type errors.'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sandstone-cli",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "The CLI for Sandstone - the minecraft pack creation library.",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -12,6 +12,7 @@ import { canUseSymlinks } from '../utils.js'
12
12
  import { split } from 'obliterator'
13
13
 
14
14
  import type * as sandstone from 'sandstone'
15
+ import type { handlerReadFile } from 'sandstone/pack'
15
16
 
16
17
  type SandstoneContext = ReturnType<typeof sandstone['getSandstoneContext']>
17
18
 
@@ -565,8 +566,8 @@ async function _buildProject(
565
566
  if (packType.handleOutput) {
566
567
  await packType.handleOutput(
567
568
  'output',
568
- async (relativePath: string, encoding: BufferEncoding = 'utf8') =>
569
- await fs.readFile(path.join(outputPath, relativePath), encoding),
569
+ (async (relativePath: string, encoding: BufferEncoding = 'utf8') =>
570
+ await fs.readFile(path.join(outputPath, relativePath), encoding)) as unknown as handlerReadFile,
570
571
  async (relativePath: string, contents: any) => {
571
572
  if (contents === undefined) {
572
573
  await fs.unlink(path.join(outputPath, relativePath))
@@ -655,8 +656,8 @@ async function _buildProject(
655
656
  if (packType.handleOutput) {
656
657
  await packType.handleOutput(
657
658
  'output',
658
- async (relativePath: string, encoding: BufferEncoding = 'utf8') =>
659
- await fs.readFile(path.join(outputPath, relativePath), encoding),
659
+ (async (relativePath: string, encoding: BufferEncoding = 'utf8') =>
660
+ await fs.readFile(path.join(outputPath, relativePath), encoding)) as unknown as handlerReadFile,
660
661
  async (relativePath: string, contents: any) => {
661
662
  if (contents === undefined) {
662
663
  await fs.unlink(path.join(outputPath, relativePath))
@@ -152,7 +152,7 @@ export async function createCommand(_project: string, opts: CreateOptions) {
152
152
  const pnpm = hasPnpm()
153
153
  const bun = hasBun()
154
154
 
155
- if (yarn || pnpm) {
155
+ if (yarn || pnpm || bun) {
156
156
  const choices = ['npm']
157
157
 
158
158
  if (yarn) choices.unshift('yarn')
package/src/create.ts CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env bun
2
2
  import { Argument, Command } from 'commander'
3
3
  import figlet from 'figlet'
4
4
  import { createCommand } from './commands/index.js'
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env bun
1
2
  import { Argument, Command } from 'commander'
2
3
  import figlet from 'figlet'
3
4
  import { buildCommand, createCommand, watchCommand, installNativeCommand, installVanillaCommand, uninstallVanillaCommand, refreshCommand } from './commands/index.js'
@@ -8,7 +9,7 @@ const commander = new Command()
8
9
  console.log(figlet.textSync('Sandstone'));
9
10
 
10
11
  const CLI = commander
11
- .version('2.0.1')
12
+ .version('2.0.2', '-v, --version')
12
13
  .description('The CLI for Sandstone - the minecraft pack creation library.')
13
14
 
14
15
  const build = CLI
package/src/shared.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export const BuildDeclares = {
2
2
  // Flags
3
3
  dry: ['-d, --dry', 'Do not save the pack. Mostly useful with `verbose`.'],
4
- verbose: ['-v, --verbose', 'Log all resulting resources: functions, advancements...'],
4
+ verbose: ['-f, --verbose', 'Fully log all resulting resources: functions, advancements...'],
5
5
  root: ['-r, --root', 'Save the pack & resource pack in the .minecraft/datapacks & .minecraft/resource_packs folders. Override the value specified in the configuration file.'],
6
6
  fullTrace: ['-t, --full-trace', 'Show the full stack trace on errors.'],
7
7
  strictErrors: ['-s, --strict-errors', 'Stop pack compilation on type errors.'],