create-vxrn 2.0.0-beta.99.1 → 2.6.1
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/.turbo/turbo-build.log +2 -2
- package/dist/cjs/create.cjs +19 -28
- package/dist/cjs/create.native.cjs +21 -30
- package/dist/cjs/create.native.js +21 -30
- package/dist/cjs/create.native.js.map +1 -1
- package/dist/cjs/helpers/cloneStarter.cjs +4 -4
- package/dist/cjs/helpers/cloneStarter.native.cjs +6 -6
- package/dist/cjs/helpers/cloneStarter.native.js +6 -6
- package/dist/cjs/helpers/cloneStarter.native.js.map +1 -1
- package/dist/cjs/helpers/getProjectName.native.cjs +2 -2
- package/dist/cjs/helpers/getProjectName.native.js +2 -2
- package/dist/cjs/helpers/getProjectName.native.js.map +1 -1
- package/dist/cjs/helpers/getTemplateInfo.native.cjs +2 -2
- package/dist/cjs/helpers/getTemplateInfo.native.js +2 -2
- package/dist/cjs/helpers/getTemplateInfo.native.js.map +1 -1
- package/dist/cjs/index.cjs +4 -1
- package/dist/cjs/index.native.cjs +4 -1
- package/dist/cjs/index.native.js +4 -1
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/steps/bare.native.cjs +1 -1
- package/dist/cjs/steps/bare.native.js +1 -1
- package/dist/cjs/steps/bare.native.js.map +1 -1
- package/dist/cjs/steps/fullstack.native.cjs +2 -2
- package/dist/cjs/steps/fullstack.native.js +2 -2
- package/dist/cjs/steps/fullstack.native.js.map +1 -1
- package/dist/cjs/steps/one.native.cjs +3 -3
- package/dist/cjs/steps/one.native.js +3 -3
- package/dist/cjs/steps/one.native.js.map +1 -1
- package/dist/cjs/templates.cjs +25 -36
- package/dist/cjs/templates.native.cjs +25 -36
- package/dist/cjs/templates.native.js +25 -36
- package/dist/cjs/templates.native.js.map +1 -1
- package/dist/esm/create.mjs +20 -29
- package/dist/esm/create.mjs.map +1 -1
- package/dist/esm/create.native.js +22 -31
- package/dist/esm/create.native.js.map +1 -1
- package/dist/esm/helpers/cloneStarter.mjs +4 -4
- package/dist/esm/helpers/cloneStarter.mjs.map +1 -1
- package/dist/esm/helpers/cloneStarter.native.js +6 -6
- package/dist/esm/helpers/cloneStarter.native.js.map +1 -1
- package/dist/esm/helpers/getProjectName.native.js +2 -2
- package/dist/esm/helpers/getProjectName.native.js.map +1 -1
- package/dist/esm/helpers/getTemplateInfo.native.js +2 -2
- package/dist/esm/helpers/getTemplateInfo.native.js.map +1 -1
- package/dist/esm/index.mjs +4 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +4 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/steps/bare.native.js +1 -1
- package/dist/esm/steps/bare.native.js.map +1 -1
- package/dist/esm/steps/fullstack.native.js +2 -2
- package/dist/esm/steps/fullstack.native.js.map +1 -1
- package/dist/esm/steps/one.native.js +3 -3
- package/dist/esm/steps/one.native.js.map +1 -1
- package/dist/esm/templates.mjs +25 -36
- package/dist/esm/templates.mjs.map +1 -1
- package/dist/esm/templates.native.js +25 -36
- package/dist/esm/templates.native.js.map +1 -1
- package/package.json +10 -8
- package/src/create.ts +26 -43
- package/src/helpers/cloneStarter.ts +6 -4
- package/src/index.ts +1 -1
- package/src/templates.ts +4 -14
- package/types/create.d.ts +5 -0
- package/types/create.d.ts.map +1 -0
- package/types/helpers/cloneStarter.d.ts +3 -0
- package/types/helpers/cloneStarter.d.ts.map +1 -0
- package/types/helpers/getProjectName.d.ts +2 -0
- package/types/helpers/getProjectName.d.ts.map +1 -0
- package/types/helpers/getTemplateInfo.d.ts +3 -0
- package/types/helpers/getTemplateInfo.d.ts.map +1 -0
- package/types/helpers/installDependencies.d.ts +2 -0
- package/types/helpers/installDependencies.d.ts.map +1 -0
- package/types/helpers/validateNpmPackage.d.ts +5 -0
- package/types/helpers/validateNpmPackage.d.ts.map +1 -0
- package/types/index.d.ts +3 -0
- package/types/index.d.ts.map +1 -0
- package/types/steps/bare.d.ts +5 -0
- package/types/steps/bare.d.ts.map +1 -0
- package/types/steps/fullstack.d.ts +4 -0
- package/types/steps/fullstack.d.ts.map +1 -0
- package/types/steps/one.d.ts +4 -0
- package/types/steps/one.d.ts.map +1 -0
- package/types/steps/types.d.ts +9 -0
- package/types/steps/types.d.ts.map +1 -0
- package/types/templates.d.ts +34 -0
- package/types/templates.d.ts.map +1 -0
- package/dist/esm/index.js +0 -72
- package/dist/esm/index.js.map +0 -1
package/dist/esm/templates.mjs
CHANGED
|
@@ -1,43 +1,32 @@
|
|
|
1
1
|
import * as BasicTemplateSteps from "./steps/one.mjs";
|
|
2
2
|
|
|
3
|
-
const templates = [
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
branch: "main"
|
|
15
|
-
},
|
|
16
|
-
...BasicTemplateSteps
|
|
3
|
+
const templates = [{
|
|
4
|
+
title: `Basic`,
|
|
5
|
+
value: "Basic",
|
|
6
|
+
description: "The simplest starting point, vanilla React Native",
|
|
7
|
+
type: "included-in-monorepo",
|
|
8
|
+
hidden: false,
|
|
9
|
+
repo: {
|
|
10
|
+
url: `https://github.com/onejs/one.git`,
|
|
11
|
+
sshFallback: `git@github.com:onejs/one.git`,
|
|
12
|
+
dir: [`examples`, `one-basic`],
|
|
13
|
+
branch: "main"
|
|
17
14
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
...BasicTemplateSteps
|
|
15
|
+
...BasicTemplateSteps
|
|
16
|
+
}, {
|
|
17
|
+
title: `Takeout`,
|
|
18
|
+
value: "Takeout",
|
|
19
|
+
description: "One, Tamagui, Zero, Better Auth",
|
|
20
|
+
type: "external-repo",
|
|
21
|
+
hidden: false,
|
|
22
|
+
repo: {
|
|
23
|
+
url: `https://github.com/tamagui/takeout2.git`,
|
|
24
|
+
sshFallback: `git@github.com:tamagui/takeout2.git`,
|
|
25
|
+
dir: [],
|
|
26
|
+
branch: "main"
|
|
31
27
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
value: "TakeoutPro",
|
|
35
|
-
description: "Takeout + a startup in a repo. Refined stack that's production ready. Home/Terms/Docs, CI/CD, IaC, Integration Tests, Onboarding, Notifications, OTA Updates, Screens, >50 Components, >25 Agent Docs, >30 Scripts. See https://takeout.tamagui.dev",
|
|
36
|
-
type: "external-link",
|
|
37
|
-
hidden: false,
|
|
38
|
-
externalUrl: "https://takeout.tamagui.dev"
|
|
39
|
-
}
|
|
40
|
-
];
|
|
28
|
+
...BasicTemplateSteps
|
|
29
|
+
}];
|
|
41
30
|
|
|
42
31
|
export { templates };
|
|
43
32
|
//# sourceMappingURL=templates.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","names":[],"sources":["esm/templates.js"],"sourcesContent":["import * as BasicTemplateSteps from \"./steps/one\";\nconst templates = [\n {\n title: `Basic`,\n value: \"Basic\",\n description: \"The simplest starting point, vanilla
|
|
1
|
+
{"version":3,"file":"templates.js","names":[],"sources":["esm/templates.js"],"sourcesContent":["import * as BasicTemplateSteps from \"./steps/one\";\nconst templates = [\n {\n title: `Basic`,\n value: \"Basic\",\n description: \"The simplest starting point, vanilla React Native\",\n type: \"included-in-monorepo\",\n hidden: false,\n repo: {\n url: `https://github.com/onejs/one.git`,\n sshFallback: `git@github.com:onejs/one.git`,\n dir: [`examples`, `one-basic`],\n branch: \"main\"\n },\n ...BasicTemplateSteps\n },\n {\n title: `Takeout`,\n value: \"Takeout\",\n description: \"One, Tamagui, Zero, Better Auth\",\n type: \"external-repo\",\n hidden: false,\n repo: {\n url: `https://github.com/tamagui/takeout2.git`,\n sshFallback: `git@github.com:tamagui/takeout2.git`,\n dir: [],\n branch: \"main\"\n },\n ...BasicTemplateSteps\n }\n];\nexport {\n templates\n};\n//# sourceMappingURL=templates.js.map\n"],"mappings":";;;AACA,MAAM,YAAY,CAChB;CACE,OAAO;CACP,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,MAAM;EACJ,KAAK;EACL,aAAa;EACb,KAAK,CAAC,YAAY,WAAW;EAC7B,QAAQ;CACV;CACA,GAAG;AACL,GACA;CACE,OAAO;CACP,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,MAAM;EACJ,KAAK;EACL,aAAa;EACb,KAAK,CAAC;EACN,QAAQ;CACV;CACA,GAAG;AACL,CACF"}
|
|
@@ -1,43 +1,32 @@
|
|
|
1
1
|
import * as BasicTemplateSteps from "./steps/one.native.js";
|
|
2
2
|
|
|
3
|
-
var templates = [
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
branch: "main"
|
|
15
|
-
},
|
|
16
|
-
...BasicTemplateSteps
|
|
3
|
+
var templates = [{
|
|
4
|
+
title: `Basic`,
|
|
5
|
+
value: "Basic",
|
|
6
|
+
description: "The simplest starting point, vanilla React Native",
|
|
7
|
+
type: "included-in-monorepo",
|
|
8
|
+
hidden: false,
|
|
9
|
+
repo: {
|
|
10
|
+
url: `https://github.com/onejs/one.git`,
|
|
11
|
+
sshFallback: `git@github.com:onejs/one.git`,
|
|
12
|
+
dir: [`examples`, `one-basic`],
|
|
13
|
+
branch: "main"
|
|
17
14
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
...BasicTemplateSteps
|
|
15
|
+
...BasicTemplateSteps
|
|
16
|
+
}, {
|
|
17
|
+
title: `Takeout`,
|
|
18
|
+
value: "Takeout",
|
|
19
|
+
description: "One, Tamagui, Zero, Better Auth",
|
|
20
|
+
type: "external-repo",
|
|
21
|
+
hidden: false,
|
|
22
|
+
repo: {
|
|
23
|
+
url: `https://github.com/tamagui/takeout2.git`,
|
|
24
|
+
sshFallback: `git@github.com:tamagui/takeout2.git`,
|
|
25
|
+
dir: [],
|
|
26
|
+
branch: "main"
|
|
31
27
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
value: "TakeoutPro",
|
|
35
|
-
description: "Takeout + a startup in a repo. Refined stack that's production ready. Home/Terms/Docs, CI/CD, IaC, Integration Tests, Onboarding, Notifications, OTA Updates, Screens, >50 Components, >25 Agent Docs, >30 Scripts. See https://takeout.tamagui.dev",
|
|
36
|
-
type: "external-link",
|
|
37
|
-
hidden: false,
|
|
38
|
-
externalUrl: "https://takeout.tamagui.dev"
|
|
39
|
-
}
|
|
40
|
-
];
|
|
28
|
+
...BasicTemplateSteps
|
|
29
|
+
}];
|
|
41
30
|
|
|
42
31
|
export { templates };
|
|
43
32
|
//# sourceMappingURL=templates.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.native.js","names":[],"sources":["esm/templates.native.js"],"sourcesContent":["import * as BasicTemplateSteps from \"./steps/one\";\nvar templates = [\n {\n title: `Basic`,\n value: \"Basic\",\n description: \"The simplest starting point, vanilla
|
|
1
|
+
{"version":3,"file":"templates.native.js","names":[],"sources":["esm/templates.native.js"],"sourcesContent":["import * as BasicTemplateSteps from \"./steps/one\";\nvar templates = [\n {\n title: `Basic`,\n value: \"Basic\",\n description: \"The simplest starting point, vanilla React Native\",\n type: \"included-in-monorepo\",\n hidden: false,\n repo: {\n url: `https://github.com/onejs/one.git`,\n sshFallback: `git@github.com:onejs/one.git`,\n dir: [\n `examples`,\n `one-basic`\n ],\n branch: \"main\"\n },\n ...BasicTemplateSteps\n },\n {\n title: `Takeout`,\n value: \"Takeout\",\n description: \"One, Tamagui, Zero, Better Auth\",\n type: \"external-repo\",\n hidden: false,\n repo: {\n url: `https://github.com/tamagui/takeout2.git`,\n sshFallback: `git@github.com:tamagui/takeout2.git`,\n dir: [],\n branch: \"main\"\n },\n ...BasicTemplateSteps\n }\n];\nexport {\n templates\n};\n//# sourceMappingURL=templates.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,CACd;CACE,OAAO;CACP,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,MAAM;EACJ,KAAK;EACL,aAAa;EACb,KAAK,CACH,YACA,WACF;EACA,QAAQ;CACV;CACA,GAAG;AACL,GACA;CACE,OAAO;CACP,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,MAAM;EACJ,KAAK;EACL,aAAa;EACb,KAAK,CAAC;EACN,QAAQ;CACV;CACA,GAAG;AACL,CACF"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-vxrn",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"bin": {
|
|
5
5
|
"create-vxrn": "run.js"
|
|
6
6
|
},
|
|
7
|
-
"main": "dist/cjs",
|
|
8
|
-
"module": "dist/esm",
|
|
7
|
+
"main": "dist/cjs/index.cjs",
|
|
8
|
+
"module": "dist/esm/index.mjs",
|
|
9
|
+
"types": "./types/index.d.ts",
|
|
9
10
|
"scripts": {
|
|
10
11
|
"start": "./run.js",
|
|
11
12
|
"prerelease": "rimraf ./dist/",
|
|
12
13
|
"prepublish": "bun run build",
|
|
13
14
|
"typecheck": "tsc --noEmit",
|
|
14
|
-
"build": "tamagui-build
|
|
15
|
+
"build": "tamagui-build",
|
|
15
16
|
"watch": "bun run build --watch",
|
|
16
17
|
"clean": "tamagui-build clean",
|
|
17
18
|
"clean:build": "tamagui-build clean:build"
|
|
@@ -21,17 +22,17 @@
|
|
|
21
22
|
".": {
|
|
22
23
|
"types": "./types/index.d.ts",
|
|
23
24
|
"import": "./dist/esm/index.mjs",
|
|
24
|
-
"require": "./dist/cjs/index.
|
|
25
|
+
"require": "./dist/cjs/index.cjs"
|
|
25
26
|
},
|
|
26
27
|
"./create": {
|
|
27
28
|
"types": "./types/create.d.ts",
|
|
28
29
|
"import": "./dist/esm/create.mjs",
|
|
29
|
-
"require": "./dist/cjs/create.
|
|
30
|
+
"require": "./dist/cjs/create.cjs"
|
|
30
31
|
}
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
34
|
"@types/validate-npm-package-name": "^4.0.2",
|
|
34
|
-
"@vxrn/utils": "2.
|
|
35
|
+
"@vxrn/utils": "2.6.1",
|
|
35
36
|
"ansis": "^3.1.0",
|
|
36
37
|
"async-retry": "1.3.1",
|
|
37
38
|
"citty": "^0.1.6",
|
|
@@ -43,13 +44,14 @@
|
|
|
43
44
|
"yocto-spinner": "^0.1.0"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
|
-
"@tamagui/build": "3.0.
|
|
47
|
+
"@tamagui/build": "3.0.3",
|
|
47
48
|
"@types/prompts": "^2.4.9",
|
|
48
49
|
"typescript": "7.0.2"
|
|
49
50
|
},
|
|
50
51
|
"publishConfig": {
|
|
51
52
|
"access": "public"
|
|
52
53
|
},
|
|
54
|
+
"releaseSourceCommit": "0d558b23541f02327d5bb9901fa8f366865feb7c",
|
|
53
55
|
"repository": {
|
|
54
56
|
"type": "git",
|
|
55
57
|
"url": "git+https://github.com/onejs/one.git",
|
package/src/create.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ansis from 'ansis'
|
|
2
2
|
import FSExtra from 'fs-extra'
|
|
3
|
-
import { execSync
|
|
3
|
+
import { execSync } from 'node:child_process'
|
|
4
4
|
import fs from 'node:fs'
|
|
5
5
|
import path from 'node:path'
|
|
6
6
|
import { promisify } from 'node:util'
|
|
@@ -59,22 +59,6 @@ export async function create(args: { template?: string; name?: string }) {
|
|
|
59
59
|
|
|
60
60
|
let template = await getTemplateInfo(args.template)
|
|
61
61
|
|
|
62
|
-
// handle external link templates (like Tamagui Pro)
|
|
63
|
-
if (template.type === 'external-link') {
|
|
64
|
-
const url = (template as any).externalUrl
|
|
65
|
-
console.info()
|
|
66
|
-
console.info(ansis.green(`Opening ${url}...`))
|
|
67
|
-
console.info()
|
|
68
|
-
const openCmd =
|
|
69
|
-
process.platform === 'darwin'
|
|
70
|
-
? 'open'
|
|
71
|
-
: process.platform === 'win32'
|
|
72
|
-
? 'start'
|
|
73
|
-
: 'xdg-open'
|
|
74
|
-
exec(`${openCmd} ${url}`)
|
|
75
|
-
process.exit(0)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
62
|
const { valid, problems } = validateNpmName(projectName)
|
|
79
63
|
if (!valid) {
|
|
80
64
|
console.error(
|
|
@@ -99,23 +83,6 @@ export async function create(args: { template?: string; name?: string }) {
|
|
|
99
83
|
},
|
|
100
84
|
}).start()
|
|
101
85
|
|
|
102
|
-
await FSExtra.mkdir(resolvedProjectPath)
|
|
103
|
-
|
|
104
|
-
try {
|
|
105
|
-
await cloneStarter(template as any, resolvedProjectPath)
|
|
106
|
-
process.chdir(resolvedProjectPath)
|
|
107
|
-
} catch (e) {
|
|
108
|
-
console.error(`[vxrn] Failed to copy example into ${resolvedProjectPath}\n\n`, e)
|
|
109
|
-
process.exit(1)
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
spinner.stop()
|
|
113
|
-
console.info()
|
|
114
|
-
console.info()
|
|
115
|
-
console.info(ansis.green(`${projectName} created!`))
|
|
116
|
-
console.info()
|
|
117
|
-
console.info()
|
|
118
|
-
|
|
119
86
|
const packageJson = await (async () => {
|
|
120
87
|
const errorMessages: string[] = []
|
|
121
88
|
|
|
@@ -150,6 +117,23 @@ export async function create(args: { template?: string; name?: string }) {
|
|
|
150
117
|
}
|
|
151
118
|
})()
|
|
152
119
|
|
|
120
|
+
await FSExtra.mkdir(resolvedProjectPath)
|
|
121
|
+
|
|
122
|
+
try {
|
|
123
|
+
await cloneStarter(template as any, resolvedProjectPath)
|
|
124
|
+
process.chdir(resolvedProjectPath)
|
|
125
|
+
} catch (e) {
|
|
126
|
+
console.error(`[vxrn] Failed to copy example into ${resolvedProjectPath}\n\n`, e)
|
|
127
|
+
process.exit(1)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
spinner.stop()
|
|
131
|
+
console.info()
|
|
132
|
+
console.info()
|
|
133
|
+
console.info(ansis.green(`${projectName} created!`))
|
|
134
|
+
console.info()
|
|
135
|
+
console.info()
|
|
136
|
+
|
|
153
137
|
// change root package.json's name to project name
|
|
154
138
|
updatePackageJsonName(projectName, resolvedProjectPath)
|
|
155
139
|
// replace `"workspace:*"` with the actual version
|
|
@@ -163,7 +147,8 @@ export async function create(args: { template?: string; name?: string }) {
|
|
|
163
147
|
}
|
|
164
148
|
const found = await detectPackageManager()
|
|
165
149
|
|
|
166
|
-
|
|
150
|
+
// found maps every manager to whether it is installed; count only the installed ones
|
|
151
|
+
const allFound = (Object.keys(found) as PackageManagerName[]).filter((x) => found[x])
|
|
167
152
|
|
|
168
153
|
if (allFound.length === 1) {
|
|
169
154
|
return allFound[0]
|
|
@@ -173,9 +158,7 @@ export async function create(args: { template?: string; name?: string }) {
|
|
|
173
158
|
name: 'packageManager',
|
|
174
159
|
type: 'select',
|
|
175
160
|
message: `Package Manager:`,
|
|
176
|
-
choices: allFound
|
|
177
|
-
.filter((x) => found[x])
|
|
178
|
-
.map((name) => ({
|
|
161
|
+
choices: allFound.map((name) => ({
|
|
179
162
|
title: name,
|
|
180
163
|
value: name,
|
|
181
164
|
})),
|
|
@@ -240,11 +223,11 @@ function updatePackageJsonVersions(version: string, dir: string) {
|
|
|
240
223
|
const packageJsonPath = path.join(dir, 'package.json')
|
|
241
224
|
if (existsSync(packageJsonPath)) {
|
|
242
225
|
const content = readFileSync(packageJsonPath).toString()
|
|
243
|
-
//
|
|
244
|
-
const contentWithUpdatedVersions = content
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
226
|
+
// pin the matching release; ranges can resolve to unrelated legacy packages
|
|
227
|
+
const contentWithUpdatedVersions = content.replace(
|
|
228
|
+
/"workspace:(?:\^|~|\*)"/gm,
|
|
229
|
+
`"${version}"`
|
|
230
|
+
)
|
|
248
231
|
writeFileSync(packageJsonPath, contentWithUpdatedVersions)
|
|
249
232
|
}
|
|
250
233
|
}
|
|
@@ -12,9 +12,12 @@ export const cloneStarter = async (
|
|
|
12
12
|
template: CloneableTemplate,
|
|
13
13
|
resolvedProjectPath: string
|
|
14
14
|
) => {
|
|
15
|
+
const branch = template.repo.branch
|
|
16
|
+
|
|
15
17
|
const dir = await setupVxrnDotDir(
|
|
16
18
|
template,
|
|
17
|
-
|
|
19
|
+
branch,
|
|
20
|
+
join(vxrnDir, 'vxrn', `${template.repo.url.split('/').at(-1)!}-${branch}`)
|
|
18
21
|
)
|
|
19
22
|
|
|
20
23
|
if (!(await pathExists(dir))) {
|
|
@@ -36,11 +39,10 @@ export const cloneStarter = async (
|
|
|
36
39
|
|
|
37
40
|
async function setupVxrnDotDir(
|
|
38
41
|
template: CloneableTemplate,
|
|
42
|
+
branch: string,
|
|
39
43
|
targetGitDir: string,
|
|
40
44
|
isRetry = false
|
|
41
45
|
) {
|
|
42
|
-
const branch = template.repo.branch
|
|
43
|
-
|
|
44
46
|
await ensureDir(vxrnDir)
|
|
45
47
|
|
|
46
48
|
const isInSubDir = template.repo.dir.length > 0
|
|
@@ -113,7 +115,7 @@ async function setupVxrnDotDir(
|
|
|
113
115
|
process.exit(1)
|
|
114
116
|
}
|
|
115
117
|
await rimraf(targetGitDir)
|
|
116
|
-
return await setupVxrnDotDir(template, targetGitDir, true)
|
|
118
|
+
return await setupVxrnDotDir(template, branch, targetGitDir, true)
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
|
package/src/index.ts
CHANGED
|
@@ -57,7 +57,7 @@ const main = defineCommand({
|
|
|
57
57
|
console.info() // this newline prevents the ascii art from breaking
|
|
58
58
|
console.info(ansis.bold('Creating vxrn app...'))
|
|
59
59
|
|
|
60
|
-
await create({ template: args.template })
|
|
60
|
+
await create({ name: args.directory, template: args.template })
|
|
61
61
|
},
|
|
62
62
|
})
|
|
63
63
|
|
package/src/templates.ts
CHANGED
|
@@ -4,7 +4,7 @@ export const templates = [
|
|
|
4
4
|
{
|
|
5
5
|
title: `Basic`,
|
|
6
6
|
value: 'Basic',
|
|
7
|
-
description: 'The simplest starting point, vanilla
|
|
7
|
+
description: 'The simplest starting point, vanilla React Native',
|
|
8
8
|
type: 'included-in-monorepo',
|
|
9
9
|
hidden: false,
|
|
10
10
|
repo: {
|
|
@@ -17,29 +17,19 @@ export const templates = [
|
|
|
17
17
|
},
|
|
18
18
|
|
|
19
19
|
{
|
|
20
|
-
title: `Takeout
|
|
20
|
+
title: `Takeout`,
|
|
21
21
|
value: 'Takeout',
|
|
22
22
|
description: 'One, Tamagui, Zero, Better Auth',
|
|
23
23
|
type: 'external-repo',
|
|
24
24
|
hidden: false,
|
|
25
25
|
repo: {
|
|
26
|
-
url: `https://github.com/tamagui/
|
|
27
|
-
sshFallback: `git@github.com:tamagui/
|
|
26
|
+
url: `https://github.com/tamagui/takeout2.git`,
|
|
27
|
+
sshFallback: `git@github.com:tamagui/takeout2.git`,
|
|
28
28
|
dir: [],
|
|
29
29
|
branch: 'main',
|
|
30
30
|
},
|
|
31
31
|
...BasicTemplateSteps,
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
title: `Takeout Production`,
|
|
36
|
-
value: 'TakeoutPro',
|
|
37
|
-
description:
|
|
38
|
-
"Takeout + a startup in a repo. Refined stack that's production ready. Home/Terms/Docs, CI/CD, IaC, Integration Tests, Onboarding, Notifications, OTA Updates, Screens, >50 Components, >25 Agent Docs, >30 Scripts. See https://takeout.tamagui.dev",
|
|
39
|
-
type: 'external-link',
|
|
40
|
-
hidden: false,
|
|
41
|
-
externalUrl: 'https://takeout.tamagui.dev',
|
|
42
|
-
},
|
|
43
33
|
] as const
|
|
44
34
|
|
|
45
35
|
export type Template = (typeof templates)[number]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAiBA,wBAAsB,MAAM,CAAC,IAAI,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,iBA8LtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloneStarter.d.ts","sourceRoot":"","sources":["../../src/helpers/cloneStarter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAMrD,eAAO,MAAM,YAAY,aACb,iBAAiB,uBACN,MAAM,kBAyB5B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getProjectName.d.ts","sourceRoot":"","sources":["../../src/helpers/getProjectName.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc,iBAAwB,MAAM,oBA6CxD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTemplateInfo.d.ts","sourceRoot":"","sources":["../../src/helpers/getTemplateInfo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAIxC,eAAO,MAAM,eAAe,cACf,MAAM,KAChB,OAAO,CAAC,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAuBpC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installDependencies.d.ts","sourceRoot":"","sources":["../../src/helpers/installDependencies.ts"],"names":[],"mappings":"AAEA,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,iBA2BhD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateNpmPackage.d.ts","sourceRoot":"","sources":["../../src/helpers/validateNpmPackage.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG;IAC7C,KAAK,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB,CAUA"}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bare.d.ts","sourceRoot":"","sources":["../../src/steps/bare.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AA6BzC,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,iBAUrB;AAED,QAAA,MAAM,IAAI,EAAE,UAyCX,CAAA;eAEc,IAAI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fullstack.d.ts","sourceRoot":"","sources":["../../src/steps/fullstack.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAQzC,QAAA,MAAM,IAAI,EAAE,UAUX,CAAA;eAEc,IAAI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"one.d.ts","sourceRoot":"","sources":["../../src/steps/one.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,eAAO,MAAM,UAAU,EAAE,UAoBxB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,UAiDxB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type ExtraSteps = (args: CreateTemplateProps) => Promise<void>;
|
|
2
|
+
export type PreInstall = (args: CreateTemplateProps) => Promise<void>;
|
|
3
|
+
export type CreateTemplateProps = {
|
|
4
|
+
projectName: string;
|
|
5
|
+
isFullClone?: boolean;
|
|
6
|
+
packageManager?: string;
|
|
7
|
+
projectPath?: string;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/steps/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,mBAAmB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AACrE,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,mBAAmB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AAErE,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const templates: readonly [{
|
|
2
|
+
readonly extraSteps: import("./steps/types").ExtraSteps;
|
|
3
|
+
readonly preInstall: import("./steps/types").ExtraSteps;
|
|
4
|
+
readonly title: `Basic`;
|
|
5
|
+
readonly value: 'Basic';
|
|
6
|
+
readonly description: 'The simplest starting point, vanilla React Native';
|
|
7
|
+
readonly type: 'included-in-monorepo';
|
|
8
|
+
readonly hidden: false;
|
|
9
|
+
readonly repo: {
|
|
10
|
+
readonly url: `https://github.com/onejs/one.git`;
|
|
11
|
+
readonly sshFallback: `git@github.com:onejs/one.git`;
|
|
12
|
+
readonly dir: readonly [`examples`, `one-basic`];
|
|
13
|
+
readonly branch: 'main';
|
|
14
|
+
};
|
|
15
|
+
}, {
|
|
16
|
+
readonly extraSteps: import("./steps/types").ExtraSteps;
|
|
17
|
+
readonly preInstall: import("./steps/types").ExtraSteps;
|
|
18
|
+
readonly title: `Takeout`;
|
|
19
|
+
readonly value: 'Takeout';
|
|
20
|
+
readonly description: 'One, Tamagui, Zero, Better Auth';
|
|
21
|
+
readonly type: 'external-repo';
|
|
22
|
+
readonly hidden: false;
|
|
23
|
+
readonly repo: {
|
|
24
|
+
readonly url: `https://github.com/tamagui/takeout2.git`;
|
|
25
|
+
readonly sshFallback: `git@github.com:tamagui/takeout2.git`;
|
|
26
|
+
readonly dir: readonly [];
|
|
27
|
+
readonly branch: 'main';
|
|
28
|
+
};
|
|
29
|
+
}];
|
|
30
|
+
export type Template = (typeof templates)[number];
|
|
31
|
+
export type CloneableTemplate = Extract<Template, {
|
|
32
|
+
repo: any;
|
|
33
|
+
}>;
|
|
34
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;oBAEX,OAAO;oBACP,OAAO;0BACD,mDAAmD;mBAC1D,sBAAsB;;;iBAG1B,GAAG,EAAE,kCAAkC;iBACvC,WAAW,EAAE,8BAA8B;iBAC3C,GAAG,YAAG,UAAU,EAAE,WAAW;iBAC7B,MAAM,EAAE,MAAM;;;;;oBAMT,SAAS;oBACT,SAAS;0BACH,iCAAiC;mBACxC,eAAe;;;iBAGnB,GAAG,EAAE,yCAAyC;iBAC9C,WAAW,EAAE,qCAAqC;iBAClD,GAAG;iBACH,MAAM,EAAE,MAAM;;EAIV,CAAA;AAEV,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAA;AACjD,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,QAAQ,EAAE;IAAE,IAAI,EAAE,GAAG,CAAA;CAAE,CAAC,CAAA"}
|
package/dist/esm/index.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import ansis from "ansis";
|
|
3
|
-
import { defineCommand, runMain } from "citty";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import { cwd } from "node:process";
|
|
6
|
-
import { getTemplateInfo } from "./helpers/getTemplateInfo.mjs";
|
|
7
|
-
import { create } from "./create.mjs";
|
|
8
|
-
import { fileURLToPath } from "node:url";
|
|
9
|
-
import { readFileSync } from "node:fs";
|
|
10
|
-
|
|
11
|
-
function exit() {
|
|
12
|
-
process.exit(0);
|
|
13
|
-
}
|
|
14
|
-
process.on("SIGTERM", exit);
|
|
15
|
-
process.on("SIGINT", exit);
|
|
16
|
-
const main = defineCommand({
|
|
17
|
-
meta: {
|
|
18
|
-
name: "main",
|
|
19
|
-
version: "0.0.0",
|
|
20
|
-
description: "Welcome to vxrn"
|
|
21
|
-
},
|
|
22
|
-
args: {
|
|
23
|
-
directory: {
|
|
24
|
-
type: "positional",
|
|
25
|
-
description: "Directory to copy into",
|
|
26
|
-
default: ""
|
|
27
|
-
},
|
|
28
|
-
template: {
|
|
29
|
-
type: "string",
|
|
30
|
-
required: false,
|
|
31
|
-
description: "Choose a template in advance (avoid selection screen)."
|
|
32
|
-
},
|
|
33
|
-
info: {
|
|
34
|
-
type: "boolean",
|
|
35
|
-
description: "Output the post-install instructions for the template."
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
async run({ args }) {
|
|
39
|
-
if (args.info) {
|
|
40
|
-
let template = await getTemplateInfo(args.template);
|
|
41
|
-
if ("extraSteps" in template) {
|
|
42
|
-
await template.extraSteps({
|
|
43
|
-
isFullClone: false,
|
|
44
|
-
projectName: path.basename(cwd()),
|
|
45
|
-
projectPath: cwd()
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
console.info();
|
|
51
|
-
console.info(ansis.bold("Creating vxrn app..."));
|
|
52
|
-
await create({ template: args.template });
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
runMain(main);
|
|
56
|
-
function getPackageVersion() {
|
|
57
|
-
let dirname;
|
|
58
|
-
if (typeof __dirname !== "undefined") {
|
|
59
|
-
dirname = __dirname;
|
|
60
|
-
} else {
|
|
61
|
-
dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
62
|
-
}
|
|
63
|
-
const packagePath = path.join(dirname, "..", "..", "package.json");
|
|
64
|
-
const packageJson = JSON.parse(readFileSync(packagePath, "utf-8"));
|
|
65
|
-
return packageJson.version;
|
|
66
|
-
}
|
|
67
|
-
if (process.argv.includes("--version")) {
|
|
68
|
-
console.info(getPackageVersion());
|
|
69
|
-
process.exit(0);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
//# sourceMappingURL=index.js.map
|