unframer 2.7.6 → 2.7.8
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/README.md +5 -6
- package/dist/babel-plugin-imports.d.ts +21 -0
- package/dist/babel-plugin-imports.d.ts.map +1 -0
- package/dist/babel-plugin-imports.js +375 -0
- package/dist/babel-plugin-imports.js.map +1 -0
- package/dist/cli.d.ts +14 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +9 -42
- package/dist/cli.js.map +1 -1
- package/dist/css.d.ts.map +1 -1
- package/dist/css.js +4 -3
- package/dist/css.js.map +1 -1
- package/dist/esbuild.d.ts +7 -0
- package/dist/esbuild.d.ts.map +1 -1
- package/dist/esbuild.js +15 -1
- package/dist/esbuild.js.map +1 -1
- package/dist/exporter.d.ts +6 -14
- package/dist/exporter.d.ts.map +1 -1
- package/dist/exporter.js +79 -38
- package/dist/exporter.js.map +1 -1
- package/dist/exporter.test.js +48 -0
- package/dist/exporter.test.js.map +1 -1
- package/dist/framer.d.ts.map +1 -1
- package/dist/framer.js +26 -1788
- package/dist/framer.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/renamer.d.ts +12 -0
- package/dist/renamer.d.ts.map +1 -0
- package/dist/renamer.js +169 -0
- package/dist/renamer.js.map +1 -0
- package/dist/unframer-loader.d.ts.map +1 -1
- package/dist/unframer-loader.js +4 -3
- package/dist/unframer-loader.js.map +1 -1
- package/esm/babel-plugin-imports.d.ts +21 -0
- package/esm/babel-plugin-imports.d.ts.map +1 -0
- package/esm/babel-plugin-imports.js +344 -0
- package/esm/babel-plugin-imports.js.map +1 -0
- package/esm/cli.d.ts +14 -0
- package/esm/cli.d.ts.map +1 -1
- package/esm/cli.js +9 -42
- package/esm/cli.js.map +1 -1
- package/esm/css.d.ts.map +1 -1
- package/esm/css.js +3 -2
- package/esm/css.js.map +1 -1
- package/esm/esbuild.d.ts +7 -0
- package/esm/esbuild.d.ts.map +1 -1
- package/esm/esbuild.js +13 -0
- package/esm/esbuild.js.map +1 -1
- package/esm/exporter.d.ts +6 -14
- package/esm/exporter.d.ts.map +1 -1
- package/esm/exporter.js +78 -37
- package/esm/exporter.js.map +1 -1
- package/esm/exporter.test.js +48 -0
- package/esm/exporter.test.js.map +1 -1
- package/esm/framer.d.ts.map +1 -1
- package/esm/framer.js +27 -1788
- package/esm/framer.js.map +1 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/renamer.d.ts +12 -0
- package/esm/renamer.d.ts.map +1 -0
- package/esm/renamer.js +140 -0
- package/esm/renamer.js.map +1 -0
- package/esm/unframer-loader.d.ts.map +1 -1
- package/esm/unframer-loader.js +4 -3
- package/esm/unframer-loader.js.map +1 -1
- package/package.json +6 -4
- package/src/babel-plugin-imports.ts +441 -0
- package/src/cli.tsx +11 -52
- package/src/css.ts +3 -2
- package/src/esbuild.ts +24 -2
- package/src/exporter.test.ts +66 -0
- package/src/exporter.ts +95 -42
- package/src/framer.js +25 -1827
- package/src/index.ts +2 -0
- package/src/renamer.ts +184 -0
- package/src/unframer-loader.ts +7 -3
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAG3B,OAAO,EACH,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,GACxB,MAAM,YAAY,CAAA"}
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAG3B,OAAO,EACH,YAAY,EAEZ,qBAAqB,GACxB,MAAM,YAAY,CAAA"}
|
package/esm/renamer.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Scope } from '@babel/traverse';
|
|
2
|
+
import * as t from '@babel/types';
|
|
3
|
+
import { NodePath } from '@babel/core';
|
|
4
|
+
export default class BatchRenamer {
|
|
5
|
+
constructor(scope: Scope, map: Map<string, string>);
|
|
6
|
+
map: Map<string, string>;
|
|
7
|
+
scope: Scope;
|
|
8
|
+
maybeConvertFromExportDeclaration(parentDeclar: NodePath): void;
|
|
9
|
+
maybeConvertFromClassFunctionExpression(path: NodePath): NodePath<t.Node>;
|
|
10
|
+
rename(): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=renamer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renamer.d.ts","sourceRoot":"","sources":["../src/renamer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAI5C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAEjC,OAAO,EAAE,QAAQ,EAAW,MAAM,aAAa,CAAA;AAgF/C,MAAM,CAAC,OAAO,OAAO,YAAY;gBACjB,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAK1C,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAExB,KAAK,EAAE,KAAK,CAAA;IAEpB,iCAAiC,CAAC,YAAY,EAAE,QAAQ;IAyBxD,uCAAuC,CAAC,IAAI,EAAE,QAAQ;IAItD,MAAM;CAwDT"}
|
package/esm/renamer.js
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// original https://github.com/babel/babel/blob/9c77558234c87b9220604fbc1519089e2d6334e2/packages/babel-traverse/src/scope/lib/renamer.ts#L61
|
|
2
|
+
import splitExportDeclaration from '@babel/helper-split-export-declaration';
|
|
3
|
+
import { visitors } from '@babel/traverse';
|
|
4
|
+
import { traverseNode } from '@babel/traverse/lib/traverse-node';
|
|
5
|
+
import * as t from '@babel/types';
|
|
6
|
+
import { logger } from './utils';
|
|
7
|
+
const renameVisitor = {
|
|
8
|
+
ReferencedIdentifier({ node }, state) {
|
|
9
|
+
for (let [oldName, newName] of state.map) {
|
|
10
|
+
// console.log(node.name, oldName, newName)
|
|
11
|
+
if (node.name === oldName) {
|
|
12
|
+
node.name = newName;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
// Scope(path, state) {
|
|
17
|
+
// if (
|
|
18
|
+
// !path.scope.bindingIdentifierEquals(
|
|
19
|
+
// state.oldName,
|
|
20
|
+
// state.binding.identifier,
|
|
21
|
+
// )
|
|
22
|
+
// ) {
|
|
23
|
+
// path.skip()
|
|
24
|
+
// if (path.isMethod()) {
|
|
25
|
+
// requeueComputedKeyAndDecorators(path)
|
|
26
|
+
// }
|
|
27
|
+
// }
|
|
28
|
+
// },
|
|
29
|
+
ObjectProperty({ node, scope }, state) {
|
|
30
|
+
var _a;
|
|
31
|
+
const { name } = node.key;
|
|
32
|
+
if (node.shorthand &&
|
|
33
|
+
// In destructuring the identifier is already renamed by the
|
|
34
|
+
// AssignmentExpression|Declaration|VariableDeclarator visitor,
|
|
35
|
+
// while in object literals it's renamed later by the
|
|
36
|
+
// ReferencedIdentifier visitor.
|
|
37
|
+
// (name === state.oldName || name === state.newName) &&
|
|
38
|
+
(state.map.has(name) || inverseMap(state.map).has(name)) &&
|
|
39
|
+
// Ignore shadowed bindings
|
|
40
|
+
[...state.map.keys()].some((oldName) => state.scope.getBindingIdentifier(oldName) ===
|
|
41
|
+
scope.getBindingIdentifier(name))) {
|
|
42
|
+
node.shorthand = false;
|
|
43
|
+
if ((_a = node.extra) === null || _a === void 0 ? void 0 : _a.shorthand)
|
|
44
|
+
node.extra.shorthand = false;
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
'AssignmentExpression|Declaration|VariableDeclarator'(path, state) {
|
|
49
|
+
if (path.isVariableDeclaration())
|
|
50
|
+
return;
|
|
51
|
+
const ids = path.getOuterBindingIdentifiers();
|
|
52
|
+
for (const name in ids) {
|
|
53
|
+
for (let [oldName, newName] of state.map) {
|
|
54
|
+
// console.log(name, oldName, newName)
|
|
55
|
+
if (name === oldName)
|
|
56
|
+
ids[name].name = newName;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
let cache = new WeakMap();
|
|
62
|
+
function inverseMap(map) {
|
|
63
|
+
if (cache.has(map))
|
|
64
|
+
return cache.get(map);
|
|
65
|
+
const inverse = new Map();
|
|
66
|
+
for (let [key, value] of map) {
|
|
67
|
+
inverse.set(value, key);
|
|
68
|
+
}
|
|
69
|
+
cache.set(map, inverse);
|
|
70
|
+
return inverse;
|
|
71
|
+
}
|
|
72
|
+
export default class BatchRenamer {
|
|
73
|
+
constructor(scope, map) {
|
|
74
|
+
this.map = map;
|
|
75
|
+
this.scope = scope;
|
|
76
|
+
}
|
|
77
|
+
maybeConvertFromExportDeclaration(parentDeclar) {
|
|
78
|
+
const maybeExportDeclar = parentDeclar.parentPath;
|
|
79
|
+
if (!(maybeExportDeclar === null || maybeExportDeclar === void 0 ? void 0 : maybeExportDeclar.isExportDeclaration())) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (maybeExportDeclar.isExportDefaultDeclaration()) {
|
|
83
|
+
const { declaration } = maybeExportDeclar.node;
|
|
84
|
+
if (t.isDeclaration(declaration) && !declaration.id) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (maybeExportDeclar.isExportAllDeclaration()) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
splitExportDeclaration(maybeExportDeclar);
|
|
92
|
+
}
|
|
93
|
+
maybeConvertFromClassFunctionExpression(path) {
|
|
94
|
+
return path;
|
|
95
|
+
}
|
|
96
|
+
rename( /* Babel 7 - block?: t.Pattern | t.Scopable */) {
|
|
97
|
+
const { scope, map } = this;
|
|
98
|
+
for (let binding of [...map.keys()].map((name) => scope.getBinding(name))) {
|
|
99
|
+
if (!binding) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const path = binding.path;
|
|
103
|
+
const parentDeclar = path.find((path) => path.isDeclaration() ||
|
|
104
|
+
path.isFunctionExpression() ||
|
|
105
|
+
path.isClassExpression());
|
|
106
|
+
if (parentDeclar) {
|
|
107
|
+
const bindingIds = parentDeclar.getOuterBindingIdentifiers();
|
|
108
|
+
const oldNames = Object.keys(bindingIds);
|
|
109
|
+
for (let oldName of oldNames) {
|
|
110
|
+
const binding = scope.getBinding(oldName);
|
|
111
|
+
if (binding && bindingIds[oldName] === binding.identifier) {
|
|
112
|
+
// When we are renaming an exported identifier, we need to ensure that
|
|
113
|
+
// the exported binding keeps the old name.
|
|
114
|
+
this.maybeConvertFromExportDeclaration(parentDeclar);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
traverseNode(scope.block, visitors.explode(renameVisitor), scope, this, scope.path,
|
|
120
|
+
// When blockToTraverse is a SwitchStatement, the discriminant
|
|
121
|
+
// is not part of the current scope and thus should be skipped.
|
|
122
|
+
{ discriminant: true });
|
|
123
|
+
for (let [oldName, newName] of map) {
|
|
124
|
+
if (oldName === newName)
|
|
125
|
+
continue;
|
|
126
|
+
if (!arguments[0]) {
|
|
127
|
+
scope.removeOwnBinding(oldName);
|
|
128
|
+
const binding = scope.getBinding(oldName);
|
|
129
|
+
if (binding) {
|
|
130
|
+
binding.identifier.name = newName;
|
|
131
|
+
scope.bindings[newName] = binding;
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
logger.log(`binding not found for ${oldName}`);
|
|
135
|
+
}
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,CAAC,CAAA;gBACzC,IAAI,OAAO,EAAE,CAAC;oBACV,OAAO,CAAC,UAAU,CAAC,IAAI,GAAG,OAAO,CAAA;oBACjC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,OAAO,CAAA;gBACrC,CAAC;qBAAM,CAAC;oBACJ,MAAM,CAAC,GAAG,CAAC,yBAAyB,OAAO,EAAE,CAAC,CAAA;gBAClD,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unframer-loader.d.ts","sourceRoot":"","sources":["../src/unframer-loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unframer-loader.d.ts","sourceRoot":"","sources":["../src/unframer-loader.ts"],"names":[],"mappings":"AAEA,wBAAsB,OAAO,CAAC,SAAS,KAAA,EAAE,OAAO,KAAA,EAAE,cAAc,KAAA,gBAW/D"}
|
package/esm/unframer-loader.js
CHANGED
|
@@ -7,12 +7,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
const mapPackages = JSON.parse(process.env.UNFRAMER_MAP_PACKAGES || '{}');
|
|
10
11
|
export function resolve(specifier, context, defaultResolve) {
|
|
11
12
|
return __awaiter(this, void 0, void 0, function* () {
|
|
12
|
-
if (specifier
|
|
13
|
+
if (mapPackages[specifier]) {
|
|
13
14
|
return {
|
|
14
|
-
url:
|
|
15
|
-
format: 'module', // Specify that unframer is an ES module
|
|
15
|
+
url: mapPackages[specifier],
|
|
16
|
+
// format: 'module', // Specify that unframer is an ES module
|
|
16
17
|
shortCircuit: true, // Signal that we're intentionally not calling next hook
|
|
17
18
|
};
|
|
18
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unframer-loader.js","sourceRoot":"","sources":["../src/unframer-loader.ts"],"names":[],"mappings":";;;;;;;;;AAAA,MAAM,UAAgB,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,cAAc;;QAC5D,IAAI,SAAS,
|
|
1
|
+
{"version":3,"file":"unframer-loader.js","sourceRoot":"","sources":["../src/unframer-loader.ts"],"names":[],"mappings":";;;;;;;;;AAAA,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,IAAI,CAAC,CAAA;AAEzE,MAAM,UAAgB,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,cAAc;;QAC5D,IAAI,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;YACzB,OAAO;gBACH,GAAG,EAAE,WAAW,CAAC,SAAS,CAAC;gBAC3B,6DAA6D;gBAC7D,YAAY,EAAE,IAAI,EAAE,wDAAwD;aAC/E,CAAA;QACL,CAAC;QAGD,OAAO,cAAc,CAAC,SAAS,EAAE,OAAO,EAAE,cAAc,CAAC,CAAA;IAC7D,CAAC;CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unframer",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.8",
|
|
4
4
|
"description": "Import Framer components directly in your React app, type safe and customizable",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"repository": "https://github.com/remorses/unframer",
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"async-sema": "^3.1.1",
|
|
43
43
|
"cac": "^6.7.14",
|
|
44
|
-
"dedent": "^1.5.3",
|
|
45
44
|
"dprint-node": "^1.0.8",
|
|
46
45
|
"esbuild": "^0.24.0",
|
|
47
46
|
"esbuild-plugins-node-modules-polyfill": "^1.6.8",
|
|
@@ -49,12 +48,14 @@
|
|
|
49
48
|
"find-up": "^5.0.0",
|
|
50
49
|
"fs-extra": "^11.2.0",
|
|
51
50
|
"json5": "^2.2.3",
|
|
51
|
+
"just-kebab-case": "^4.2.0",
|
|
52
52
|
"marked": "^15.0.3",
|
|
53
53
|
"marked-terminal": "^7.2.1",
|
|
54
54
|
"nanospinner": "^1.2.0",
|
|
55
55
|
"native-fetch": "^4.0.2",
|
|
56
56
|
"picocolors": "^1.0.1",
|
|
57
|
-
"real-framer-motion": "npm:framer-motion@11.2.10"
|
|
57
|
+
"real-framer-motion": "npm:framer-motion@11.2.10",
|
|
58
|
+
"string-dedent": "^3.0.1"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"@babel/core": "^7.24.9",
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
"@types/fs-extra": "^11.0.4",
|
|
71
72
|
"@types/node": "^22.7.4",
|
|
72
73
|
"@types/react": "^18.3.12",
|
|
73
|
-
"@xmorse/deployment-utils": "^0.2.
|
|
74
|
+
"@xmorse/deployment-utils": "^0.2.19",
|
|
74
75
|
"concurrently": "^8.2.2",
|
|
75
76
|
"openai": "^4.52.7",
|
|
76
77
|
"posthtml": "^0.16.6",
|
|
@@ -81,6 +82,7 @@
|
|
|
81
82
|
},
|
|
82
83
|
"scripts": {
|
|
83
84
|
"build": "rm -rf dist && concurrently 'pnpm tsc -m esnext --outDir esm' 'pnpm tsc' && echo copying && cp ../README.md ./README.md && cp ./src/framer.d.ts ./dist/framer.d.ts && cp ./src/framer.d.ts ./esm/framer.d.ts",
|
|
85
|
+
"test": "vitest",
|
|
84
86
|
"download-framer": "tsx scripts/download.ts",
|
|
85
87
|
"watch": "rm -rf dist esm && concurrently 'pnpm tsc -w' 'pnpm tsc -m esnext -w --outDir esm'"
|
|
86
88
|
}
|