@take-out/scripts 0.1.6 → 0.1.7
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 +2 -2
- package/src/build-initial.ts +12 -5
- package/src/exec-with-env.ts +1 -1
- package/src/helpers/args.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@take-out/scripts",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/run.ts",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@clack/prompts": "^0.8.2",
|
|
32
|
-
"@take-out/helpers": "
|
|
32
|
+
"@take-out/helpers": "workspace:*",
|
|
33
33
|
"picocolors": "^1.1.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
package/src/build-initial.ts
CHANGED
|
@@ -15,16 +15,23 @@ await cmd`bootstrap project workspace and build initial packages`.run(
|
|
|
15
15
|
|
|
16
16
|
// check if critical packages are built
|
|
17
17
|
if (hasPackages) {
|
|
18
|
+
const hasHelpers = fs.existsSync(`./packages/helpers`)
|
|
19
|
+
const hasCli = fs.existsSync(`./packages/cli`)
|
|
20
|
+
|
|
18
21
|
const needsBuild =
|
|
19
|
-
!fs.existsSync(`./packages/helpers/dist`) ||
|
|
20
|
-
!fs.existsSync(`./packages/cli/dist/esm`)
|
|
22
|
+
(hasHelpers && !fs.existsSync(`./packages/helpers/dist`)) ||
|
|
23
|
+
(hasCli && !fs.existsSync(`./packages/cli/dist/esm`))
|
|
21
24
|
|
|
22
25
|
if (needsBuild) {
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
if (hasHelpers) {
|
|
27
|
+
// build helpers first as other packages depend on it
|
|
28
|
+
await $`cd packages/helpers && bun run build`
|
|
29
|
+
}
|
|
25
30
|
|
|
26
31
|
// then build all other packages in parallel
|
|
27
|
-
|
|
32
|
+
if (fs.existsSync(`./packages/scripts/src/run.ts`)) {
|
|
33
|
+
await $`bun ./packages/scripts/src/run.ts build --no-root`
|
|
34
|
+
}
|
|
28
35
|
}
|
|
29
36
|
}
|
|
30
37
|
|
package/src/exec-with-env.ts
CHANGED
|
@@ -37,7 +37,7 @@ export async function execWithEnvironment(
|
|
|
37
37
|
...(USE_LOCAL_SERVER && {
|
|
38
38
|
ONE_SERVER_URL: devEnv?.ONE_SERVER_URL,
|
|
39
39
|
// vite reads from .env.production for us unless defined into process.env
|
|
40
|
-
|
|
40
|
+
VITE_ZERO_HOST: 'start.chat',
|
|
41
41
|
}),
|
|
42
42
|
} as any as Record<string, string>
|
|
43
43
|
|
package/src/helpers/args.ts
CHANGED
|
@@ -75,7 +75,9 @@ export function args<const S extends string>(strings: TemplateStringsArray | S):
|
|
|
75
75
|
const arg = argv[i]!
|
|
76
76
|
|
|
77
77
|
if (arg.startsWith('-')) {
|
|
78
|
-
const key = arg
|
|
78
|
+
const key = arg
|
|
79
|
+
.replace(/^--?/, '')
|
|
80
|
+
.replace(/-([a-z0-9])/g, (_, c) => c.toUpperCase())
|
|
79
81
|
const type = schema[key]
|
|
80
82
|
|
|
81
83
|
if (type === 'boolean') {
|