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