@tamagui/helpers-node 1.116.1 → 1.116.3

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.
@@ -0,0 +1,30 @@
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)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var getDefaultTamaguiOptions_exports = {};
16
+ __export(getDefaultTamaguiOptions_exports, {
17
+ getDefaultTamaguiOptions: () => getDefaultTamaguiOptions
18
+ });
19
+ module.exports = __toCommonJS(getDefaultTamaguiOptions_exports);
20
+ var import_getTamaguiDefaultPath = require("./getTamaguiDefaultPath");
21
+ async function getDefaultTamaguiOptions({
22
+ cwd = "."
23
+ }) {
24
+ return {
25
+ platform: "native",
26
+ components: ["tamagui"],
27
+ config: await (0, import_getTamaguiDefaultPath.getDefaultTamaguiConfigPath)({ cwd })
28
+ };
29
+ }
30
+ //# sourceMappingURL=getDefaultTamaguiOptions.js.map
@@ -0,0 +1,35 @@
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)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var getTamaguiDefaultPath_exports = {};
16
+ __export(getTamaguiDefaultPath_exports, {
17
+ getDefaultTamaguiConfigPath: () => getDefaultTamaguiConfigPath
18
+ });
19
+ module.exports = __toCommonJS(getTamaguiDefaultPath_exports);
20
+ var import_path = require("path"), import_fs_extra = require("fs-extra");
21
+ let cachedPath = "";
22
+ async function getDefaultTamaguiConfigPath({
23
+ cwd = ".",
24
+ cache = !0
25
+ }) {
26
+ if (cache && cachedPath)
27
+ return cachedPath;
28
+ const defaultPaths = ["tamagui.config.ts", (0, import_path.join)("src", "tamagui.config.ts")].map(
29
+ (p) => (0, import_path.join)(cwd, p)
30
+ ), existing = (await Promise.all(defaultPaths.map((path) => (0, import_fs_extra.pathExists)(path)))).findIndex((x) => !!x), found = defaultPaths[existing];
31
+ if (!found)
32
+ throw new Error("No found tamagui.config.ts");
33
+ return cachedPath = found, found;
34
+ }
35
+ //# sourceMappingURL=getTamaguiDefaultPath.js.map
@@ -0,0 +1,24 @@
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)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var getTamaguiOptions_exports = {};
16
+ __export(getTamaguiOptions_exports, {
17
+ getTamaguiOptions: () => getTamaguiOptions
18
+ });
19
+ module.exports = __toCommonJS(getTamaguiOptions_exports);
20
+ var import_readTamaguiOptions = require("./readTamaguiOptions");
21
+ async function getTamaguiOptions({ cwd = "." }) {
22
+ return (await (0, import_readTamaguiOptions.readTamaguiOptions)({ cwd })).options;
23
+ }
24
+ //# sourceMappingURL=getTamaguiOptions.js.map
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from == "object" || typeof from == "function")
7
+ for (let key of __getOwnPropNames(from))
8
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
+ return to;
10
+ }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
11
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
+ var src_exports = {};
13
+ module.exports = __toCommonJS(src_exports);
14
+ __reExport(src_exports, require("./readTamaguiOptions"), module.exports);
15
+ __reExport(src_exports, require("./getTamaguiDefaultPath"), module.exports);
16
+ __reExport(src_exports, require("./getTamaguiOptions"), module.exports);
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,46 @@
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)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var readTamaguiOptions_exports = {};
16
+ __export(readTamaguiOptions_exports, {
17
+ readTamaguiOptions: () => readTamaguiOptions
18
+ });
19
+ module.exports = __toCommonJS(readTamaguiOptions_exports);
20
+ var import_path = require("path"), import_fs_extra = require("fs-extra"), import_getDefaultTamaguiOptions = require("./getDefaultTamaguiOptions");
21
+ async function readTamaguiOptions({ cwd = "." }) {
22
+ const filePath = (0, import_path.join)(cwd, "tamagui.json");
23
+ if (!await (0, import_fs_extra.pathExists)(filePath))
24
+ return {
25
+ exists: !1,
26
+ options: await (0, import_getDefaultTamaguiOptions.getDefaultTamaguiOptions)({ cwd })
27
+ };
28
+ try {
29
+ const options = await (0, import_fs_extra.readJSON)(filePath);
30
+ if (!Array.isArray(options.components))
31
+ throw new Error("Invalid components: not string[]");
32
+ return {
33
+ exists: !0,
34
+ options: {
35
+ ...!options.config && await (0, import_getDefaultTamaguiOptions.getDefaultTamaguiOptions)({ cwd }),
36
+ ...options
37
+ }
38
+ };
39
+ } catch (err) {
40
+ return console.error(`Error reading tamagui.json: ${err.message} ${err.stack}`), {
41
+ exists: !1,
42
+ options: await (0, import_getDefaultTamaguiOptions.getDefaultTamaguiOptions)({ cwd })
43
+ };
44
+ }
45
+ }
46
+ //# sourceMappingURL=readTamaguiOptions.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/helpers-node",
3
- "version": "1.116.1",
3
+ "version": "1.116.3",
4
4
  "source": "src/index.ts",
5
5
  "types": "./types/index.d.ts",
6
6
  "main": "./dist",
@@ -16,10 +16,10 @@
16
16
  "clean:build": "tamagui-build clean:build"
17
17
  },
18
18
  "dependencies": {
19
- "@tamagui/types": "1.116.1"
19
+ "@tamagui/types": "1.116.3"
20
20
  },
21
21
  "devDependencies": {
22
- "@tamagui/build": "1.116.1",
22
+ "@tamagui/build": "1.116.3",
23
23
  "fs-extra": "^11.2.0"
24
24
  },
25
25
  "publishConfig": {
File without changes