@tamagui/helpers-node 2.0.0-rc.3 → 2.0.0-rc.30
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/index.js +13 -10
- package/package.json +3 -3
- package/types/getDefaultTamaguiOptions.d.ts.map +2 -2
- package/types/getTamaguiDefaultPath.d.ts.map +2 -2
- package/types/getTamaguiOptions.d.ts.map +2 -2
- package/types/index.d.ts.map +2 -2
- package/types/readTamaguiOptions.d.ts.map +2 -2
- package/dist/getDefaultTamaguiOptions.js +0 -30
- package/dist/getDefaultTamaguiOptions.js.map +0 -6
- package/dist/getTamaguiDefaultPath.js +0 -35
- package/dist/getTamaguiDefaultPath.js.map +0 -6
- package/dist/getTamaguiOptions.js +0 -26
- package/dist/getTamaguiOptions.js.map +0 -6
- package/dist/readTamaguiOptions.js +0 -46
- package/dist/readTamaguiOptions.js.map +0 -6
package/dist/index.js
CHANGED
|
@@ -3,15 +3,18 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
7
|
+
get: () => from[key],
|
|
8
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
9
|
+
});
|
|
10
|
+
return to;
|
|
11
|
+
},
|
|
12
|
+
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
13
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
14
|
+
value: !0
|
|
15
|
+
}), mod);
|
|
12
16
|
var index_exports = {};
|
|
13
17
|
module.exports = __toCommonJS(index_exports);
|
|
14
|
-
__reExport(index_exports, require("./readTamaguiOptions"), module.exports);
|
|
15
|
-
__reExport(index_exports, require("./getTamaguiDefaultPath"), module.exports);
|
|
16
|
-
__reExport(index_exports, require("./getTamaguiOptions"), module.exports);
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
|
18
|
+
__reExport(index_exports, require("./readTamaguiOptions.cjs"), module.exports);
|
|
19
|
+
__reExport(index_exports, require("./getTamaguiDefaultPath.cjs"), module.exports);
|
|
20
|
+
__reExport(index_exports, require("./getTamaguiOptions.cjs"), module.exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/helpers-node",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.30",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"clean:build": "tamagui-build clean:build"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@tamagui/types": "2.0.0-rc.
|
|
23
|
+
"@tamagui/types": "2.0.0-rc.30"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@tamagui/build": "2.0.0-rc.
|
|
26
|
+
"@tamagui/build": "2.0.0-rc.30",
|
|
27
27
|
"fs-extra": "^11.2.0"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/getDefaultTamaguiOptions.ts"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
9
|
"import type { TamaguiOptions } from '@tamagui/types'\n\nimport { getDefaultTamaguiConfigPath } from './getTamaguiDefaultPath'\n\nexport async function getDefaultTamaguiOptions({\n cwd = '.',\n}: {\n cwd: string\n}): Promise<TamaguiOptions> {\n return {\n platform: 'native',\n components: ['tamagui'],\n config: await getDefaultTamaguiConfigPath({ cwd }),\n }\n}\n"
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
10
|
+
]
|
|
11
11
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/getTamaguiDefaultPath.ts"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
9
|
"import { join } from 'node:path'\n\nimport { pathExists } from 'fs-extra'\n\nlet cachedPath = ''\n\nexport async function getDefaultTamaguiConfigPath({\n cwd = '.',\n cache = true,\n}: {\n cwd?: string\n // TODO this isn't passed down / could avoid\n cache?: boolean\n}): Promise<string> {\n if (cache && cachedPath) {\n return cachedPath\n }\n\n const defaultPaths = ['tamagui.config.ts', join('src', 'tamagui.config.ts')].map((p) =>\n join(cwd, p)\n )\n const existing = (\n await Promise.all(defaultPaths.map((path) => pathExists(path)))\n ).findIndex((x) => !!x)\n const found = defaultPaths[existing]\n if (!found) {\n throw new Error(`No found tamagui.config.ts`)\n }\n\n cachedPath = found\n return found\n}\n"
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
10
|
+
]
|
|
11
11
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/getTamaguiOptions.ts"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
9
|
"import { readTamaguiOptions } from './readTamaguiOptions'\n\nexport async function getTamaguiOptions({\n cwd = '.',\n}: {\n cwd?: string\n}): Promise<import('@tamagui/types/types').TamaguiOptions> {\n return (await readTamaguiOptions({ cwd })).options\n}\n"
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
10
|
+
]
|
|
11
11
|
}
|
package/types/index.d.ts.map
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"sources": [
|
|
5
5
|
"src/readTamaguiOptions.ts"
|
|
6
6
|
],
|
|
7
|
+
"version": 3,
|
|
7
8
|
"sourcesContent": [
|
|
8
9
|
"import { join } from 'node:path'\n\nimport type { TamaguiOptions } from '@tamagui/types'\nimport { pathExists, readJSON } from 'fs-extra'\n\nimport { getDefaultTamaguiOptions } from './getDefaultTamaguiOptions'\n\nexport async function readTamaguiOptions({ cwd = '.' }: { cwd: string }): Promise<{\n exists: boolean\n options: TamaguiOptions\n}> {\n const filePath = join(cwd, 'tamagui.json')\n\n if (!(await pathExists(filePath))) {\n return {\n exists: false,\n options: await getDefaultTamaguiOptions({ cwd }),\n }\n }\n\n try {\n const options = (await readJSON(filePath)) as TamaguiOptions\n\n if (!Array.isArray(options.components)) {\n throw new Error(`Invalid components: not string[]`)\n }\n\n return {\n exists: true,\n options: {\n ...(!options.config && (await getDefaultTamaguiOptions({ cwd }))),\n ...options,\n },\n }\n } catch (err: any) {\n console.error(`Error reading tamagui.json: ${err.message} ${err.stack}`)\n\n return {\n exists: false,\n options: await getDefaultTamaguiOptions({ cwd }),\n }\n }\n}\n"
|
|
9
|
-
]
|
|
10
|
-
"version": 3
|
|
10
|
+
]
|
|
11
11
|
}
|
|
@@ -1,30 +0,0 @@
|
|
|
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
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/getDefaultTamaguiOptions.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mCAA4C;AAE5C,eAAsB,yBAAyB;AAAA,EAC7C,MAAM;AACR,GAE4B;AAC1B,SAAO;AAAA,IACL,UAAU;AAAA,IACV,YAAY,CAAC,SAAS;AAAA,IACtB,QAAQ,UAAM,0DAA4B,EAAE,IAAI,CAAC;AAAA,EACnD;AACF;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
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_node_path = require("node: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_node_path.join)("src", "tamagui.config.ts")].map(
|
|
29
|
-
(p) => (0, import_node_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
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/getTamaguiDefaultPath.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAqB,sBAErB,kBAA2B;AAE3B,IAAI,aAAa;AAEjB,eAAsB,4BAA4B;AAAA,EAChD,MAAM;AAAA,EACN,QAAQ;AACV,GAIoB;AAClB,MAAI,SAAS;AACX,WAAO;AAGT,QAAM,eAAe,CAAC,yBAAqB,uBAAK,OAAO,mBAAmB,CAAC,EAAE;AAAA,IAAI,CAAC,UAChF,uBAAK,KAAK,CAAC;AAAA,EACb,GACM,YACJ,MAAM,QAAQ,IAAI,aAAa,IAAI,CAAC,aAAS,4BAAW,IAAI,CAAC,CAAC,GAC9D,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,GAChB,QAAQ,aAAa,QAAQ;AACnC,MAAI,CAAC;AACH,UAAM,IAAI,MAAM,4BAA4B;AAG9C,sBAAa,OACN;AACT;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
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({
|
|
22
|
-
cwd = "."
|
|
23
|
-
}) {
|
|
24
|
-
return (await (0, import_readTamaguiOptions.readTamaguiOptions)({ cwd })).options;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=getTamaguiOptions.js.map
|
|
@@ -1,46 +0,0 @@
|
|
|
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_node_path = require("node:path"), import_fs_extra = require("fs-extra"), import_getDefaultTamaguiOptions = require("./getDefaultTamaguiOptions");
|
|
21
|
-
async function readTamaguiOptions({ cwd = "." }) {
|
|
22
|
-
const filePath = (0, import_node_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
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/readTamaguiOptions.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAqB,sBAGrB,kBAAqC,qBAErC,kCAAyC;AAEzC,eAAsB,mBAAmB,EAAE,MAAM,IAAI,GAGlD;AACD,QAAM,eAAW,uBAAK,KAAK,cAAc;AAEzC,MAAI,CAAE,UAAM,4BAAW,QAAQ;AAC7B,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,SAAS,UAAM,0DAAyB,EAAE,IAAI,CAAC;AAAA,IACjD;AAGF,MAAI;AACF,UAAM,UAAW,UAAM,0BAAS,QAAQ;AAExC,QAAI,CAAC,MAAM,QAAQ,QAAQ,UAAU;AACnC,YAAM,IAAI,MAAM,kCAAkC;AAGpD,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,SAAS;AAAA,QACP,GAAI,CAAC,QAAQ,UAAW,UAAM,0DAAyB,EAAE,IAAI,CAAC;AAAA,QAC9D,GAAG;AAAA,MACL;AAAA,IACF;AAAA,EACF,SAAS,KAAU;AACjB,mBAAQ,MAAM,+BAA+B,IAAI,OAAO,IAAI,IAAI,KAAK,EAAE,GAEhE;AAAA,MACL,QAAQ;AAAA,MACR,SAAS,UAAM,0DAAyB,EAAE,IAAI,CAAC;AAAA,IACjD;AAAA,EACF;AACF;",
|
|
5
|
-
"names": []
|
|
6
|
-
}
|