@multiplatform.one/utils 0.1.1 → 0.1.7

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.
@@ -6,5 +6,6 @@ interface LookupTamaguiModulesOptions {
6
6
  }
7
7
  declare function lookupTranspileModules(packageDirs?: string[], { log }?: LookupTranspileModulesOptions): any[];
8
8
  declare function lookupTamaguiModules(packageDirs?: string[], { log }?: LookupTamaguiModulesOptions): any[];
9
+ declare function resolveConfig(keys?: Record<string, any>): any;
9
10
 
10
- export { type LookupTamaguiModulesOptions, type LookupTranspileModulesOptions, lookupTamaguiModules, lookupTranspileModules };
11
+ export { type LookupTamaguiModulesOptions, type LookupTranspileModulesOptions, lookupTamaguiModules, lookupTranspileModules, resolveConfig };
@@ -5,7 +5,7 @@
5
5
  throw Error('Dynamic require of "' + x + '" is not supported');
6
6
  });
7
7
 
8
- // src/transpileModules.ts
8
+ // src/build.ts
9
9
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
10
10
  var logger = console;
11
11
  var projectRoot = __require.resolve("react/package.json").slice(0, -32);
@@ -46,7 +46,17 @@ function lookupTamaguiModules(packageDirs, { log = true } = {}) {
46
46
  if (log) logger.debug("tamaguiModules:", tamaguiModules.join(", "));
47
47
  return tamaguiModules;
48
48
  }
49
+ function resolveConfig(keys = {}) {
50
+ return keys.reduce(
51
+ (acc, key) => {
52
+ if (process.env[key]) acc[key] = process.env[key];
53
+ return acc;
54
+ },
55
+ {}
56
+ );
57
+ }
58
+
49
59
 
50
60
 
51
61
 
52
- exports.lookupTamaguiModules = lookupTamaguiModules; exports.lookupTranspileModules = lookupTranspileModules;
62
+ exports.lookupTamaguiModules = lookupTamaguiModules; exports.lookupTranspileModules = lookupTranspileModules; exports.resolveConfig = resolveConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/utils",
3
- "version": "0.1.1",
3
+ "version": "0.1.7",
4
4
  "description": "utilities for multiplatform.one",
5
5
  "sideEffects": false,
6
6
  "keywords": [
@@ -24,12 +24,15 @@
24
24
  "import": "./lib/index.js",
25
25
  "require": "./lib/index.js"
26
26
  },
27
- "./transpileModules": {
28
- "import": "./lib/transpileModules.js",
29
- "require": "./lib/transpileModules.js"
27
+ "./build": {
28
+ "import": "./lib/build.js",
29
+ "require": "./lib/build.js"
30
30
  },
31
31
  "./package.json": "./package.json"
32
32
  },
33
+ "scripts": {
34
+ "build": "tsup"
35
+ },
33
36
  "files": [
34
37
  "bin",
35
38
  "lib",
@@ -43,12 +46,12 @@
43
46
  "devDependencies": {
44
47
  "@types/node": "~20.12.13",
45
48
  "tsup": "^8.3.0",
46
- "typescript": "~5.3.3"
49
+ "typescript": "^5.6.2"
47
50
  },
48
51
  "engines": {
49
52
  "node": ">=6.0.0"
50
53
  },
51
- "scripts": {
52
- "build": "tsup"
54
+ "dependencies": {
55
+ "yaml": "^2.6.0"
53
56
  }
54
- }
57
+ }
@@ -78,3 +78,13 @@ export function lookupTamaguiModules(
78
78
  if (log) logger.debug("tamaguiModules:", tamaguiModules.join(", "));
79
79
  return tamaguiModules;
80
80
  }
81
+
82
+ export function resolveConfig(keys: Record<string, any> = {}) {
83
+ return keys.reduce(
84
+ (acc: Record<string, any>, key: string) => {
85
+ if (process.env[key]) acc[key] = process.env[key];
86
+ return acc;
87
+ },
88
+ {} as Record<string, any>,
89
+ );
90
+ }
@@ -1,22 +0,0 @@
1
- /*
2
- * File: /transpileModules/index.d.ts
3
- * Project: @multiplatform.one/utils
4
- * File Created: 16-06-2024 14:28:33
5
- * Author: Clay Risser
6
- * -----
7
- * BitSpur (c) Copyright 2021 - 2024
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
-
22
- export * from "../lib/transpileModules";
@@ -1,22 +0,0 @@
1
- /*
2
- * File: /transpileModules/index.js
3
- * Project: @multiplatform.one/utils
4
- * File Created: 16-06-2024 14:28:33
5
- * Author: Clay Risser
6
- * -----
7
- * BitSpur (c) Copyright 2021 - 2024
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
-
22
- export * from "../lib/transpileModules.js";