@tamagui/babel-plugin-fully-specified 2.0.0-1769665879528 → 2.0.0-1780064412517

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/commonjs.cjs ADDED
@@ -0,0 +1 @@
1
+ Object.assign(module.exports, require('./permanent/cjs/commonjs.js'))
package/package.json CHANGED
@@ -1,26 +1,21 @@
1
1
  {
2
2
  "name": "@tamagui/babel-plugin-fully-specified",
3
- "version": "2.0.0-1769665879528",
3
+ "version": "2.0.0-1780064412517",
4
+ "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
+ "license": "MIT",
4
6
  "source": "src/index.ts",
5
- "main": "permanent/cjs/index.js",
6
- "module": "permanent/esm/index.mjs",
7
7
  "files": [
8
8
  "src",
9
9
  "types",
10
- "permanent"
10
+ "permanent",
11
+ "commonjs.cjs"
11
12
  ],
12
- "license": "MIT",
13
- "publishConfig": {
14
- "access": "public"
15
- },
16
- "scripts": {
17
- "lint": "biome check src",
18
- "lint:fix": "biome check --write src",
19
- "test": "vitest --run"
20
- },
13
+ "main": "permanent/cjs/index.js",
14
+ "module": "permanent/esm/index.mjs",
21
15
  "exports": {
22
16
  ".": {
23
17
  "types": "./types/index.d.ts",
18
+ "browser": "./permanent/esm/index.mjs",
24
19
  "module": "./permanent/esm/index.mjs",
25
20
  "import": "./permanent/esm/index.mjs",
26
21
  "require": "./permanent/cjs/index.js",
@@ -28,17 +23,23 @@
28
23
  },
29
24
  "./commonjs": {
30
25
  "types": "./types/commonjs.d.ts",
26
+ "browser": "./permanent/esm/commonjs.mjs",
31
27
  "module": "./permanent/esm/commonjs.mjs",
32
28
  "import": "./permanent/esm/commonjs.mjs",
33
29
  "require": "./permanent/cjs/commonjs.js"
34
30
  }
35
31
  },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "scripts": {
36
+ "test": "vitest --run"
37
+ },
36
38
  "dependencies": {
37
39
  "@babel/core": "^7.25.2"
38
40
  },
39
41
  "devDependencies": {
40
42
  "@babel/types": "^7.25.4",
41
- "vitest": "^4.0.4"
42
- },
43
- "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14"
44
- }
43
+ "vitest": "4.0.4"
44
+ }
45
+ }
@@ -1,60 +1,88 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
1
+ var __defProp = Object.defineProperty
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor
3
+ var __getOwnPropNames = Object.getOwnPropertyNames
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty
5
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 commonjs_exports = {};
6
+ for (var name in all) __defProp(target, name, { get: all[name], enumerable: !0 })
7
+ },
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) &&
12
+ key !== except &&
13
+ __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
16
+ })
17
+ return to
18
+ }
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, '__esModule', { value: !0 }), mod)
20
+ var commonjs_exports = {}
16
21
  __export(commonjs_exports, {
17
- default: () => fullySpecifyCommonJS
18
- });
19
- module.exports = __toCommonJS(commonjs_exports);
20
- var import_node_fs = require("node:fs"), import_node_path = require("node:path");
22
+ default: () => fullySpecifyCommonJS,
23
+ })
24
+ module.exports = __toCommonJS(commonjs_exports)
25
+ var import_node_fs = require('node:fs'),
26
+ import_node_path = require('node:path')
21
27
  function fullySpecifyCommonJS(api, options) {
22
- return api.assertVersion(7), {
23
- name: "babel-plugin-fully-specified-cjs",
24
- visitor: {
25
- CallExpression(path, state) {
26
- if (path.get("callee").isIdentifier({ name: "require" }) && path.node.arguments.length === 1) {
27
- const arg = path.node.arguments[0];
28
- if (arg.type === "StringLiteral") {
29
- let moduleSpecifier = arg.value;
30
- if (moduleSpecifier.startsWith(".") || moduleSpecifier.startsWith("/")) {
31
- const filePath = state.file.opts.filename;
32
- if (!filePath) return;
33
- const fileDir = (0, import_node_path.dirname)(filePath), cjsExtension = options.esExtensionDefault || ".cjs", jsExtension = ".js";
34
- if (!(0, import_node_path.extname)(moduleSpecifier)) {
35
- const resolvedPath = (0, import_node_path.resolve)(fileDir, moduleSpecifier);
36
- let newModuleSpecifier = moduleSpecifier;
37
- if (isLocalDirectory(resolvedPath)) {
38
- const indexPath = (0, import_node_path.resolve)(resolvedPath, "index" + jsExtension);
39
- if ((0, import_node_fs.existsSync)(indexPath)) {
40
- newModuleSpecifier.endsWith("/") || (newModuleSpecifier += "/"), newModuleSpecifier += "index" + cjsExtension, arg.value = newModuleSpecifier;
41
- return;
28
+ return (
29
+ api.assertVersion(7),
30
+ {
31
+ name: 'babel-plugin-fully-specified-cjs',
32
+ visitor: {
33
+ CallExpression(path, state) {
34
+ if (
35
+ path.get('callee').isIdentifier({ name: 'require' }) &&
36
+ path.node.arguments.length === 1
37
+ ) {
38
+ const arg = path.node.arguments[0]
39
+ if (arg.type === 'StringLiteral') {
40
+ let moduleSpecifier = arg.value
41
+ if (moduleSpecifier.startsWith('.') || moduleSpecifier.startsWith('/')) {
42
+ const filePath = state.file.opts.filename
43
+ if (!filePath) return
44
+ const fileDir = (0, import_node_path.dirname)(filePath),
45
+ cjsExtension = options.esExtensionDefault || '.cjs',
46
+ jsExtension = '.js'
47
+ if (!(0, import_node_path.extname)(moduleSpecifier)) {
48
+ const resolvedPath = (0, import_node_path.resolve)(
49
+ fileDir,
50
+ moduleSpecifier
51
+ )
52
+ let newModuleSpecifier = moduleSpecifier
53
+ if (isLocalDirectory(resolvedPath)) {
54
+ const indexPath = (0, import_node_path.resolve)(
55
+ resolvedPath,
56
+ 'index' + jsExtension
57
+ )
58
+ if ((0, import_node_fs.existsSync)(indexPath)) {
59
+ ;(newModuleSpecifier.endsWith('/') || (newModuleSpecifier += '/'),
60
+ (newModuleSpecifier += 'index' + cjsExtension),
61
+ (arg.value = newModuleSpecifier))
62
+ return
63
+ }
64
+ }
65
+ if (
66
+ (0, import_node_fs.existsSync)(resolvedPath + jsExtension) ||
67
+ (0, import_node_fs.existsSync)(resolvedPath + cjsExtension)
68
+ ) {
69
+ ;((newModuleSpecifier += cjsExtension),
70
+ (arg.value = newModuleSpecifier))
71
+ return
42
72
  }
43
- }
44
- const filePathWithJs = resolvedPath + jsExtension;
45
- if ((0, import_node_fs.existsSync)(filePathWithJs)) {
46
- newModuleSpecifier += cjsExtension, arg.value = newModuleSpecifier;
47
- return;
48
73
  }
49
74
  }
50
75
  }
51
76
  }
52
- }
53
- }
77
+ },
78
+ },
54
79
  }
55
- };
80
+ )
56
81
  }
57
82
  function isLocalDirectory(absolutePath) {
58
- return (0, import_node_fs.existsSync)(absolutePath) && (0, import_node_fs.lstatSync)(absolutePath).isDirectory();
83
+ return (
84
+ (0, import_node_fs.existsSync)(absolutePath) &&
85
+ (0, import_node_fs.lstatSync)(absolutePath).isDirectory()
86
+ )
59
87
  }
60
88
  //# sourceMappingURL=commonjs.js.map
@@ -1,71 +1,98 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
1
+ var __defProp = Object.defineProperty
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor
3
+ var __getOwnPropNames = Object.getOwnPropertyNames
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: !0
9
- });
6
+ for (var name in all)
7
+ __defProp(target, name, {
8
+ get: all[name],
9
+ enumerable: !0,
10
+ })
10
11
  },
11
12
  __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
- get: () => from[key],
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- });
16
- return to;
17
- };
18
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
20
- }), mod);
21
- var commonjs_exports = {};
13
+ if ((from && typeof from == 'object') || typeof from == 'function')
14
+ for (let key of __getOwnPropNames(from))
15
+ !__hasOwnProp.call(to, key) &&
16
+ key !== except &&
17
+ __defProp(to, key, {
18
+ get: () => from[key],
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
20
+ })
21
+ return to
22
+ }
23
+ var __toCommonJS = (mod) =>
24
+ __copyProps(
25
+ __defProp({}, '__esModule', {
26
+ value: !0,
27
+ }),
28
+ mod
29
+ )
30
+ var commonjs_exports = {}
22
31
  __export(commonjs_exports, {
23
- default: () => fullySpecifyCommonJS
24
- });
25
- module.exports = __toCommonJS(commonjs_exports);
26
- var import_node_fs = require("node:fs"),
27
- import_node_path = require("node:path");
32
+ default: () => fullySpecifyCommonJS,
33
+ })
34
+ module.exports = __toCommonJS(commonjs_exports)
35
+ var import_node_fs = require('node:fs'),
36
+ import_node_path = require('node:path')
28
37
  function fullySpecifyCommonJS(api, options) {
29
- return api.assertVersion(7), {
30
- name: "babel-plugin-fully-specified-cjs",
31
- visitor: {
32
- CallExpression(path, state) {
33
- if (path.get("callee").isIdentifier({
34
- name: "require"
35
- }) && path.node.arguments.length === 1) {
36
- const arg = path.node.arguments[0];
37
- if (arg.type === "StringLiteral") {
38
- let moduleSpecifier = arg.value;
39
- if (moduleSpecifier.startsWith(".") || moduleSpecifier.startsWith("/")) {
40
- const filePath = state.file.opts.filename;
41
- if (!filePath) return;
42
- const fileDir = (0, import_node_path.dirname)(filePath),
43
- cjsExtension = options.esExtensionDefault || ".cjs",
44
- jsExtension = ".js";
45
- if (!(0, import_node_path.extname)(moduleSpecifier)) {
46
- const resolvedPath = (0, import_node_path.resolve)(fileDir, moduleSpecifier);
47
- let newModuleSpecifier = moduleSpecifier;
48
- if (isLocalDirectory(resolvedPath)) {
49
- const indexPath = (0, import_node_path.resolve)(resolvedPath, "index" + jsExtension);
50
- if ((0, import_node_fs.existsSync)(indexPath)) {
51
- newModuleSpecifier.endsWith("/") || (newModuleSpecifier += "/"), newModuleSpecifier += "index" + cjsExtension, arg.value = newModuleSpecifier;
52
- return;
38
+ return (
39
+ api.assertVersion(7),
40
+ {
41
+ name: 'babel-plugin-fully-specified-cjs',
42
+ visitor: {
43
+ CallExpression(path, state) {
44
+ if (
45
+ path.get('callee').isIdentifier({
46
+ name: 'require',
47
+ }) &&
48
+ path.node.arguments.length === 1
49
+ ) {
50
+ const arg = path.node.arguments[0]
51
+ if (arg.type === 'StringLiteral') {
52
+ let moduleSpecifier = arg.value
53
+ if (moduleSpecifier.startsWith('.') || moduleSpecifier.startsWith('/')) {
54
+ const filePath = state.file.opts.filename
55
+ if (!filePath) return
56
+ const fileDir = (0, import_node_path.dirname)(filePath),
57
+ cjsExtension = options.esExtensionDefault || '.cjs',
58
+ jsExtension = '.js'
59
+ if (!(0, import_node_path.extname)(moduleSpecifier)) {
60
+ const resolvedPath = (0, import_node_path.resolve)(
61
+ fileDir,
62
+ moduleSpecifier
63
+ )
64
+ let newModuleSpecifier = moduleSpecifier
65
+ if (isLocalDirectory(resolvedPath)) {
66
+ const indexPath = (0, import_node_path.resolve)(
67
+ resolvedPath,
68
+ 'index' + jsExtension
69
+ )
70
+ if ((0, import_node_fs.existsSync)(indexPath)) {
71
+ ;(newModuleSpecifier.endsWith('/') || (newModuleSpecifier += '/'),
72
+ (newModuleSpecifier += 'index' + cjsExtension),
73
+ (arg.value = newModuleSpecifier))
74
+ return
75
+ }
76
+ }
77
+ const filePathWithJs = resolvedPath + jsExtension
78
+ if ((0, import_node_fs.existsSync)(filePathWithJs)) {
79
+ ;((newModuleSpecifier += cjsExtension),
80
+ (arg.value = newModuleSpecifier))
81
+ return
53
82
  }
54
- }
55
- const filePathWithJs = resolvedPath + jsExtension;
56
- if ((0, import_node_fs.existsSync)(filePathWithJs)) {
57
- newModuleSpecifier += cjsExtension, arg.value = newModuleSpecifier;
58
- return;
59
83
  }
60
84
  }
61
85
  }
62
86
  }
63
- }
64
- }
87
+ },
88
+ },
65
89
  }
66
- };
90
+ )
67
91
  }
68
92
  function isLocalDirectory(absolutePath) {
69
- return (0, import_node_fs.existsSync)(absolutePath) && (0, import_node_fs.lstatSync)(absolutePath).isDirectory();
93
+ return (
94
+ (0, import_node_fs.existsSync)(absolutePath) &&
95
+ (0, import_node_fs.lstatSync)(absolutePath).isDirectory()
96
+ )
70
97
  }
71
98
  //# sourceMappingURL=commonjs.mjs.map