@tamagui/cli 1.114.4 → 1.115.0
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 +93 -0
- package/dist/add.cjs.map +6 -0
- package/dist/add.native.js +0 -2
- package/dist/add.native.js.map +2 -2
- package/dist/build.cjs +86 -0
- package/dist/cli.cjs +232 -0
- package/dist/{cli.js.map → cli.cjs.map} +1 -1
- package/dist/cli.native.js +3 -3
- package/dist/cli.native.js.map +1 -1
- package/dist/generate.cjs +63 -0
- package/dist/index.cjs +2 -0
- package/dist/{update-template.js → update-template.cjs} +29 -28
- package/dist/update.cjs +26 -0
- package/dist/{utils.js → utils.cjs} +45 -32
- package/package.json +10 -10
- package/src/add.ts +0 -2
- package/src/cli.ts +3 -3
- package/types/add.d.ts.map +1 -1
- package/dist/add.js +0 -93
- package/dist/add.js.map +0 -6
- package/dist/build.js +0 -75
- package/dist/cli.js +0 -199
- package/dist/generate.js +0 -62
- package/dist/index.js +0 -3
- package/dist/update.js +0 -22
- /package/dist/{build.js.map → build.cjs.map} +0 -0
- /package/dist/{generate.js.map → generate.cjs.map} +0 -0
- /package/dist/{index.js.map → index.cjs.map} +0 -0
- /package/dist/{update-template.js.map → update-template.cjs.map} +0 -0
- /package/dist/{update.js.map → update.cjs.map} +0 -0
- /package/dist/{utils.js.map → utils.cjs.map} +0 -0
|
@@ -2,56 +2,57 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf,
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
7
|
var __export = (target, all) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
15
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
21
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
22
|
// file that has been converted to a CommonJS file using a Babel-
|
|
18
23
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
24
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
23
32
|
var update_template_exports = {};
|
|
24
33
|
__export(update_template_exports, {
|
|
25
34
|
updateTemplate: () => updateTemplate
|
|
26
35
|
});
|
|
27
36
|
module.exports = __toCommonJS(update_template_exports);
|
|
28
|
-
var import_chalk = __toESM(require("chalk")),
|
|
37
|
+
var import_chalk = __toESM(require("chalk")),
|
|
38
|
+
import_child_process = require("child_process");
|
|
29
39
|
function updateTemplate(templateUrl, ignoredPatterns = []) {
|
|
30
|
-
const remoteName = `${templateUrl.split("/").pop()?.split(".")[0] || "template"}-template`,
|
|
40
|
+
const remoteName = `${templateUrl.split("/").pop()?.split(".")[0] || "template"}-template`,
|
|
41
|
+
addRemoteCommand = `git remote add ${remoteName} ${templateUrl}`,
|
|
42
|
+
rmRemoteCommand = `git remote remove ${remoteName}`;
|
|
31
43
|
try {
|
|
32
44
|
(0, import_child_process.execSync)(addRemoteCommand);
|
|
33
45
|
} catch (error) {
|
|
34
|
-
if (error instanceof Error && error.toString().includes("already exists"))
|
|
35
|
-
(0, import_child_process.execSync)(rmRemoteCommand), (0, import_child_process.execSync)(addRemoteCommand);
|
|
36
|
-
else
|
|
37
|
-
throw error;
|
|
46
|
+
if (error instanceof Error && error.toString().includes("already exists")) (0, import_child_process.execSync)(rmRemoteCommand), (0, import_child_process.execSync)(addRemoteCommand);else throw error;
|
|
38
47
|
}
|
|
39
48
|
(0, import_child_process.execSync)("git fetch --all");
|
|
40
49
|
try {
|
|
41
50
|
(0, import_child_process.execSync)("git merge takeout-template/main --allow-unrelated-histories");
|
|
42
51
|
} catch (error) {
|
|
43
|
-
if (error instanceof Error && error.message.includes("unresolved conflict"))
|
|
44
|
-
console.info(
|
|
45
|
-
tamaguiLog(
|
|
46
|
-
"We've merged the latest changes. Please resolve the conflicts and commit the merge."
|
|
47
|
-
)
|
|
48
|
-
);
|
|
49
|
-
else
|
|
50
|
-
throw error;
|
|
52
|
+
if (error instanceof Error && error.message.includes("unresolved conflict")) console.info(tamaguiLog("We've merged the latest changes. Please resolve the conflicts and commit the merge."));else throw error;
|
|
51
53
|
}
|
|
52
54
|
(0, import_child_process.execSync)(`git reset HEAD ${ignoredPatterns.join(" ")}`);
|
|
53
55
|
}
|
|
54
56
|
function tamaguiLog(message) {
|
|
55
57
|
return `${import_chalk.default.green("[Tamagui]")} ${message}`;
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=update-template.js.map
|
|
58
|
+
}
|
package/dist/update.cjs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var update_exports = {};
|
|
22
|
+
__export(update_exports, {
|
|
23
|
+
update: () => update
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(update_exports);
|
|
26
|
+
const update = async () => {};
|
|
@@ -2,24 +2,33 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf,
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
7
|
var __export = (target, all) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
15
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
21
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
22
|
// file that has been converted to a CommonJS file using a Babel-
|
|
18
23
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
24
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
23
32
|
var utils_exports = {};
|
|
24
33
|
__export(utils_exports, {
|
|
25
34
|
disposeAll: () => disposeAll,
|
|
@@ -29,7 +38,10 @@ __export(utils_exports, {
|
|
|
29
38
|
registerDispose: () => registerDispose
|
|
30
39
|
});
|
|
31
40
|
module.exports = __toCommonJS(utils_exports);
|
|
32
|
-
var import_static = require("@tamagui/static"),
|
|
41
|
+
var import_static = require("@tamagui/static"),
|
|
42
|
+
import_chalk = __toESM(require("chalk")),
|
|
43
|
+
import_fs_extra = __toESM(require("fs-extra")),
|
|
44
|
+
import_node_path = require("node:path");
|
|
33
45
|
async function getOptions({
|
|
34
46
|
root = process.cwd(),
|
|
35
47
|
tsconfigPath = "tsconfig.json",
|
|
@@ -41,17 +53,18 @@ async function getOptions({
|
|
|
41
53
|
const tsConfigFilePath = (0, import_node_path.join)(root, tsconfigPath);
|
|
42
54
|
ensure(await import_fs_extra.default.pathExists(tsConfigFilePath), `No tsconfig found: ${tsConfigFilePath}`);
|
|
43
55
|
const dotDir = (0, import_node_path.join)(root, ".tamagui");
|
|
44
|
-
let pkgJson = {},
|
|
56
|
+
let pkgJson = {},
|
|
57
|
+
config = "";
|
|
45
58
|
try {
|
|
46
59
|
config = await getDefaultTamaguiConfigPath(), pkgJson = await (0, import_fs_extra.readJSON)((0, import_node_path.join)(root, "package.json"));
|
|
47
|
-
} catch {
|
|
48
|
-
}
|
|
60
|
+
} catch {}
|
|
49
61
|
const filledOptions = {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
62
|
+
platform: "native",
|
|
63
|
+
components: ["tamagui"],
|
|
64
|
+
config,
|
|
65
|
+
...tamaguiOptions
|
|
66
|
+
},
|
|
67
|
+
finalOptions = loadTamaguiOptions ? (0, import_static.loadTamaguiBuildConfigSync)(filledOptions) : filledOptions;
|
|
55
68
|
return {
|
|
56
69
|
mode: process.env.NODE_ENV === "production" ? "production" : "development",
|
|
57
70
|
root,
|
|
@@ -75,20 +88,20 @@ const defaultPaths = ["tamagui.config.ts", (0, import_node_path.join)("src", "ta
|
|
|
75
88
|
let cachedPath = "";
|
|
76
89
|
async function getDefaultTamaguiConfigPath() {
|
|
77
90
|
if (cachedPath) return cachedPath;
|
|
78
|
-
const existing = (await Promise.all(defaultPaths.map(
|
|
79
|
-
|
|
80
|
-
|
|
91
|
+
const existing = (await Promise.all(defaultPaths.map(path => (0, import_fs_extra.pathExists)(path)))).findIndex(x => !!x),
|
|
92
|
+
found = defaultPaths[existing];
|
|
93
|
+
if (!found) throw new Error("No found tamagui.config.ts");
|
|
81
94
|
return cachedPath = found, found;
|
|
82
95
|
}
|
|
83
|
-
const loadTamagui = async
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}),
|
|
96
|
+
const loadTamagui = async opts => await (0, import_static.loadTamagui)({
|
|
97
|
+
components: ["tamagui"],
|
|
98
|
+
...opts,
|
|
99
|
+
config: opts.config ?? (await getDefaultTamaguiConfigPath())
|
|
100
|
+
}),
|
|
101
|
+
disposers = /* @__PURE__ */new Set();
|
|
88
102
|
function registerDispose(cb) {
|
|
89
103
|
disposers.add(cb);
|
|
90
104
|
}
|
|
91
105
|
function disposeAll() {
|
|
92
|
-
disposers.forEach(
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=utils.js.map
|
|
106
|
+
disposers.forEach(cb => cb());
|
|
107
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.115.0",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
|
-
"main": "dist",
|
|
6
|
+
"main": "dist/index.cjs",
|
|
7
7
|
"bin": {
|
|
8
|
-
"tama": "./dist/index.
|
|
9
|
-
"tamagui": "./dist/index.
|
|
8
|
+
"tama": "./dist/index.cjs",
|
|
9
|
+
"tamagui": "./dist/index.cjs"
|
|
10
10
|
},
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"clean:build": "tamagui-build clean:build"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@tamagui/create-theme": "1.
|
|
27
|
-
"@tamagui/generate-themes": "1.
|
|
28
|
-
"@tamagui/static": "1.
|
|
29
|
-
"@tamagui/types": "1.
|
|
30
|
-
"@tamagui/vite-plugin": "1.
|
|
26
|
+
"@tamagui/create-theme": "1.115.0",
|
|
27
|
+
"@tamagui/generate-themes": "1.115.0",
|
|
28
|
+
"@tamagui/static": "1.115.0",
|
|
29
|
+
"@tamagui/types": "1.115.0",
|
|
30
|
+
"@tamagui/vite-plugin": "1.115.0",
|
|
31
31
|
"arg": "^5.0.2",
|
|
32
32
|
"chalk": "^4.1.2",
|
|
33
33
|
"change-case": "^4.1.2",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"vite-plugin-entry-shaking": "^0.4.3"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@tamagui/build": "1.
|
|
57
|
+
"@tamagui/build": "1.115.0",
|
|
58
58
|
"@types/chokidar": "^2.1.3",
|
|
59
59
|
"@types/marked": "^5.0.0"
|
|
60
60
|
}
|
package/src/add.ts
CHANGED
package/src/cli.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import arg from 'arg'
|
|
2
2
|
import chalk from 'chalk'
|
|
3
3
|
|
|
4
|
-
import { generatedPackageTypes } from './add
|
|
4
|
+
import { generatedPackageTypes } from './add'
|
|
5
5
|
import { disposeAll, getOptions } from './utils'
|
|
6
6
|
import { loadTamagui, checkDeps } from '@tamagui/static'
|
|
7
7
|
|
|
@@ -101,7 +101,7 @@ const COMMAND_MAP = {
|
|
|
101
101
|
},
|
|
102
102
|
async run() {
|
|
103
103
|
const { _, ...flags } = arg(this.flags)
|
|
104
|
-
const { installGeneratedPackage } = require('./add
|
|
104
|
+
const { installGeneratedPackage } = require('./add')
|
|
105
105
|
const [cmd, type, path] = _
|
|
106
106
|
// const options = await getOptions({
|
|
107
107
|
// debug: flags['--debug'] ? (flags['--verbose'] ? 'verbose' : true) : false,
|
|
@@ -124,7 +124,7 @@ const COMMAND_MAP = {
|
|
|
124
124
|
async run() {
|
|
125
125
|
const { _, ...flags } = arg(this.flags)
|
|
126
126
|
const [_command, dir] = _
|
|
127
|
-
const imported = await import('./build
|
|
127
|
+
const imported = await import('./build')
|
|
128
128
|
const options = await getOptions({
|
|
129
129
|
debug: flags['--debug'] ? (flags['--verbose'] ? 'verbose' : true) : false,
|
|
130
130
|
})
|
package/types/add.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../src/add.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../src/add.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,qBAAqB,2BAA4B,CAAA;AAC9D,eAAO,MAAM,uBAAuB,SAAgB,MAAM,iBAAiB,MAAM,kBAqGhF,CAAA"}
|
package/dist/add.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
-
mod
|
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
-
var add_exports = {};
|
|
24
|
-
__export(add_exports, {
|
|
25
|
-
generatedPackageTypes: () => generatedPackageTypes,
|
|
26
|
-
installGeneratedPackage: () => installGeneratedPackage
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(add_exports);
|
|
29
|
-
var import_node_child_process = require("node:child_process"), import_node_fs = require("node:fs"), import_promises = require("node:fs/promises"), import_node_os = require("node:os"), import_node_path = __toESM(require("node:path")), import_chalk = __toESM(require("chalk")), import_change_case = require("change-case"), import_fs_extra = require("fs-extra"), import_marked = require("marked"), import_marked_terminal = __toESM(require("marked-terminal")), import_opener = __toESM(require("opener")), import_prompts = __toESM(require("prompts"));
|
|
30
|
-
import_marked.marked.setOptions({
|
|
31
|
-
headerIds: !1,
|
|
32
|
-
mangle: !1,
|
|
33
|
-
renderer: new import_marked_terminal.default()
|
|
34
|
-
});
|
|
35
|
-
const home = (0, import_node_os.homedir)(), tamaguiDir = import_node_path.default.join(home, ".tamagui"), generatedPackageTypes = ["font", "icon"], installGeneratedPackage = async (type, packagesPath) => {
|
|
36
|
-
if (packagesPath = packagesPath || import_node_path.default.join(process.cwd(), "packages"), !generatedPackageTypes.includes(type))
|
|
37
|
-
throw new Error(
|
|
38
|
-
`${type ? `Type "${type}" is Not supported.` : "No type provided."} Supported types: ${generatedPackageTypes.join(", ")}`
|
|
39
|
-
);
|
|
40
|
-
const repoName = type === "font" ? "tamagui-google-fonts" : "tamagui-iconify";
|
|
41
|
-
console.info(`Setting up ${import_chalk.default.blueBright(tamaguiDir)}...`), await (0, import_fs_extra.ensureDir)(tamaguiDir);
|
|
42
|
-
const tempDir = import_node_path.default.join(tamaguiDir, repoName);
|
|
43
|
-
(0, import_node_fs.existsSync)(tempDir) && (0, import_node_fs.rmSync)(tempDir, { recursive: !0 });
|
|
44
|
-
try {
|
|
45
|
-
process.chdir(tamaguiDir);
|
|
46
|
-
try {
|
|
47
|
-
console.info("Attempting to clone with SSH"), (0, import_node_child_process.execSync)(
|
|
48
|
-
`git clone -n --depth=1 --branch generated --filter=tree:0 git@github.com:tamagui/${repoName}.git`
|
|
49
|
-
);
|
|
50
|
-
} catch {
|
|
51
|
-
console.info("SSH failed - Attempting to c lone with HTTPS"), (0, import_node_child_process.execSync)(
|
|
52
|
-
`git clone -n --depth=1 --branch generated --filter=tree:0 https://github.com/tamagui/${repoName}`
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
process.chdir(tempDir), (0, import_node_child_process.execSync)(["git sparse-checkout set --no-cone meta", "git checkout"].join(" && "));
|
|
56
|
-
} catch (error) {
|
|
57
|
-
if (error instanceof Error)
|
|
58
|
-
throw error?.stderr.includes("Repository not found") && (console.info(
|
|
59
|
-
import_chalk.default.yellow(
|
|
60
|
-
`You don't have access to Tamagui ${type === "font" ? "fonts" : "icons"}. Check \u{1F961} Tamagui Takeout (https://tamagui.dev/takeout) for more info.`
|
|
61
|
-
)
|
|
62
|
-
), (0, import_opener.default)("https://tamagui.dev/takeout"), process.exit(0)), error;
|
|
63
|
-
}
|
|
64
|
-
const meta = JSON.parse(
|
|
65
|
-
await (0, import_promises.readFile)(import_node_path.default.join(tamaguiDir, repoName, "meta", "data.json")).then(
|
|
66
|
-
(r) => r.toString()
|
|
67
|
-
)
|
|
68
|
-
);
|
|
69
|
-
console.info(
|
|
70
|
-
import_chalk.default.gray(
|
|
71
|
-
"Use \u21E7/\u21E9 to navigate. Use tab to cycle the result. Use Page Up/Page Down (on Mac: fn + \u21E7 / \u21E9) to change page. Hit enter to select the highlighted item below the prompt."
|
|
72
|
-
)
|
|
73
|
-
);
|
|
74
|
-
const result = await (0, import_prompts.default)({
|
|
75
|
-
name: "packageName",
|
|
76
|
-
type: "autocomplete",
|
|
77
|
-
message: type === "icon" ? "Pick an icon pack:" : type === "font" ? "Pick a font:" : "Pick one:",
|
|
78
|
-
choices: Object.entries(meta).map(([slug, data]) => ({
|
|
79
|
-
title: type === "font" ? `${slug}: ${data.weights.length} weights, ${data.styles.length} styles, ${data.subsets.length} subsets (https://fonts.google.com/specimen/${(0, import_change_case.pascalCase)(slug)})` : `${data.name}: ${data.total} icons, ${data.license.title} license (${data.author.url})`,
|
|
80
|
-
value: slug
|
|
81
|
-
}))
|
|
82
|
-
}), packageName = `${type}-${result.packageName}`, packageDir = import_node_path.default.join(tempDir, "packages", packageName);
|
|
83
|
-
process.chdir(tempDir), (0, import_node_child_process.execSync)(
|
|
84
|
-
[`git sparse-checkout set --no-cone packages/${packageName}`, "git checkout"].join(
|
|
85
|
-
" && "
|
|
86
|
-
)
|
|
87
|
-
);
|
|
88
|
-
const finalDir = import_node_path.default.join(packagesPath, packageName);
|
|
89
|
-
await (0, import_fs_extra.ensureDir)(packagesPath), await (0, import_fs_extra.copy)(packageDir, finalDir), console.info(), console.info(import_chalk.default.green(`Created the package under ${finalDir}`)), console.info();
|
|
90
|
-
const readmePath = import_node_path.default.join(finalDir, "README.md");
|
|
91
|
-
(0, import_node_fs.existsSync)(readmePath) && console.info(import_marked.marked.parse((0, import_fs_extra.readFileSync)(readmePath).toString()));
|
|
92
|
-
};
|
|
93
|
-
//# sourceMappingURL=add.js.map
|
package/dist/add.js.map
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/add.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAAyB,+BACzB,iBAAmC,oBACnC,kBAAyB,6BACzB,iBAAwB,oBACxB,mBAAiB,+BAEjB,eAAkB,2BAClB,qBAA2B,wBAC3B,kBAA8C,qBAC9C,gBAAuB,mBACvB,yBAA6B,qCAC7B,gBAAiB,4BACjB,iBAAoB;AAEpB,qBAAO,WAAW;AAAA,EAChB,WAAW;AAAA,EACX,QAAQ;AAAA,EAC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UAAM,8BAAa,UAAU,EAAE,SAAS,CAAC,CAAC;AAElE;",
|
|
5
|
-
"names": ["TerminalRenderer", "path", "chalk", "open", "prompts"]
|
|
6
|
-
}
|
package/dist/build.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
-
mod
|
|
22
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
-
var build_exports = {};
|
|
24
|
-
__export(build_exports, {
|
|
25
|
-
build: () => build
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(build_exports);
|
|
28
|
-
var import_node_path = require("node:path"), import_static = require("@tamagui/static"), import_chokidar = __toESM(require("chokidar")), import_fs_extra = require("fs-extra"), import_micromatch = __toESM(require("micromatch"));
|
|
29
|
-
const build = async (options) => {
|
|
30
|
-
const sourceDir = options.dir ?? ".", promises = [], buildOptions = (0, import_static.loadTamaguiBuildConfigSync)(options.tamaguiOptions), platform = options.target ?? "web";
|
|
31
|
-
process.env.TAMAGUI_TARGET = platform;
|
|
32
|
-
const tamaguiOptions = {
|
|
33
|
-
...buildOptions,
|
|
34
|
-
platform
|
|
35
|
-
};
|
|
36
|
-
await (0, import_static.loadTamagui)(tamaguiOptions), await new Promise((res) => {
|
|
37
|
-
import_chokidar.default.watch(`${sourceDir}/**/*.tsx`, {
|
|
38
|
-
// persistent: true,
|
|
39
|
-
}).on("add", (relativePath) => {
|
|
40
|
-
if (options.exclude && import_micromatch.default.contains(relativePath, options.exclude) || options.include && !import_micromatch.default.contains(relativePath, options.include))
|
|
41
|
-
return;
|
|
42
|
-
const sourcePath = (0, import_node_path.resolve)(process.cwd(), relativePath);
|
|
43
|
-
console.info(` [tamagui] optimizing ${sourcePath}`), promises.push(
|
|
44
|
-
(async () => {
|
|
45
|
-
options.debug && (process.env.NODE_ENV ||= "development");
|
|
46
|
-
const source = await (0, import_fs_extra.readFile)(sourcePath, "utf-8");
|
|
47
|
-
if (platform === "web") {
|
|
48
|
-
const extractor = (0, import_static.createExtractor)({
|
|
49
|
-
platform
|
|
50
|
-
}), out2 = await (0, import_static.extractToClassNames)({
|
|
51
|
-
extractor,
|
|
52
|
-
source,
|
|
53
|
-
sourcePath,
|
|
54
|
-
options: buildOptions,
|
|
55
|
-
shouldPrintDebug: options.debug || !1
|
|
56
|
-
});
|
|
57
|
-
if (!out2)
|
|
58
|
-
return;
|
|
59
|
-
const cssName = "_" + (0, import_node_path.basename)(sourcePath, (0, import_node_path.extname)(sourcePath)), stylePath = (0, import_node_path.join)((0, import_node_path.dirname)(sourcePath), cssName + ".css"), code = `import "./${cssName}.css"
|
|
60
|
-
${out2.js}`;
|
|
61
|
-
await Promise.all([
|
|
62
|
-
(0, import_fs_extra.writeFile)(sourcePath, code, "utf-8"),
|
|
63
|
-
(0, import_fs_extra.writeFile)(stylePath, out2.styles, "utf-8")
|
|
64
|
-
]);
|
|
65
|
-
}
|
|
66
|
-
const out = (0, import_static.extractToNative)(sourcePath, source, tamaguiOptions);
|
|
67
|
-
await (0, import_fs_extra.writeFile)(sourcePath, out.code, "utf-8");
|
|
68
|
-
})()
|
|
69
|
-
);
|
|
70
|
-
}).on("ready", () => {
|
|
71
|
-
res();
|
|
72
|
-
});
|
|
73
|
-
}), await Promise.all(promises);
|
|
74
|
-
};
|
|
75
|
-
//# sourceMappingURL=build.js.map
|