@fugood/bricks-ctor 2.25.0-beta.60 → 2.25.0-beta.61
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/package.json +4 -28
- package/tools/deploy.ts +19 -176
- package/tools/mcp-server.ts +16 -33
- package/tools/postinstall.ts +21 -292
- package/tools/pull.ts +15 -195
- package/tools/push-config.ts +18 -113
- package/tools/simulator.ts +19 -148
- package/compile/__tests__/config-diff.test.js +0 -100
- package/compile/__tests__/index.test.js +0 -461
- package/compile/__tests__/util.test.js +0 -450
- package/compile/action-name-map.ts +0 -1079
- package/compile/config-diff.ts +0 -155
- package/compile/index.ts +0 -1594
- package/compile/util.ts +0 -482
- package/index.ts +0 -6
- package/skills/bricks-ctor/SKILL.md +0 -38
- package/skills/bricks-ctor/references/animation.md +0 -160
- package/skills/bricks-ctor/references/architecture-patterns.md +0 -88
- package/skills/bricks-ctor/references/automations.md +0 -232
- package/skills/bricks-ctor/references/buttress.md +0 -245
- package/skills/bricks-ctor/references/data-calculation.md +0 -252
- package/skills/bricks-ctor/references/local-sync.md +0 -129
- package/skills/bricks-ctor/references/media-flow.md +0 -165
- package/skills/bricks-ctor/references/remote-data-bank.md +0 -196
- package/skills/bricks-ctor/references/simulator.md +0 -132
- package/skills/bricks-ctor/references/source-editing-tools.md +0 -81
- package/skills/bricks-ctor/references/standby-transition.md +0 -124
- package/skills/bricks-ctor/references/verification-toolchain.md +0 -200
- package/skills/bricks-design/SKILL.md +0 -171
- package/skills/bricks-design/references/architecture-truths.md +0 -132
- package/skills/bricks-design/references/avoiding-complexity.md +0 -91
- package/skills/bricks-design/references/design-critique.md +0 -195
- package/skills/bricks-design/references/design-languages.md +0 -265
- package/skills/bricks-design/references/performance.md +0 -116
- package/skills/bricks-design/references/presentation-and-slideshow.md +0 -137
- package/skills/bricks-design/references/translating-inputs.md +0 -152
- package/skills/bricks-design/references/variations-and-tweaks.md +0 -124
- package/skills/bricks-design/references/when-the-brief-is-branded.md +0 -284
- package/skills/bricks-design/references/when-the-brief-is-vague.md +0 -85
- package/skills/bricks-design/references/workflow.md +0 -134
- package/skills/bricks-ux/SKILL.md +0 -114
- package/skills/bricks-ux/references/accessibility.md +0 -162
- package/skills/bricks-ux/references/flow-states.md +0 -175
- package/skills/bricks-ux/references/interaction-archetypes.md +0 -189
- package/skills/bricks-ux/references/monitoring-screens.md +0 -153
- package/skills/bricks-ux/references/pressable-composition.md +0 -126
- package/skills/bricks-ux/references/user-journey.md +0 -168
- package/skills/bricks-ux/references/ux-critique.md +0 -256
- package/skills/rive-marketplace/SKILL.md +0 -99
- package/tools/__tests__/_cli-error.test.ts +0 -35
- package/tools/__tests__/_mcp-config.test.ts +0 -67
- package/tools/__tests__/pull.test.ts +0 -108
- package/tools/_cli-error.ts +0 -17
- package/tools/_edits-log.ts +0 -41
- package/tools/_git-author.ts +0 -37
- package/tools/_last-pushed-commit.ts +0 -28
- package/tools/_mcp-config.ts +0 -42
- package/tools/_shell.ts +0 -180
- package/tools/icons/.gitattributes +0 -1
- package/tools/icons/fa6pro-glyphmap.json +0 -4686
- package/tools/icons/fa6pro-meta.json +0 -1
- package/tools/mcp-env.ts +0 -13
- package/tools/mcp-tools/__tests__/data-calc-editing.test.js +0 -516
- package/tools/mcp-tools/__tests__/entry-editing.test.js +0 -866
- package/tools/mcp-tools/__tests__/huggingface.test.ts +0 -49
- package/tools/mcp-tools/__tests__/icons.test.ts +0 -21
- package/tools/mcp-tools/__tests__/mcp-env.test.js +0 -19
- package/tools/mcp-tools/_editing-helpers.ts +0 -98
- package/tools/mcp-tools/_verify.ts +0 -50
- package/tools/mcp-tools/compile.ts +0 -104
- package/tools/mcp-tools/data-calc-editing.ts +0 -1311
- package/tools/mcp-tools/entry-editing.ts +0 -2297
- package/tools/mcp-tools/huggingface.ts +0 -772
- package/tools/mcp-tools/icons.ts +0 -97
- package/tools/mcp-tools/lottie.ts +0 -102
- package/tools/mcp-tools/media.ts +0 -113
- package/tools/simulator-main.mjs +0 -488
- package/tools/simulator-preload.cjs +0 -16
- package/types/animation.d.ts +0 -116
- package/types/automation.d.ts +0 -231
- package/types/brick-base.d.ts +0 -80
- package/types/bricks/Camera.d.ts +0 -246
- package/types/bricks/Chart.d.ts +0 -372
- package/types/bricks/GenerativeMedia.d.ts +0 -290
- package/types/bricks/Icon.d.ts +0 -98
- package/types/bricks/Image.d.ts +0 -126
- package/types/bricks/Items.d.ts +0 -480
- package/types/bricks/Lottie.d.ts +0 -168
- package/types/bricks/Maps.d.ts +0 -262
- package/types/bricks/QrCode.d.ts +0 -117
- package/types/bricks/Rect.d.ts +0 -150
- package/types/bricks/RichText.d.ts +0 -131
- package/types/bricks/Rive.d.ts +0 -220
- package/types/bricks/Scene3D.d.ts +0 -676
- package/types/bricks/Sketch.d.ts +0 -256
- package/types/bricks/Slideshow.d.ts +0 -201
- package/types/bricks/Svg.d.ts +0 -99
- package/types/bricks/Text.d.ts +0 -148
- package/types/bricks/TextInput.d.ts +0 -242
- package/types/bricks/Video.d.ts +0 -242
- package/types/bricks/VideoStreaming.d.ts +0 -112
- package/types/bricks/WebRtcStream.d.ts +0 -65
- package/types/bricks/WebView.d.ts +0 -168
- package/types/bricks/index.d.ts +0 -23
- package/types/canvas.d.ts +0 -82
- package/types/common.d.ts +0 -141
- package/types/data-calc-command/base.d.ts +0 -57
- package/types/data-calc-command/collection.d.ts +0 -418
- package/types/data-calc-command/color.d.ts +0 -432
- package/types/data-calc-command/constant.d.ts +0 -50
- package/types/data-calc-command/datetime.d.ts +0 -147
- package/types/data-calc-command/file.d.ts +0 -129
- package/types/data-calc-command/index.d.ts +0 -13
- package/types/data-calc-command/iteratee.d.ts +0 -23
- package/types/data-calc-command/logictype.d.ts +0 -190
- package/types/data-calc-command/math.d.ts +0 -275
- package/types/data-calc-command/object.d.ts +0 -119
- package/types/data-calc-command/sandbox.d.ts +0 -66
- package/types/data-calc-command/string.d.ts +0 -407
- package/types/data-calc-script.d.ts +0 -21
- package/types/data-calc.d.ts +0 -12
- package/types/data.d.ts +0 -97
- package/types/generators/AlarmClock.d.ts +0 -110
- package/types/generators/Assistant.d.ts +0 -640
- package/types/generators/BleCentral.d.ts +0 -247
- package/types/generators/BlePeripheral.d.ts +0 -208
- package/types/generators/CanvasMap.d.ts +0 -74
- package/types/generators/CastlesPay.d.ts +0 -87
- package/types/generators/DataBank.d.ts +0 -160
- package/types/generators/File.d.ts +0 -432
- package/types/generators/GraphQl.d.ts +0 -132
- package/types/generators/Http.d.ts +0 -222
- package/types/generators/HttpServer.d.ts +0 -230
- package/types/generators/Information.d.ts +0 -103
- package/types/generators/Intent.d.ts +0 -168
- package/types/generators/Iterator.d.ts +0 -108
- package/types/generators/Keyboard.d.ts +0 -105
- package/types/generators/LlmAnthropicCompat.d.ts +0 -212
- package/types/generators/LlmAppleBuiltin.d.ts +0 -159
- package/types/generators/LlmGgml.d.ts +0 -903
- package/types/generators/LlmMediaTekNeuroPilot.d.ts +0 -235
- package/types/generators/LlmMlx.d.ts +0 -228
- package/types/generators/LlmOnnx.d.ts +0 -213
- package/types/generators/LlmOpenAiCompat.d.ts +0 -312
- package/types/generators/LlmQualcommAiEngine.d.ts +0 -247
- package/types/generators/Mcp.d.ts +0 -637
- package/types/generators/McpServer.d.ts +0 -289
- package/types/generators/MediaFlow.d.ts +0 -170
- package/types/generators/MqttBroker.d.ts +0 -141
- package/types/generators/MqttClient.d.ts +0 -141
- package/types/generators/Question.d.ts +0 -408
- package/types/generators/RealtimeTranscription.d.ts +0 -287
- package/types/generators/RerankerGgml.d.ts +0 -195
- package/types/generators/SerialPort.d.ts +0 -151
- package/types/generators/SoundPlayer.d.ts +0 -94
- package/types/generators/SoundRecorder.d.ts +0 -139
- package/types/generators/SpeechToTextGgml.d.ts +0 -424
- package/types/generators/SpeechToTextOnnx.d.ts +0 -236
- package/types/generators/SpeechToTextPlatform.d.ts +0 -85
- package/types/generators/SqLite.d.ts +0 -159
- package/types/generators/Step.d.ts +0 -107
- package/types/generators/SttAppleBuiltin.d.ts +0 -153
- package/types/generators/Tcp.d.ts +0 -126
- package/types/generators/TcpServer.d.ts +0 -147
- package/types/generators/TextToSpeechAppleBuiltin.d.ts +0 -127
- package/types/generators/TextToSpeechGgml.d.ts +0 -221
- package/types/generators/TextToSpeechOnnx.d.ts +0 -178
- package/types/generators/TextToSpeechOpenAiLike.d.ts +0 -121
- package/types/generators/ThermalPrinter.d.ts +0 -193
- package/types/generators/Tick.d.ts +0 -83
- package/types/generators/Udp.d.ts +0 -120
- package/types/generators/VadGgml.d.ts +0 -260
- package/types/generators/VadOnnx.d.ts +0 -231
- package/types/generators/VadTraditional.d.ts +0 -138
- package/types/generators/VectorStore.d.ts +0 -257
- package/types/generators/Watchdog.d.ts +0 -107
- package/types/generators/WebCrawler.d.ts +0 -103
- package/types/generators/WebRtc.d.ts +0 -181
- package/types/generators/WebSocket.d.ts +0 -148
- package/types/generators/index.d.ts +0 -57
- package/types/index.d.ts +0 -13
- package/types/subspace.d.ts +0 -60
- package/types/switch.d.ts +0 -51
- package/types/system.d.ts +0 -707
- package/utils/__tests__/calc.test.js +0 -25
- package/utils/__tests__/id.test.js +0 -154
- package/utils/calc.ts +0 -130
- package/utils/data.ts +0 -495
- package/utils/event-props.ts +0 -912
- package/utils/id.ts +0 -133
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { mkdir, readFile, writeFile } from 'node:fs/promises'
|
|
2
|
-
|
|
3
|
-
// Local sync marker: the git commit hash that was on HEAD when we last
|
|
4
|
-
// successfully pushed to the server (deploy or push-config) or pulled
|
|
5
|
-
// from it. Stored at the `.bricks/` top level (gitignored explicitly) — it's
|
|
6
|
-
// per-clone state, not a build artifact, so it doesn't belong under
|
|
7
|
-
// `.bricks/build/`.
|
|
8
|
-
//
|
|
9
|
-
// Why this exists: server's `bricks_project_last_commit_id` can be an opaque
|
|
10
|
-
// nanoid for content-only edits (config-editor saves), so it isn't a
|
|
11
|
-
// reliable git anchor for `git checkout` during pull. The local marker is
|
|
12
|
-
// always a real reachable commit hash from THIS clone.
|
|
13
|
-
const REL_PATH = '.bricks/.last-pushed-commit'
|
|
14
|
-
|
|
15
|
-
export async function readLastPushedCommit(cwd: string): Promise<string | null> {
|
|
16
|
-
try {
|
|
17
|
-
const content = await readFile(`${cwd}/${REL_PATH}`, 'utf8')
|
|
18
|
-
return content.trim() || null
|
|
19
|
-
} catch {
|
|
20
|
-
return null
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export async function writeLastPushedCommit(cwd: string, commitId: string): Promise<void> {
|
|
25
|
-
if (!commitId) return
|
|
26
|
-
await mkdir(`${cwd}/.bricks`, { recursive: true })
|
|
27
|
-
await writeFile(`${cwd}/${REL_PATH}`, commitId)
|
|
28
|
-
}
|
package/tools/_mcp-config.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { readFile, writeFile, stat } from 'fs/promises'
|
|
2
|
-
|
|
3
|
-
const exists = async (f: string) => {
|
|
4
|
-
try {
|
|
5
|
-
await stat(f)
|
|
6
|
-
return true
|
|
7
|
-
} catch {
|
|
8
|
-
return false
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// Refresh the `bricks-ctor` entry in a project's `.mcp.json` while preserving every other MCP
|
|
13
|
-
// server the user configured. A malformed `.mcp.json` is left untouched (with a warning)
|
|
14
|
-
// rather than overwritten with the default — clobbering it would silently delete the user's
|
|
15
|
-
// other server entries. This mirrors `setupClaudeAutoMode`'s handling of a malformed
|
|
16
|
-
// `settings.local.json` in postinstall.ts.
|
|
17
|
-
export const handleMcpConfigOverride = async (mcpConfigPath: string, projectMcpServer: object) => {
|
|
18
|
-
let mcpConfig: { mcpServers: Record<string, unknown> }
|
|
19
|
-
if (await exists(mcpConfigPath)) {
|
|
20
|
-
let parsed: unknown
|
|
21
|
-
try {
|
|
22
|
-
parsed = JSON.parse(await readFile(mcpConfigPath, 'utf-8'))
|
|
23
|
-
} catch {
|
|
24
|
-
console.warn(`Skipping .mcp.json update; ${mcpConfigPath} is not valid JSON`)
|
|
25
|
-
return
|
|
26
|
-
}
|
|
27
|
-
mcpConfig =
|
|
28
|
-
parsed && typeof parsed === 'object'
|
|
29
|
-
? (parsed as { mcpServers: Record<string, unknown> })
|
|
30
|
-
: { mcpServers: {} }
|
|
31
|
-
if (!mcpConfig.mcpServers || typeof mcpConfig.mcpServers !== 'object') {
|
|
32
|
-
mcpConfig.mcpServers = {}
|
|
33
|
-
}
|
|
34
|
-
mcpConfig.mcpServers['bricks-ctor'] = projectMcpServer
|
|
35
|
-
delete mcpConfig.mcpServers['bricks-project']
|
|
36
|
-
} else {
|
|
37
|
-
mcpConfig = { mcpServers: { 'bricks-ctor': projectMcpServer } }
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
await writeFile(mcpConfigPath, `${JSON.stringify(mcpConfig, null, 2)}\n`)
|
|
41
|
-
console.log(`Updated ${mcpConfigPath}`)
|
|
42
|
-
}
|
package/tools/_shell.ts
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { spawn, type StdioOptions } from 'node:child_process'
|
|
2
|
-
|
|
3
|
-
// Template-literal shell helper replacing `$` from 'bun'. Only covers the
|
|
4
|
-
// ergonomics actually used in this package (see call sites in tools/*.ts).
|
|
5
|
-
//
|
|
6
|
-
// Usage:
|
|
7
|
-
// await sh`git status` // inherit stdio, throw on nonzero
|
|
8
|
-
// await sh`cd ${cwd} && git status`.quiet().nothrow()
|
|
9
|
-
// const out = await sh`git rev-parse HEAD`.text()
|
|
10
|
-
// await sh`bunx bricks ${args}`.cwd(dir).text()
|
|
11
|
-
//
|
|
12
|
-
// Notes:
|
|
13
|
-
// - Interpolated values are treated as single argv tokens (arrays expand to
|
|
14
|
-
// multiple tokens). Whitespace inside interpolated strings is preserved.
|
|
15
|
-
// - A leading `cd <path> && <cmd...>` in the literal is lifted into the
|
|
16
|
-
// subprocess cwd — no shell is spawned, so no quoting concerns.
|
|
17
|
-
// - Commands that chain with `&&` beyond the `cd` prefix aren't supported;
|
|
18
|
-
// split them into multiple `sh` awaits at the call site.
|
|
19
|
-
|
|
20
|
-
export interface ShResult {
|
|
21
|
-
exitCode: number
|
|
22
|
-
stdout: Buffer
|
|
23
|
-
stderr: Buffer
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
type Mode = 'default' | 'text' | 'quiet'
|
|
27
|
-
|
|
28
|
-
class Sh implements PromiseLike<ShResult> {
|
|
29
|
-
private _cwd: string | undefined
|
|
30
|
-
private _mode: Mode = 'default'
|
|
31
|
-
private _throw = true
|
|
32
|
-
private _env: NodeJS.ProcessEnv | undefined
|
|
33
|
-
private _promise: Promise<ShResult> | null = null
|
|
34
|
-
|
|
35
|
-
constructor(private readonly args: string[]) {}
|
|
36
|
-
|
|
37
|
-
cwd(dir: string): this {
|
|
38
|
-
this._cwd = dir
|
|
39
|
-
return this
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
quiet(): this {
|
|
43
|
-
this._mode = 'quiet'
|
|
44
|
-
return this
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
nothrow(): this {
|
|
48
|
-
this._throw = false
|
|
49
|
-
return this
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
env(extra: NodeJS.ProcessEnv): this {
|
|
53
|
-
this._env = { ...this._env, ...extra }
|
|
54
|
-
return this
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
async text(): Promise<string> {
|
|
58
|
-
// If no explicit quiet was requested, capture stdout/stderr without
|
|
59
|
-
// forwarding them to the parent's streams (matches Bun's `.text()`).
|
|
60
|
-
if (this._mode === 'default') this._mode = 'text'
|
|
61
|
-
const r = await this.run()
|
|
62
|
-
return r.stdout.toString('utf8')
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
then<TResult1 = ShResult, TResult2 = never>(
|
|
66
|
-
onfulfilled?: ((value: ShResult) => TResult1 | PromiseLike<TResult1>) | null,
|
|
67
|
-
onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null,
|
|
68
|
-
): Promise<TResult1 | TResult2> {
|
|
69
|
-
return this.run().then(onfulfilled, onrejected)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
private run(): Promise<ShResult> {
|
|
73
|
-
if (!this._promise) this._promise = this.exec()
|
|
74
|
-
return this._promise
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
private async exec(): Promise<ShResult> {
|
|
78
|
-
const [cmd, ...rest] = this.args
|
|
79
|
-
if (!cmd) throw new Error('sh: empty command')
|
|
80
|
-
|
|
81
|
-
const stdio: StdioOptions =
|
|
82
|
-
this._mode === 'default'
|
|
83
|
-
? ['inherit', 'pipe', 'pipe']
|
|
84
|
-
: this._mode === 'quiet'
|
|
85
|
-
? ['ignore', 'pipe', 'pipe']
|
|
86
|
-
: ['inherit', 'pipe', 'pipe']
|
|
87
|
-
|
|
88
|
-
const env = this._env ? { ...process.env, ...this._env } : undefined
|
|
89
|
-
const proc = spawn(cmd, rest, { cwd: this._cwd, stdio, env })
|
|
90
|
-
|
|
91
|
-
const outChunks: Buffer[] = []
|
|
92
|
-
const errChunks: Buffer[] = []
|
|
93
|
-
proc.stdout?.on('data', (c: Buffer) => {
|
|
94
|
-
outChunks.push(c)
|
|
95
|
-
if (this._mode === 'default') process.stdout.write(c)
|
|
96
|
-
})
|
|
97
|
-
proc.stderr?.on('data', (c: Buffer) => {
|
|
98
|
-
errChunks.push(c)
|
|
99
|
-
if (this._mode === 'default') process.stderr.write(c)
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
const exitCode: number = await new Promise((resolve, reject) => {
|
|
103
|
-
proc.on('error', reject)
|
|
104
|
-
proc.on('close', (code) => resolve(code ?? 0))
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
const stdout = Buffer.concat(outChunks)
|
|
108
|
-
const stderr = Buffer.concat(errChunks)
|
|
109
|
-
const result: ShResult = { exitCode, stdout, stderr }
|
|
110
|
-
|
|
111
|
-
if (exitCode !== 0 && this._throw) {
|
|
112
|
-
const err: any = new Error(`sh: command failed with exit ${exitCode}: ${this.args.join(' ')}`)
|
|
113
|
-
err.exitCode = exitCode
|
|
114
|
-
err.stdout = stdout
|
|
115
|
-
err.stderr = stderr
|
|
116
|
-
throw err
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return result
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
const WHITESPACE = /\s/
|
|
124
|
-
|
|
125
|
-
function tokenize(
|
|
126
|
-
strings: TemplateStringsArray,
|
|
127
|
-
values: unknown[],
|
|
128
|
-
): { tokens: string[]; initialCwd?: string } {
|
|
129
|
-
const tokens: string[] = []
|
|
130
|
-
let current = ''
|
|
131
|
-
let inToken = false
|
|
132
|
-
|
|
133
|
-
const commit = () => {
|
|
134
|
-
if (inToken) {
|
|
135
|
-
tokens.push(current)
|
|
136
|
-
current = ''
|
|
137
|
-
inToken = false
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const append = (s: string) => {
|
|
142
|
-
current += s
|
|
143
|
-
inToken = true
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
const appendValue = (val: unknown) => {
|
|
147
|
-
if (val == null) return
|
|
148
|
-
if (Array.isArray(val)) {
|
|
149
|
-
val.forEach((item, i) => {
|
|
150
|
-
if (i > 0) commit()
|
|
151
|
-
append(String(item))
|
|
152
|
-
})
|
|
153
|
-
return
|
|
154
|
-
}
|
|
155
|
-
append(String(val))
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
strings.forEach((literal, i) => {
|
|
159
|
-
for (let c = 0; c < literal.length; c++) {
|
|
160
|
-
const ch = literal[c]
|
|
161
|
-
if (WHITESPACE.test(ch)) commit()
|
|
162
|
-
else append(ch)
|
|
163
|
-
}
|
|
164
|
-
if (i < values.length) appendValue(values[i])
|
|
165
|
-
})
|
|
166
|
-
commit()
|
|
167
|
-
|
|
168
|
-
// Lift `cd <path> && <cmd...>` prefix into subprocess cwd
|
|
169
|
-
if (tokens.length >= 3 && tokens[0] === 'cd' && tokens[2] === '&&') {
|
|
170
|
-
return { tokens: tokens.slice(3), initialCwd: tokens[1] }
|
|
171
|
-
}
|
|
172
|
-
return { tokens }
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export function sh(strings: TemplateStringsArray, ...values: unknown[]): Sh {
|
|
176
|
-
const { tokens, initialCwd } = tokenize(strings, values)
|
|
177
|
-
const s = new Sh(tokens)
|
|
178
|
-
if (initialCwd) s.cwd(initialCwd)
|
|
179
|
-
return s
|
|
180
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
* text=auto eol=lf
|