@tamagui/helpers-node 1.14.0 → 1.14.2
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/getDefaultTamaguiOptions.js +36 -1
- package/dist/getDefaultTamaguiOptions.js.map +2 -2
- package/dist/getTamaguiDefaultPath.js +48 -1
- package/dist/getTamaguiDefaultPath.js.map +2 -2
- package/dist/getTamaguiOptions.js +31 -1
- package/dist/getTamaguiOptions.js.map +2 -2
- package/dist/index.js +20 -1
- package/dist/index.js.map +2 -2
- package/dist/readTamaguiOptions.js +58 -1
- package/dist/readTamaguiOptions.js.map +2 -2
- package/package.json +3 -3
|
@@ -1,2 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var getDefaultTamaguiOptions_exports = {};
|
|
20
|
+
__export(getDefaultTamaguiOptions_exports, {
|
|
21
|
+
getDefaultTamaguiOptions: () => getDefaultTamaguiOptions
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(getDefaultTamaguiOptions_exports);
|
|
24
|
+
var import_getTamaguiDefaultPath = require("./getTamaguiDefaultPath");
|
|
25
|
+
async function getDefaultTamaguiOptions({
|
|
26
|
+
cwd = "."
|
|
27
|
+
}) {
|
|
28
|
+
return {
|
|
29
|
+
components: ["tamagui"],
|
|
30
|
+
config: await (0, import_getTamaguiDefaultPath.getDefaultTamaguiConfigPath)({ cwd })
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
getDefaultTamaguiOptions
|
|
36
|
+
});
|
|
2
37
|
//# sourceMappingURL=getDefaultTamaguiOptions.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/getDefaultTamaguiOptions.ts"],
|
|
4
4
|
"sourcesContent": ["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 components: ['tamagui'],\n config: await getDefaultTamaguiConfigPath({ cwd }),\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mCAA4C;AAE5C,eAAsB,yBAAyB;AAAA,EAC7C,MAAM;AACR,GAE4B;AAC1B,SAAO;AAAA,IACL,YAAY,CAAC,SAAS;AAAA,IACtB,QAAQ,UAAM,0DAA4B,EAAE,IAAI,CAAC;AAAA,EACnD;AACF;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,49 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var getTamaguiDefaultPath_exports = {};
|
|
20
|
+
__export(getTamaguiDefaultPath_exports, {
|
|
21
|
+
getDefaultTamaguiConfigPath: () => getDefaultTamaguiConfigPath
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(getTamaguiDefaultPath_exports);
|
|
24
|
+
var import_path = require("path");
|
|
25
|
+
var import_fs_extra = require("fs-extra");
|
|
26
|
+
let cachedPath = "";
|
|
27
|
+
async function getDefaultTamaguiConfigPath({
|
|
28
|
+
cwd = ".",
|
|
29
|
+
cache = true
|
|
30
|
+
}) {
|
|
31
|
+
if (cache && cachedPath) {
|
|
32
|
+
return cachedPath;
|
|
33
|
+
}
|
|
34
|
+
const defaultPaths = ["tamagui.config.ts", (0, import_path.join)("src", "tamagui.config.ts")].map(
|
|
35
|
+
(p) => (0, import_path.join)(cwd, p)
|
|
36
|
+
);
|
|
37
|
+
const existing = (await Promise.all(defaultPaths.map((path) => (0, import_fs_extra.pathExists)(path)))).findIndex((x) => !!x);
|
|
38
|
+
const found = defaultPaths[existing];
|
|
39
|
+
if (!found) {
|
|
40
|
+
throw new Error(`No found tamagui.config.ts`);
|
|
41
|
+
}
|
|
42
|
+
cachedPath = found;
|
|
43
|
+
return found;
|
|
44
|
+
}
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
getDefaultTamaguiConfigPath
|
|
48
|
+
});
|
|
2
49
|
//# sourceMappingURL=getTamaguiDefaultPath.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/getTamaguiDefaultPath.ts"],
|
|
4
4
|
"sourcesContent": ["import { join } from '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}) {\n if (cache && cachedPath) {\n return cachedPath\n }\n\n const defaultPaths = ['tamagui.config.ts', join('src', 'tamagui.config.ts')].map(\n (p) => 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"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB;AAErB,sBAA2B;AAE3B,IAAI,aAAa;AAEjB,eAAsB,4BAA4B;AAAA,EAChD,MAAM;AAAA,EACN,QAAQ;AACV,GAIG;AACD,MAAI,SAAS,YAAY;AACvB,WAAO;AAAA,EACT;AAEA,QAAM,eAAe,CAAC,yBAAqB,kBAAK,OAAO,mBAAmB,CAAC,EAAE;AAAA,IAC3E,CAAC,UAAM,kBAAK,KAAK,CAAC;AAAA,EACpB;AACA,QAAM,YACJ,MAAM,QAAQ,IAAI,aAAa,IAAI,CAAC,aAAS,4BAAW,IAAI,CAAC,CAAC,GAC9D,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;AACtB,QAAM,QAAQ,aAAa,QAAQ;AACnC,MAAI,CAAC,OAAO;AACV,UAAM,IAAI,MAAM,4BAA4B;AAAA,EAC9C;AAEA,eAAa;AACb,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var getTamaguiOptions_exports = {};
|
|
20
|
+
__export(getTamaguiOptions_exports, {
|
|
21
|
+
getTamaguiOptions: () => getTamaguiOptions
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(getTamaguiOptions_exports);
|
|
24
|
+
var import_readTamaguiOptions = require("./readTamaguiOptions");
|
|
25
|
+
async function getTamaguiOptions({ cwd = "." }) {
|
|
26
|
+
return (await (0, import_readTamaguiOptions.readTamaguiOptions)({ cwd })).options;
|
|
27
|
+
}
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
getTamaguiOptions
|
|
31
|
+
});
|
|
2
32
|
//# sourceMappingURL=getTamaguiOptions.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/getTamaguiOptions.ts"],
|
|
4
4
|
"sourcesContent": ["import { readTamaguiOptions } from './readTamaguiOptions'\n\nexport async function getTamaguiOptions({ cwd = '.' }: { cwd?: string }) {\n return (await readTamaguiOptions({ cwd })).options\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAAmC;AAEnC,eAAsB,kBAAkB,EAAE,MAAM,IAAI,GAAqB;AACvE,UAAQ,UAAM,8CAAmB,EAAE,IAAI,CAAC,GAAG;AAC7C;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var src_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(src_exports);
|
|
18
|
+
__reExport(src_exports, require("./readTamaguiOptions"), module.exports);
|
|
19
|
+
__reExport(src_exports, require("./getTamaguiDefaultPath"), module.exports);
|
|
20
|
+
__reExport(src_exports, require("./getTamaguiOptions"), module.exports);
|
|
2
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["export * from './readTamaguiOptions'\nexport * from './getTamaguiDefaultPath'\nexport * from './getTamaguiOptions'\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,iCAAd;AACA,wBAAc,oCADd;AAEA,wBAAc,gCAFd;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,59 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var readTamaguiOptions_exports = {};
|
|
20
|
+
__export(readTamaguiOptions_exports, {
|
|
21
|
+
readTamaguiOptions: () => readTamaguiOptions
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(readTamaguiOptions_exports);
|
|
24
|
+
var import_path = require("path");
|
|
25
|
+
var import_fs_extra = require("fs-extra");
|
|
26
|
+
var import_getDefaultTamaguiOptions = require("./getDefaultTamaguiOptions");
|
|
27
|
+
async function readTamaguiOptions({ cwd = "." }) {
|
|
28
|
+
const filePath = (0, import_path.join)(cwd, "tamagui.json");
|
|
29
|
+
if (!await (0, import_fs_extra.pathExists)(filePath)) {
|
|
30
|
+
return {
|
|
31
|
+
exists: false,
|
|
32
|
+
options: await (0, import_getDefaultTamaguiOptions.getDefaultTamaguiOptions)({ cwd })
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
const options = await (0, import_fs_extra.readJSON)(filePath);
|
|
37
|
+
if (!Array.isArray(options.components)) {
|
|
38
|
+
throw new Error(`Invalid components: not string[]`);
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
exists: true,
|
|
42
|
+
options: {
|
|
43
|
+
...!options.config && await (0, import_getDefaultTamaguiOptions.getDefaultTamaguiOptions)({ cwd }),
|
|
44
|
+
...options
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
} catch (err) {
|
|
48
|
+
console.error(`Error reading tamagui.json: ${err.message} ${err.stack}`);
|
|
49
|
+
return {
|
|
50
|
+
exists: false,
|
|
51
|
+
options: await (0, import_getDefaultTamaguiOptions.getDefaultTamaguiOptions)({ cwd })
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
readTamaguiOptions
|
|
58
|
+
});
|
|
2
59
|
//# sourceMappingURL=readTamaguiOptions.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/readTamaguiOptions.ts"],
|
|
4
4
|
"sourcesContent": ["import { join } from '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 }) {\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 // eslint-disable-next-line no-console\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"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB;AAGrB,sBAAqC;AAErC,sCAAyC;AAEzC,eAAsB,mBAAmB,EAAE,MAAM,IAAI,GAAoB;AACvE,QAAM,eAAW,kBAAK,KAAK,cAAc;AAEzC,MAAI,CAAE,UAAM,4BAAW,QAAQ,GAAI;AACjC,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,SAAS,UAAM,0DAAyB,EAAE,IAAI,CAAC;AAAA,IACjD;AAAA,EACF;AAEA,MAAI;AACF,UAAM,UAAW,UAAM,0BAAS,QAAQ;AAExC,QAAI,CAAC,MAAM,QAAQ,QAAQ,UAAU,GAAG;AACtC,YAAM,IAAI,MAAM,kCAAkC;AAAA,IACpD;AAEA,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,KAAP;AAEA,YAAQ,MAAM,+BAA+B,IAAI,WAAW,IAAI,OAAO;AAEvE,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,SAAS,UAAM,0DAAyB,EAAE,IAAI,CAAC;AAAA,IACjD;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/helpers-node",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.2",
|
|
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.14.
|
|
19
|
+
"@tamagui/types": "1.14.2"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@tamagui/build": "1.14.
|
|
22
|
+
"@tamagui/build": "1.14.2",
|
|
23
23
|
"fs-extra": "^11.1.0"
|
|
24
24
|
},
|
|
25
25
|
"publishConfig": {
|