sandstone-cli 2.0.2 → 2.0.4

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/bun.lock CHANGED
@@ -29,7 +29,7 @@
29
29
  "@types/fs-extra": "^11.0.2",
30
30
  "@types/react": "^19.2.10",
31
31
  "@types/semver": "^7.5.3",
32
- "sandstone": "1.0.0-beta.1",
32
+ "sandstone": "^1.0.0-beta.1",
33
33
  "typescript": "^5.2.2",
34
34
  },
35
35
  },
@@ -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
  }
@@ -24,7 +24,7 @@ export async function createCommand(_project, opts) {
24
24
  default: false,
25
25
  })) === true ? 'library' : 'pack';
26
26
  const sv = (v) => new SemVer(v);
27
- const versions = [[sv('1.0.0-beta.1'), sv('2.0.0')]];
27
+ const versions = [[sv('1.0.0-beta.1'), sv('2.0.4')]];
28
28
  const version = await select({
29
29
  message: 'Which version of Sandstone do you want to use? These are the only supported versions for new projects.',
30
30
  choices: versions.map((v) => {
@@ -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/index.js CHANGED
@@ -6,7 +6,7 @@ import { BuildDeclares } from './shared.js';
6
6
  const commander = new Command();
7
7
  console.log(figlet.textSync('Sandstone'));
8
8
  const CLI = commander
9
- .version('2.0.2', '-v, --version')
9
+ .version('2.0.4', '-v, --version')
10
10
  .description('The CLI for Sandstone - the minecraft pack creation library.');
11
11
  const build = CLI
12
12
  .command('build')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sandstone-cli",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
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))
@@ -42,7 +42,7 @@ export async function createCommand(_project: string, opts: CreateOptions) {
42
42
 
43
43
  const sv = (v: string) => new SemVer(v)
44
44
 
45
- const versions = [[sv('1.0.0-beta.1'), sv('2.0.0')]] as const
45
+ const versions = [[sv('1.0.0-beta.1'), sv('2.0.4')]] as const
46
46
 
47
47
  const version = await select({
48
48
  message: 'Which version of Sandstone do you want to use? These are the only supported versions for new projects.',
@@ -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/index.ts CHANGED
@@ -9,7 +9,7 @@ const commander = new Command()
9
9
  console.log(figlet.textSync('Sandstone'));
10
10
 
11
11
  const CLI = commander
12
- .version('2.0.2', '-v, --version')
12
+ .version('2.0.4', '-v, --version')
13
13
  .description('The CLI for Sandstone - the minecraft pack creation library.')
14
14
 
15
15
  const build = CLI