@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/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
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
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
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
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
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
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
- disposeAll: () => disposeAll,
37
- ensure: () => ensure,
38
- getOptions: () => getOptions,
39
- loadTamagui: () => loadTamagui,
40
- registerDispose: () => registerDispose
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
- root = process.cwd(),
48
- tsconfigPath = "tsconfig.json",
49
- tamaguiOptions,
50
- host,
51
- debug,
52
- loadTamaguiOptions
53
- } = {}) {
54
- const dotDir = (0, import_node_path.join)(root, ".tamagui");
55
- let pkgJson = {};
56
- let config = "";
57
- try {
58
- config = await getDefaultTamaguiConfigPath();
59
- pkgJson = await (0, import_fs_extra.readJSON)((0, import_node_path.join)(root, "package.json"));
60
- } catch {
61
- if (loadTamaguiOptions) {
62
- console.warn(import_chalk.default.yellow(`Warning: no tamagui.config.ts found in ${root}. Commands that need a config may fail.`));
63
- }
64
- }
65
- const filledOptions = {
66
- platform: "native",
67
- components: ["tamagui"],
68
- config,
69
- ...tamaguiOptions
70
- };
71
- let finalOptions = filledOptions;
72
- if (loadTamaguiOptions) {
73
- const {
74
- loadTamaguiBuildConfigSync
75
- } = require("@tamagui/static/loadTamagui");
76
- finalOptions = loadTamaguiBuildConfigSync(filledOptions);
77
- }
78
- return {
79
- mode: process.env.NODE_ENV === "production" ? "production" : "development",
80
- root,
81
- host: host || "127.0.0.1",
82
- pkgJson,
83
- debug,
84
- tsconfigPath,
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
- if (!condition) {
96
- console.error(import_chalk.default.red.bold("Error:"), import_chalk.default.yellow(`${message}`));
97
- process.exit(1);
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
- if (cachedPath) return cachedPath;
104
- const existingPaths = await Promise.all(defaultPaths.map(path => (0, import_fs_extra.pathExists)(path)));
105
- const existing = existingPaths.findIndex(x => !!x);
106
- const found = defaultPaths[existing];
107
- if (!found) {
108
- throw new Error(`No found tamagui.config.ts`);
109
- }
110
- cachedPath = found;
111
- return found;
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
- const {
115
- loadTamagui: loadTamaguiStatic
116
- } = require("@tamagui/static/loadTamagui");
117
- const loaded = await loadTamaguiStatic({
118
- components: ["tamagui"],
119
- ...opts,
120
- config: opts.config ?? (await getDefaultTamaguiConfigPath())
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
- disposers.add(cb);
110
+ disposers.add(cb);
127
111
  }
128
112
  function disposeAll() {
129
- disposers.forEach(cb => cb());
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": "2.7.7",
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/create-theme": "2.7.7",
30
- "@tamagui/generate-themes": "2.7.7",
31
- "@tamagui/static": "2.7.7",
32
- "@tamagui/types": "2.7.7",
33
- "@tamagui/vite-plugin": "2.7.7",
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
- "esbuild": "^0.27.2",
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": "^15.1.0",
48
- "typescript": "~5.9.2",
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": "2.7.7",
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"