sandstone-cli 2.0.2 → 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.
- package/bun.lock +1 -1
- package/lib/commands/build.js +2 -2
- package/lib/commands/create.js +1 -1
- package/package.json +1 -1
- package/src/commands/build.ts +5 -4
- package/src/commands/create.ts +1 -1
package/bun.lock
CHANGED
package/lib/commands/build.js
CHANGED
|
@@ -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
|
}
|
package/lib/commands/create.js
CHANGED
|
@@ -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/package.json
CHANGED
package/src/commands/build.ts
CHANGED
|
@@ -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))
|
package/src/commands/create.ts
CHANGED
|
@@ -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')
|