@tamagui/cli 2.7.7 → 3.0.0-beta.643.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/dist/add.cjs +77 -87
- package/dist/build.cjs +415 -277
- package/dist/cli.cjs +343 -340
- package/dist/generate-prompt.cjs +344 -357
- package/dist/generate.cjs +46 -54
- package/dist/index.cjs +2 -1
- package/dist/migrate.cjs +370 -0
- package/dist/setup-prompt.cjs +158 -0
- package/dist/to-tailwind-default-config.cjs +778 -0
- package/dist/to-tailwind.cjs +214 -0
- package/dist/update-template.cjs +44 -52
- package/dist/update.cjs +15 -18
- package/dist/upgrade.cjs +407 -398
- package/dist/utils.cjs +85 -101
- package/metro.cjs +1 -0
- package/metro.d.ts +1 -0
- package/metro.mjs +1 -0
- package/package.json +41 -12
- package/src/build.ts +574 -363
- package/src/cli.ts +96 -12
- package/src/generate-prompt.ts +16 -24
- package/src/migrate.ts +354 -0
- package/src/setup-prompt.ts +139 -0
- package/src/to-tailwind-default-config.ts +755 -0
- package/src/to-tailwind.ts +313 -0
- package/src/utils.ts +11 -9
- package/types/add.d.ts +1 -1
- package/types/add.d.ts.map +1 -1
- package/types/build.d.ts +1 -1
- package/types/build.d.ts.map +1 -1
- package/types/migrate.d.ts +7 -0
- package/types/migrate.d.ts.map +1 -0
- package/types/setup-prompt.d.ts +3 -0
- package/types/setup-prompt.d.ts.map +1 -0
- package/types/to-tailwind-default-config.d.ts +53 -0
- package/types/to-tailwind-default-config.d.ts.map +1 -0
- package/types/to-tailwind.d.ts +16 -0
- package/types/to-tailwind.d.ts.map +1 -0
- package/types/utils.d.ts.map +1 -1
- package/vite.cjs +1 -0
- package/vite.d.ts +1 -0
- package/vite.mjs +1 -0
package/dist/utils.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -5,126 +6,109 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
8
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
12
13
|
};
|
|
13
14
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
21
22
|
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
-
value: mod,
|
|
29
|
-
enumerable: true
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
30
26
|
}) : target, mod));
|
|
31
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
-
value: true
|
|
33
|
-
}), mod);
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
34
28
|
var utils_exports = {};
|
|
35
29
|
__export(utils_exports, {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
disposeAll: () => disposeAll,
|
|
31
|
+
ensure: () => ensure,
|
|
32
|
+
getOptions: () => getOptions,
|
|
33
|
+
loadTamagui: () => loadTamagui,
|
|
34
|
+
registerDispose: () => registerDispose
|
|
41
35
|
});
|
|
42
36
|
module.exports = __toCommonJS(utils_exports);
|
|
43
37
|
var import_chalk = __toESM(require("chalk"));
|
|
44
38
|
var import_fs_extra = require("fs-extra");
|
|
45
39
|
var import_node_path = require("node:path");
|
|
46
|
-
async function getOptions({
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
tamaguiOptions: finalOptions,
|
|
86
|
-
paths: {
|
|
87
|
-
root,
|
|
88
|
-
dotDir,
|
|
89
|
-
conf: (0, import_node_path.join)(dotDir, "tamagui.config.json"),
|
|
90
|
-
types: (0, import_node_path.join)(dotDir, "types.json")
|
|
91
|
-
}
|
|
92
|
-
};
|
|
40
|
+
async function getOptions({ root = process.cwd(), tsconfigPath = "tsconfig.json", tamaguiOptions, host, debug, loadTamaguiOptions } = {}) {
|
|
41
|
+
const dotDir = (0, import_node_path.join)(root, ".tamagui");
|
|
42
|
+
let pkgJson = {};
|
|
43
|
+
let config = "";
|
|
44
|
+
try {
|
|
45
|
+
config = await getDefaultTamaguiConfigPath();
|
|
46
|
+
} catch {}
|
|
47
|
+
try {
|
|
48
|
+
pkgJson = await (0, import_fs_extra.readJSON)((0, import_node_path.join)(root, "package.json"));
|
|
49
|
+
} catch {}
|
|
50
|
+
const filledOptions = {
|
|
51
|
+
platform: "native",
|
|
52
|
+
components: ["tamagui"],
|
|
53
|
+
config,
|
|
54
|
+
...tamaguiOptions
|
|
55
|
+
};
|
|
56
|
+
let finalOptions = filledOptions;
|
|
57
|
+
if (loadTamaguiOptions) {
|
|
58
|
+
const { loadTamaguiBuildConfigSync } = require("@tamagui/static/loadTamagui");
|
|
59
|
+
finalOptions = loadTamaguiBuildConfigSync(filledOptions);
|
|
60
|
+
if (!finalOptions.config) {
|
|
61
|
+
console.warn(import_chalk.default.yellow(`Warning: no Tamagui config found in ${root}. Commands that need a config may fail.`));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
mode: process.env.NODE_ENV === "production" ? "production" : "development",
|
|
66
|
+
root,
|
|
67
|
+
host: host || "127.0.0.1",
|
|
68
|
+
pkgJson,
|
|
69
|
+
debug,
|
|
70
|
+
tsconfigPath,
|
|
71
|
+
tamaguiOptions: finalOptions,
|
|
72
|
+
paths: {
|
|
73
|
+
root,
|
|
74
|
+
dotDir,
|
|
75
|
+
conf: (0, import_node_path.join)(dotDir, "tamagui.config.json"),
|
|
76
|
+
types: (0, import_node_path.join)(dotDir, "types.json")
|
|
77
|
+
}
|
|
78
|
+
};
|
|
93
79
|
}
|
|
94
80
|
function ensure(condition, message) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
81
|
+
if (!condition) {
|
|
82
|
+
console.error(import_chalk.default.red.bold("Error:"), import_chalk.default.yellow(`${message}`));
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
99
85
|
}
|
|
100
86
|
const defaultPaths = ["tamagui.config.ts", (0, import_node_path.join)("src", "tamagui.config.ts")];
|
|
101
87
|
let cachedPath = "";
|
|
102
88
|
async function getDefaultTamaguiConfigPath() {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
89
|
+
if (cachedPath) return cachedPath;
|
|
90
|
+
const existingPaths = await Promise.all(defaultPaths.map((path) => (0, import_fs_extra.pathExists)(path)));
|
|
91
|
+
const existing = existingPaths.findIndex((x) => !!x);
|
|
92
|
+
const found = defaultPaths[existing];
|
|
93
|
+
if (!found) {
|
|
94
|
+
throw new Error(`No found tamagui.config.ts`);
|
|
95
|
+
}
|
|
96
|
+
cachedPath = found;
|
|
97
|
+
return found;
|
|
112
98
|
}
|
|
113
|
-
const loadTamagui = async opts => {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
});
|
|
122
|
-
return loaded;
|
|
99
|
+
const loadTamagui = async (opts) => {
|
|
100
|
+
const { loadTamagui: loadTamaguiStatic } = require("@tamagui/static/loadTamagui");
|
|
101
|
+
const loaded = await loadTamaguiStatic({
|
|
102
|
+
components: ["tamagui"],
|
|
103
|
+
...opts,
|
|
104
|
+
config: opts.config ?? await getDefaultTamaguiConfigPath()
|
|
105
|
+
});
|
|
106
|
+
return loaded;
|
|
123
107
|
};
|
|
124
|
-
const disposers = /* @__PURE__ */new Set();
|
|
108
|
+
const disposers = /* @__PURE__ */ new Set();
|
|
125
109
|
function registerDispose(cb) {
|
|
126
|
-
|
|
110
|
+
disposers.add(cb);
|
|
127
111
|
}
|
|
128
112
|
function disposeAll() {
|
|
129
|
-
|
|
130
|
-
}
|
|
113
|
+
disposers.forEach((cb) => cb());
|
|
114
|
+
}
|
package/metro.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('@tamagui/metro-plugin')
|
package/metro.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tamagui/metro-plugin'
|
package/metro.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@tamagui/metro-plugin'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.643.1",
|
|
4
4
|
"bin": {
|
|
5
5
|
"tama": "dist/index.cjs",
|
|
6
6
|
"tamagui": "dist/index.cjs"
|
|
@@ -9,11 +9,36 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"src",
|
|
11
11
|
"types",
|
|
12
|
-
"dist"
|
|
12
|
+
"dist",
|
|
13
|
+
"vite.cjs",
|
|
14
|
+
"vite.mjs",
|
|
15
|
+
"vite.d.ts",
|
|
16
|
+
"metro.cjs",
|
|
17
|
+
"metro.mjs",
|
|
18
|
+
"metro.d.ts"
|
|
13
19
|
],
|
|
14
20
|
"sideEffects": false,
|
|
15
21
|
"main": "dist/index.cjs",
|
|
16
22
|
"types": "./types/index.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
"./package.json": "./package.json",
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./types/index.d.ts",
|
|
27
|
+
"default": "./dist/index.cjs"
|
|
28
|
+
},
|
|
29
|
+
"./vite": {
|
|
30
|
+
"types": "./vite.d.ts",
|
|
31
|
+
"import": "./vite.mjs",
|
|
32
|
+
"require": "./vite.cjs",
|
|
33
|
+
"default": "./vite.cjs"
|
|
34
|
+
},
|
|
35
|
+
"./metro": {
|
|
36
|
+
"types": "./metro.d.ts",
|
|
37
|
+
"import": "./metro.mjs",
|
|
38
|
+
"require": "./metro.cjs",
|
|
39
|
+
"default": "./metro.cjs"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
17
42
|
"publishConfig": {
|
|
18
43
|
"access": "public"
|
|
19
44
|
},
|
|
@@ -26,30 +51,34 @@
|
|
|
26
51
|
"test:web": "bun run test"
|
|
27
52
|
},
|
|
28
53
|
"dependencies": {
|
|
29
|
-
"@tamagui/
|
|
30
|
-
"@tamagui/
|
|
31
|
-
"@tamagui/static": "
|
|
32
|
-
"@tamagui/
|
|
33
|
-
"@tamagui/
|
|
54
|
+
"@tamagui/generate-themes": "3.0.0-beta.643.1",
|
|
55
|
+
"@tamagui/metro-plugin": "3.0.0-beta.643.1",
|
|
56
|
+
"@tamagui/static": "3.0.0-beta.643.1",
|
|
57
|
+
"@tamagui/to-tailwind": "3.0.0-beta.643.1",
|
|
58
|
+
"@tamagui/types": "3.0.0-beta.643.1",
|
|
59
|
+
"@tamagui/vite-plugin": "3.0.0-beta.643.1",
|
|
34
60
|
"arg": "^5.0.2",
|
|
35
61
|
"chalk": "^4.1.2",
|
|
36
62
|
"change-case": "^4.1.2",
|
|
37
63
|
"chokidar": "^3.5.2",
|
|
38
|
-
"
|
|
64
|
+
"diff": "^9.0.0",
|
|
65
|
+
"esbuild": "0.28.1",
|
|
39
66
|
"express": "^4.18.2",
|
|
40
67
|
"fs-extra": "^11.2.0",
|
|
41
68
|
"get-port": "^7.0.0",
|
|
69
|
+
"glob": "^13.0.3",
|
|
42
70
|
"marked": "^14.1.2",
|
|
43
71
|
"marked-terminal": "^5.2.0",
|
|
44
72
|
"micromatch": "^4.0.7",
|
|
45
73
|
"opener": "^1.5.2",
|
|
46
74
|
"prompts": "2.1.0",
|
|
47
|
-
"ts-morph": "^
|
|
48
|
-
"typescript": "~
|
|
49
|
-
"url": "^0.11.0"
|
|
75
|
+
"ts-morph": "^28.0.0",
|
|
76
|
+
"typescript": "~6.0.3",
|
|
77
|
+
"url": "^0.11.0",
|
|
78
|
+
"@tamagui/language-service": "3.0.0-beta.643.1"
|
|
50
79
|
},
|
|
51
80
|
"devDependencies": {
|
|
52
|
-
"@tamagui/build": "
|
|
81
|
+
"@tamagui/build": "3.0.0-beta.643.1",
|
|
53
82
|
"@types/chokidar": "^2.1.3",
|
|
54
83
|
"@types/marked": "^5.0.0",
|
|
55
84
|
"vitest": "4.0.4"
|