@tamagui/cli 1.139.3 → 1.139.4
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/package.json +7 -7
- package/dist/add.native.js +0 -104
- package/dist/add.native.js.map +0 -1
- package/dist/build.native.js +0 -163
- package/dist/build.native.js.map +0 -1
- package/dist/cli.native.js +0 -252
- package/dist/cli.native.js.map +0 -1
- package/dist/generate-prompt.native.js +0 -578
- package/dist/generate-prompt.native.js.map +0 -1
- package/dist/generate.native.js +0 -77
- package/dist/generate.native.js.map +0 -1
- package/dist/index.native.js +0 -5
- package/dist/index.native.js.map +0 -1
- package/dist/update-template.native.js +0 -67
- package/dist/update-template.native.js.map +0 -1
- package/dist/update.native.js +0 -29
- package/dist/update.native.js.map +0 -1
- package/dist/utils.native.js +0 -120
- package/dist/utils.native.js.map +0 -1
package/dist/generate.native.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf,
|
|
9
|
-
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __export = (target, all) => {
|
|
11
|
-
for (var name in all) __defProp(target, name, {
|
|
12
|
-
get: all[name],
|
|
13
|
-
enumerable: !0
|
|
14
|
-
});
|
|
15
|
-
},
|
|
16
|
-
__copyProps = (to, from, except, desc) => {
|
|
17
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
18
|
-
get: () => from[key],
|
|
19
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
-
});
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
29
|
-
value: mod,
|
|
30
|
-
enumerable: !0
|
|
31
|
-
}) : target, mod)),
|
|
32
|
-
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
33
|
-
value: !0
|
|
34
|
-
}), mod);
|
|
35
|
-
var generate_exports = {};
|
|
36
|
-
__export(generate_exports, {
|
|
37
|
-
generateTypes: () => generateTypes,
|
|
38
|
-
getTypes: () => getTypes
|
|
39
|
-
});
|
|
40
|
-
module.exports = __toCommonJS(generate_exports);
|
|
41
|
-
var import_fs_extra = __toESM(require("fs-extra")),
|
|
42
|
-
import_ts_morph = require("ts-morph"),
|
|
43
|
-
import_utils = require("./utils.native.js");
|
|
44
|
-
async function generateTypes(options) {
|
|
45
|
-
var types = await getTypes(options);
|
|
46
|
-
await import_fs_extra.default.writeJSON(options.paths.types, types, {
|
|
47
|
-
spaces: 2
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
async function getTypes(options) {
|
|
51
|
-
var tamagui = await (0, import_utils.loadTamagui)(options.tamaguiOptions);
|
|
52
|
-
if (!tamagui) throw new Error("No tamagui config");
|
|
53
|
-
var nameToPaths = tamagui.nameToPaths || [],
|
|
54
|
-
uniqueViewExportingPaths = new Set(Object.keys(nameToPaths).map(function (name) {
|
|
55
|
-
return `${[...nameToPaths[name]][0]}.ts*`;
|
|
56
|
-
})),
|
|
57
|
-
project = new import_ts_morph.Project({
|
|
58
|
-
compilerOptions: {
|
|
59
|
-
noEmit: !1,
|
|
60
|
-
declaration: !0,
|
|
61
|
-
emitDeclarationOnly: !0
|
|
62
|
-
},
|
|
63
|
-
skipAddingFilesFromTsConfig: !0,
|
|
64
|
-
tsConfigFilePath: options.tsconfigPath
|
|
65
|
-
}),
|
|
66
|
-
files = project.addSourceFilesAtPaths([...uniqueViewExportingPaths]);
|
|
67
|
-
return Object.fromEntries(files.flatMap(function (x) {
|
|
68
|
-
return [...x.getExportedDeclarations()].map(function (param) {
|
|
69
|
-
var [k, v] = param;
|
|
70
|
-
return [k, v[0].getType().getApparentType().getProperties().map(function (prop) {
|
|
71
|
-
var _prop_getValueDeclaration;
|
|
72
|
-
return [prop.getEscapedName(), (_prop_getValueDeclaration = prop.getValueDeclaration()) === null || _prop_getValueDeclaration === void 0 ? void 0 : _prop_getValueDeclaration.getType().getText()];
|
|
73
|
-
})];
|
|
74
|
-
});
|
|
75
|
-
}));
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=generate.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","generate_exports","__export","generateTypes","getTypes","module","exports","import_fs_extra","__toESM","require","import_ts_morph","import_utils","options","types","default","writeJSON","paths","spaces","tamagui","loadTamagui","tamaguiOptions","Error","nameToPaths","uniqueViewExportingPaths","Set","Object","keys","map","name","project","Project","compilerOptions","noEmit","declaration","emitDeclarationOnly","skipAddingFilesFromTsConfig","tsConfigFilePath","tsconfigPath","files","addSourceFilesAtPaths","fromEntries","flatMap","x","getExportedDeclarations","param","k","v"],"sources":["../src/generate.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;IAAAC,KAAA;EAAA,IAAAH,GAAA;AAAA,IAAAI,gBAAA;AAAAC,QAAA,CAAAD,gBAAA;EAAAE,aAAA,EAAAA,CAAA,KAAAA,aAAA;EAAAC,QAAA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js
DELETED
package/dist/index.native.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":";AAEA,YAAQ","ignoreList":[]}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf,
|
|
8
|
-
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all) __defProp(target, name, {
|
|
11
|
-
get: all[name],
|
|
12
|
-
enumerable: !0
|
|
13
|
-
});
|
|
14
|
-
},
|
|
15
|
-
__copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
17
|
-
get: () => from[key],
|
|
18
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
-
});
|
|
20
|
-
return to;
|
|
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: !0
|
|
30
|
-
}) : target, mod)),
|
|
31
|
-
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
-
value: !0
|
|
33
|
-
}), mod);
|
|
34
|
-
var update_template_exports = {};
|
|
35
|
-
__export(update_template_exports, {
|
|
36
|
-
updateTemplate: () => updateTemplate
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(update_template_exports);
|
|
39
|
-
var import_chalk = __toESM(require("chalk")),
|
|
40
|
-
import_child_process = require("child_process");
|
|
41
|
-
function _instanceof(left, right) {
|
|
42
|
-
return right != null && typeof Symbol < "u" && right[Symbol.hasInstance] ? !!right[Symbol.hasInstance](left) : left instanceof right;
|
|
43
|
-
}
|
|
44
|
-
function updateTemplate(templateUrl) {
|
|
45
|
-
var ignoredPatterns = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [],
|
|
46
|
-
_templateUrl_split_pop,
|
|
47
|
-
templateName = ((_templateUrl_split_pop = templateUrl.split("/").pop()) === null || _templateUrl_split_pop === void 0 ? void 0 : _templateUrl_split_pop.split(".")[0]) || "template",
|
|
48
|
-
remoteName = `${templateName}-template`,
|
|
49
|
-
addRemoteCommand = `git remote add ${remoteName} ${templateUrl}`,
|
|
50
|
-
rmRemoteCommand = `git remote remove ${remoteName}`;
|
|
51
|
-
try {
|
|
52
|
-
(0, import_child_process.execSync)(addRemoteCommand);
|
|
53
|
-
} catch (error) {
|
|
54
|
-
if (_instanceof(error, Error) && error.toString().includes("already exists")) (0, import_child_process.execSync)(rmRemoteCommand), (0, import_child_process.execSync)(addRemoteCommand);else throw error;
|
|
55
|
-
}
|
|
56
|
-
(0, import_child_process.execSync)("git fetch --all");
|
|
57
|
-
try {
|
|
58
|
-
(0, import_child_process.execSync)("git merge takeout-template/main --allow-unrelated-histories");
|
|
59
|
-
} catch (error) {
|
|
60
|
-
if (_instanceof(error, 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;
|
|
61
|
-
}
|
|
62
|
-
(0, import_child_process.execSync)(`git reset HEAD ${ignoredPatterns.join(" ")}`);
|
|
63
|
-
}
|
|
64
|
-
function tamaguiLog(message) {
|
|
65
|
-
return `${import_chalk.default.green("[Tamagui]")} ${message}`;
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=update-template.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","update_template_exports","__export","updateTemplate","module","exports","import_chalk","__toESM","require","import_child_process","_instanceof","left","right","Symbol","hasInstance","templateUrl","ignoredPatterns","arguments","length","_templateUrl_split_pop","templateName","split","pop","remoteName","addRemoteCommand","rmRemoteCommand","execSync","error","Error","toString","includes","message","console","info","tamaguiLog","join","default","green"],"sources":["../src/update-template.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;IAAAC,KAAA;EAAA,IAAAH,GAAA;AAAA,IAAAI,uBAAA;AAAAC,QAAA,CAAAD,uBAAA;EAAAE,cAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAkB,CAAAK,uBAClB;AAEO,IAAAK,YAAS,GAAAC,OAAe,CAAAC,OAAA,QAAqB;EAAAC,oBAAgC,GAAAD,OAAA;AAElF,SAAME,YAAaC,IADE,EAAAC,KAAA;EAIrB,OAAIA,KAAA,mBAAAC,MAAA,UAAAD,KAAA,CAAAC,MAAA,CAAAC,WAAA,MAAAF,KAAA,CAAAC,MAAA,CAAAC,WAAA,EAAAH,IAAA,IAAAA,IAAA,YAAAC,KAAA;AACF;AAAyB,SAC3BT,cAAgBA,CAAAY,WAAA;EACd,IAAAC,eAAI,GAAAC,SAAiB,CAASC,MAAM,QAAAD,SAAW,GAAS,cAAAA,SAAgB;IAAAE,sBAAA;IAAAC,YAAA,KAAAD,sBAAA,GAAAJ,WAAA,CAAAM,KAAA,MAAAC,GAAA,gBAAAH,sBAAA,uBAAAA,sBAAA,CAAAE,KAAA;IAAAE,UAAA,MAAAH,YAAA;IAAAI,gBAAA,qBAAAD,UAAA,IAAAR,WAAA;IAAAU,eAAA,wBAAAF,UAAA;EACtE;IACyB,IAAAd,oBAAA,CAAAiB,QAAA,EAAAF,gBAAA;EAEzB,SAAAG,KAAM;IAEV,IAAAjB,WAAA,CAAAiB,KAAA,EAAAC,KAAA,KAAAD,KAAA,CAAAE,QAAA,GAAAC,QAAA,oBACA,IAAArB,oBAAA,CAAAiB,QAAA,EAAAD,eAAS,GAAiB,IAAAhB,oBAAA,CAAAiB,QAAA,EAAAF,gBAAA,OAExB,MAAAG,KAAA;EACF;EACE,IAAAlB,oBAAqB,CAAAiB,QAAS,mBAAc;EAC1C;IAAQ,IACNjB,oBAAA,CAAAiB,QAAA;EAAA,SACEC,KAAA;IAAA,IACFjB,WAAA,CAAAiB,KAAA,EAAAC,KAAA,KAAAD,KAAA,CAAAI,OAAA,CAAAD,QAAA,yBACFE,OAAA,CAAAC,IAAA,CAAAC,UAAA,8FAEA,MAAMP,KAAA;EAEV;EACA,IAAAlB,oBAAA,CAAAiB,QAAA,oBAASV,eAAkB,CAAAmB,IAAA,CAAgB,MAAK;AAClD;AAEA,SAASD,WAAWH,OAAA,EAAS;EAC3B,OAAO,GAAGzB,YAAA,CAAA8B,OAAA,CAAMC,KAAA,CAAM,WAAW,CAAC,IAAIN,OAAO;AAC/C","ignoreList":[]}
|
package/dist/update.native.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
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
|
-
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: !0
|
|
22
|
-
}), mod);
|
|
23
|
-
var update_exports = {};
|
|
24
|
-
__export(update_exports, {
|
|
25
|
-
update: () => update
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(update_exports);
|
|
28
|
-
var update = async function () {};
|
|
29
|
-
//# sourceMappingURL=update.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","update_exports","__export","update","module","exports"],"sources":["../src/update.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,cAAA;AAAAC,QAAA,CAAAD,cAAA;EAAAE,MAAA,EAAAA,CAAA,KAAAA;AAAA;AAAOC,MAAM,CAAAC,OAAA,GAAST,YAAY,CAAAK,cAAA;AAElC,IAAAE,MAAA,kBAAAA,CAAA,G","ignoreList":[]}
|
package/dist/utils.native.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf,
|
|
8
|
-
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all) __defProp(target, name, {
|
|
11
|
-
get: all[name],
|
|
12
|
-
enumerable: !0
|
|
13
|
-
});
|
|
14
|
-
},
|
|
15
|
-
__copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
17
|
-
get: () => from[key],
|
|
18
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
-
});
|
|
20
|
-
return to;
|
|
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: !0
|
|
30
|
-
}) : target, mod)),
|
|
31
|
-
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
-
value: !0
|
|
33
|
-
}), mod);
|
|
34
|
-
var utils_exports = {};
|
|
35
|
-
__export(utils_exports, {
|
|
36
|
-
disposeAll: () => disposeAll,
|
|
37
|
-
ensure: () => ensure,
|
|
38
|
-
getOptions: () => getOptions,
|
|
39
|
-
loadTamagui: () => loadTamagui,
|
|
40
|
-
registerDispose: () => registerDispose
|
|
41
|
-
});
|
|
42
|
-
module.exports = __toCommonJS(utils_exports);
|
|
43
|
-
var import_static = require("@tamagui/static"),
|
|
44
|
-
import_chalk = __toESM(require("chalk")),
|
|
45
|
-
import_fs_extra = require("fs-extra"),
|
|
46
|
-
import_path = require("path");
|
|
47
|
-
async function getOptions() {
|
|
48
|
-
var {
|
|
49
|
-
root = process.cwd(),
|
|
50
|
-
tsconfigPath = "tsconfig.json",
|
|
51
|
-
tamaguiOptions,
|
|
52
|
-
host,
|
|
53
|
-
debug,
|
|
54
|
-
loadTamaguiOptions
|
|
55
|
-
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {},
|
|
56
|
-
dotDir = (0, import_path.join)(root, ".tamagui"),
|
|
57
|
-
pkgJson = {},
|
|
58
|
-
config = "";
|
|
59
|
-
try {
|
|
60
|
-
config = await getDefaultTamaguiConfigPath(), pkgJson = await (0, import_fs_extra.readJSON)((0, import_path.join)(root, "package.json"));
|
|
61
|
-
} catch {}
|
|
62
|
-
var filledOptions = {
|
|
63
|
-
platform: "native",
|
|
64
|
-
components: ["tamagui"],
|
|
65
|
-
config,
|
|
66
|
-
...tamaguiOptions
|
|
67
|
-
},
|
|
68
|
-
finalOptions = loadTamaguiOptions ? (0, import_static.loadTamaguiBuildConfigSync)(filledOptions) : filledOptions;
|
|
69
|
-
return {
|
|
70
|
-
mode: process.env.NODE_ENV === "production" ? "production" : "development",
|
|
71
|
-
root,
|
|
72
|
-
host: host || "127.0.0.1",
|
|
73
|
-
pkgJson,
|
|
74
|
-
debug,
|
|
75
|
-
tsconfigPath,
|
|
76
|
-
tamaguiOptions: finalOptions,
|
|
77
|
-
paths: {
|
|
78
|
-
root,
|
|
79
|
-
dotDir,
|
|
80
|
-
conf: (0, import_path.join)(dotDir, "tamagui.config.json"),
|
|
81
|
-
types: (0, import_path.join)(dotDir, "types.json")
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
function ensure(condition, message) {
|
|
86
|
-
condition || (console.error(import_chalk.default.red.bold("Error:"), import_chalk.default.yellow(`${message}`)), process.exit(1));
|
|
87
|
-
}
|
|
88
|
-
var defaultPaths = ["tamagui.config.ts", (0, import_path.join)("src", "tamagui.config.ts")],
|
|
89
|
-
cachedPath = "";
|
|
90
|
-
async function getDefaultTamaguiConfigPath() {
|
|
91
|
-
if (cachedPath) return cachedPath;
|
|
92
|
-
var existingPaths = await Promise.all(defaultPaths.map(function (path) {
|
|
93
|
-
return (0, import_fs_extra.pathExists)(path);
|
|
94
|
-
})),
|
|
95
|
-
existing = existingPaths.findIndex(function (x) {
|
|
96
|
-
return !!x;
|
|
97
|
-
}),
|
|
98
|
-
found = defaultPaths[existing];
|
|
99
|
-
if (!found) throw new Error("No found tamagui.config.ts");
|
|
100
|
-
return cachedPath = found, found;
|
|
101
|
-
}
|
|
102
|
-
var loadTamagui = async function (opts) {
|
|
103
|
-
var _opts_config,
|
|
104
|
-
loaded = await (0, import_static.loadTamagui)({
|
|
105
|
-
components: ["tamagui"],
|
|
106
|
-
...opts,
|
|
107
|
-
config: (_opts_config = opts.config) !== null && _opts_config !== void 0 ? _opts_config : await getDefaultTamaguiConfigPath()
|
|
108
|
-
});
|
|
109
|
-
return loaded;
|
|
110
|
-
},
|
|
111
|
-
disposers = /* @__PURE__ */new Set();
|
|
112
|
-
function registerDispose(cb) {
|
|
113
|
-
disposers.add(cb);
|
|
114
|
-
}
|
|
115
|
-
function disposeAll() {
|
|
116
|
-
disposers.forEach(function (cb) {
|
|
117
|
-
return cb();
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=utils.native.js.map
|
package/dist/utils.native.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","utils_exports","__export","disposeAll","ensure","getOptions","loadTamagui","registerDispose","module","exports","import_static","require","import_chalk","__toESM","import_fs_extra","import_path","root","process","cwd","tsconfigPath","tamaguiOptions","host","debug","loadTamaguiOptions","arguments","length","dotDir","join","pkgJson","config","getDefaultTamaguiConfigPath","readJSON","filledOptions","platform","components","finalOptions","loadTamaguiBuildConfigSync","mode","env","NODE_ENV","paths","conf","types","condition","message","console","error","default","red","bold","yellow","exit","defaultPaths","cachedPath","existingPaths","Promise","all","map","path","pathExists","existing","findIndex","x","found","Error","opts","_opts_config","loaded","disposers","Set"],"sources":["../src/utils.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;IAAAC,KAAA;EAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,UAAA,EAAAA,CAAA,KAAAA,UAAA;EAAAC,MAAA,EAAAA,CAAA,KAAAA,MAAA;EAAAC,UAAA,EAAAA,CAAA,KAAAA,UAAA;EAAAC,WAAA,EAAAA,CAAA,KAAAA,WAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAA;AAAA;AACAC,MAAA,CAAAC,OAAA,GAAAb,YAGO,CAAAK,aAAA;AAMP,IAAAS,aAAsB,GAAAC,OAAW;EAAAC,YAAA,GAAAC,OAAA,CAAAF,OAAA;EAAAG,eAAA,GAAAH,OAAA;EAAAI,WAAA,GAAAJ,OAAA;AAAA,eACxBN,UAAYA,CAAA;EACnB;MAAAW,IAAA,GAAAC,OAAe,CAAAC,GAAA;MAAAC,YAAA;MAAAC,cAAA;MAAAC,IAAA;MAAAC,KAAA;MAAAC;IAAA,IAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,iBAAAA,SAAA;IAAAE,MAAA,OAAAX,WAAA,CAAAY,IAAA,EAAAX,IAAA;IAAAY,OAAA;IAAAC,MAAA;EACf;IACAA,MAAA,SAAAC,2BAAA,IAAAF,OAAA,aAAAd,eAAA,CAAAiB,QAAA,MAAAhB,WAAA,CAAAY,IAAA,EAAAX,IAAA;EACA,SACA;EACF,IAA8BgB,aAAgC;MAC5DC,QAAM,UAAS;MACfC,UAAI,EAAU,CAEV,UACF;MAEFL,MAAQ;MAER,GAAAT;IAEA;IAAAe,YAAM,GAAAZ,kBAAgB,OAAAb,aAAA,CAAA0B,0BAAA,EAAAJ,aAAA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