@multiplatform.one/utils 0.0.24 → 0.1.1

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.
@@ -19,7 +19,9 @@ function lookupTranspileModules(packageDirs, { log = true } = {}) {
19
19
  _path2.default.resolve(projectRoot, "packages", "ui"),
20
20
  ...packageDirs || []
21
21
  ])
22
- ].map((packageDir) => __require(`${packageDir}/package.json`).transpileModules || [])
22
+ ].map(
23
+ (packageDir) => __require(`${packageDir}/package.json`).transpileModules || []
24
+ )
23
25
  )
24
26
  ].flat();
25
27
  if (log) logger.debug("transpileModules:", transpileModules.join(", "));
@@ -36,7 +38,9 @@ function lookupTamaguiModules(packageDirs, { log = true } = {}) {
36
38
  _path2.default.resolve(projectRoot, "packages", "ui"),
37
39
  ...packageDirs || []
38
40
  ])
39
- ].map((packageDir) => __require(`${packageDir}/package.json`).tamaguiModules || [])
41
+ ].map(
42
+ (packageDir) => __require(`${packageDir}/package.json`).tamaguiModules || []
43
+ )
40
44
  ])
41
45
  ].flat();
42
46
  if (log) logger.debug("tamaguiModules:", tamaguiModules.join(", "));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/utils",
3
- "version": "0.0.24",
3
+ "version": "0.1.1",
4
4
  "description": "utilities for multiplatform.one",
5
5
  "sideEffects": false,
6
6
  "keywords": [
@@ -21,14 +21,12 @@
21
21
  "types": "lib/index.d.ts",
22
22
  "exports": {
23
23
  ".": {
24
- "require": "./lib/index.js",
25
- "types": "./lib/index.d.ts",
26
- "import": "./lib/index.js"
24
+ "import": "./lib/index.js",
25
+ "require": "./lib/index.js"
27
26
  },
28
27
  "./transpileModules": {
29
- "require": "./lib/transpileModules.js",
30
- "types": "./lib/transpileModules.d.ts",
31
- "import": "./lib/transpileModules.js"
28
+ "import": "./lib/transpileModules.js",
29
+ "require": "./lib/transpileModules.js"
32
30
  },
33
31
  "./package.json": "./package.json"
34
32
  },
@@ -44,15 +42,12 @@
44
42
  },
45
43
  "devDependencies": {
46
44
  "@types/node": "~20.12.13",
47
- "tsup": "^8.1.0",
45
+ "tsup": "^8.3.0",
48
46
  "typescript": "~5.3.3"
49
47
  },
50
48
  "engines": {
51
49
  "node": ">=6.0.0"
52
50
  },
53
- "eslintIgnore": [
54
- "lib"
55
- ],
56
51
  "scripts": {
57
52
  "build": "tsup"
58
53
  }
package/src/index.ts CHANGED
@@ -19,4 +19,4 @@
19
19
  * limitations under the License.
20
20
  */
21
21
 
22
- export {};
22
+ export type {};
@@ -19,10 +19,10 @@
19
19
  * limitations under the License.
20
20
  */
21
21
 
22
- import path from 'path';
22
+ import path from "node:path";
23
23
 
24
24
  const logger = console;
25
- const projectRoot = require.resolve('react/package.json').slice(0, -32);
25
+ const projectRoot = require.resolve("react/package.json").slice(0, -32);
26
26
 
27
27
  export interface LookupTranspileModulesOptions {
28
28
  log?: boolean;
@@ -32,37 +32,49 @@ export interface LookupTamaguiModulesOptions {
32
32
  log?: boolean;
33
33
  }
34
34
 
35
- export function lookupTranspileModules(packageDirs?: string[], { log = true }: LookupTranspileModulesOptions = {}) {
35
+ export function lookupTranspileModules(
36
+ packageDirs?: string[],
37
+ { log = true }: LookupTranspileModulesOptions = {},
38
+ ) {
36
39
  const transpileModules = [
37
40
  ...new Set(
38
41
  [
39
42
  ...new Set([
40
43
  projectRoot,
41
- path.resolve(projectRoot, 'app'),
42
- path.resolve(projectRoot, 'packages', 'ui'),
44
+ path.resolve(projectRoot, "app"),
45
+ path.resolve(projectRoot, "packages", "ui"),
43
46
  ...(packageDirs || []),
44
47
  ]),
45
- ].map((packageDir) => require(`${packageDir}/package.json`).transpileModules || []),
48
+ ].map(
49
+ (packageDir) =>
50
+ require(`${packageDir}/package.json`).transpileModules || [],
51
+ ),
46
52
  ),
47
53
  ].flat();
48
- if (log) logger.debug('transpileModules:', transpileModules.join(', '));
54
+ if (log) logger.debug("transpileModules:", transpileModules.join(", "));
49
55
  return transpileModules;
50
56
  }
51
57
 
52
- export function lookupTamaguiModules(packageDirs?: string[], { log = true }: LookupTamaguiModulesOptions = {}) {
58
+ export function lookupTamaguiModules(
59
+ packageDirs?: string[],
60
+ { log = true }: LookupTamaguiModulesOptions = {},
61
+ ) {
53
62
  const tamaguiModules = [
54
63
  ...new Set([
55
- 'tamagui',
64
+ "tamagui",
56
65
  ...[
57
66
  ...new Set([
58
67
  projectRoot,
59
- path.resolve(projectRoot, 'app'),
60
- path.resolve(projectRoot, 'packages', 'ui'),
68
+ path.resolve(projectRoot, "app"),
69
+ path.resolve(projectRoot, "packages", "ui"),
61
70
  ...(packageDirs || []),
62
71
  ]),
63
- ].map((packageDir) => require(`${packageDir}/package.json`).tamaguiModules || []),
72
+ ].map(
73
+ (packageDir) =>
74
+ require(`${packageDir}/package.json`).tamaguiModules || [],
75
+ ),
64
76
  ]),
65
77
  ].flat();
66
- if (log) logger.debug('tamaguiModules:', tamaguiModules.join(', '));
78
+ if (log) logger.debug("tamaguiModules:", tamaguiModules.join(", "));
67
79
  return tamaguiModules;
68
80
  }
@@ -19,4 +19,4 @@
19
19
  * limitations under the License.
20
20
  */
21
21
 
22
- export * from '../lib/transpileModules';
22
+ export * from "../lib/transpileModules";
@@ -19,4 +19,4 @@
19
19
  * limitations under the License.
20
20
  */
21
21
 
22
- export * from '../lib/transpileModules.js';
22
+ export * from "../lib/transpileModules.js";