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.
Files changed (78) hide show
  1. package/README.md +5 -6
  2. package/dist/babel-plugin-imports.d.ts +21 -0
  3. package/dist/babel-plugin-imports.d.ts.map +1 -0
  4. package/dist/babel-plugin-imports.js +375 -0
  5. package/dist/babel-plugin-imports.js.map +1 -0
  6. package/dist/cli.d.ts +14 -0
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +9 -42
  9. package/dist/cli.js.map +1 -1
  10. package/dist/css.d.ts.map +1 -1
  11. package/dist/css.js +4 -3
  12. package/dist/css.js.map +1 -1
  13. package/dist/esbuild.d.ts +7 -0
  14. package/dist/esbuild.d.ts.map +1 -1
  15. package/dist/esbuild.js +15 -1
  16. package/dist/esbuild.js.map +1 -1
  17. package/dist/exporter.d.ts +6 -14
  18. package/dist/exporter.d.ts.map +1 -1
  19. package/dist/exporter.js +79 -38
  20. package/dist/exporter.js.map +1 -1
  21. package/dist/exporter.test.js +48 -0
  22. package/dist/exporter.test.js.map +1 -1
  23. package/dist/framer.d.ts.map +1 -1
  24. package/dist/framer.js +26 -1788
  25. package/dist/framer.js.map +1 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/renamer.d.ts +12 -0
  29. package/dist/renamer.d.ts.map +1 -0
  30. package/dist/renamer.js +169 -0
  31. package/dist/renamer.js.map +1 -0
  32. package/dist/unframer-loader.d.ts.map +1 -1
  33. package/dist/unframer-loader.js +4 -3
  34. package/dist/unframer-loader.js.map +1 -1
  35. package/esm/babel-plugin-imports.d.ts +21 -0
  36. package/esm/babel-plugin-imports.d.ts.map +1 -0
  37. package/esm/babel-plugin-imports.js +344 -0
  38. package/esm/babel-plugin-imports.js.map +1 -0
  39. package/esm/cli.d.ts +14 -0
  40. package/esm/cli.d.ts.map +1 -1
  41. package/esm/cli.js +9 -42
  42. package/esm/cli.js.map +1 -1
  43. package/esm/css.d.ts.map +1 -1
  44. package/esm/css.js +3 -2
  45. package/esm/css.js.map +1 -1
  46. package/esm/esbuild.d.ts +7 -0
  47. package/esm/esbuild.d.ts.map +1 -1
  48. package/esm/esbuild.js +13 -0
  49. package/esm/esbuild.js.map +1 -1
  50. package/esm/exporter.d.ts +6 -14
  51. package/esm/exporter.d.ts.map +1 -1
  52. package/esm/exporter.js +78 -37
  53. package/esm/exporter.js.map +1 -1
  54. package/esm/exporter.test.js +48 -0
  55. package/esm/exporter.test.js.map +1 -1
  56. package/esm/framer.d.ts.map +1 -1
  57. package/esm/framer.js +27 -1788
  58. package/esm/framer.js.map +1 -1
  59. package/esm/index.d.ts.map +1 -1
  60. package/esm/index.js.map +1 -1
  61. package/esm/renamer.d.ts +12 -0
  62. package/esm/renamer.d.ts.map +1 -0
  63. package/esm/renamer.js +140 -0
  64. package/esm/renamer.js.map +1 -0
  65. package/esm/unframer-loader.d.ts.map +1 -1
  66. package/esm/unframer-loader.js +4 -3
  67. package/esm/unframer-loader.js.map +1 -1
  68. package/package.json +6 -4
  69. package/src/babel-plugin-imports.ts +441 -0
  70. package/src/cli.tsx +11 -52
  71. package/src/css.ts +3 -2
  72. package/src/esbuild.ts +24 -2
  73. package/src/exporter.test.ts +66 -0
  74. package/src/exporter.ts +95 -42
  75. package/src/framer.js +25 -1827
  76. package/src/index.ts +2 -0
  77. package/src/renamer.ts +184 -0
  78. package/src/unframer-loader.ts +7 -3
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,EACH,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,GACxB,MAAM,YAAY,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;AAC3B,OAAO,EACH,YAAY,EAEZ,qBAAqB,GACxB,MAAM,YAAY,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"}
@@ -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
+ }
136
+ }
137
+ }
138
+ }
139
+ }
140
+ //# sourceMappingURL=renamer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renamer.js","sourceRoot":"","sources":["../src/renamer.ts"],"names":[],"mappings":"AAAA,6IAA6I;AAC7I,OAAO,sBAAsB,MAAM,wCAAwC,CAAA;AAE3E,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAEhE,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAIjC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,MAAM,aAAa,GAA0B;IACzC,oBAAoB,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK;QAChC,KAAK,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;YACvC,2CAA2C;YAC3C,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gBACxB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAA;YACvB,CAAC;QACL,CAAC;IACL,CAAC;IAED,uBAAuB;IACvB,WAAW;IACX,+CAA+C;IAC/C,6BAA6B;IAC7B,wCAAwC;IACxC,YAAY;IACZ,UAAU;IACV,sBAAsB;IACtB,iCAAiC;IACjC,oDAAoD;I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QAC9D,+DAA+D;QAC/D,EAAE,YAAY,EAAE,IAAI,EAAE,CACzB,CAAA;QAED,KAAK,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,GAAG,EAAE,CAAC;YACjC,IAAI,OAAO,KAAK,OAAO;gBAAE,SAAQ;YAEjC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBAChB,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAA;gBAC/B,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,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":"AAAA,wBAAsB,OAAO,CAAC,SAAS,KAAA,EAAE,OAAO,KAAA,EAAE,cAAc,KAAA,gBAS/D"}
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"}
@@ -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 === 'unframer') {
13
+ if (mapPackages[specifier]) {
13
14
  return {
14
- url: process.env.UNFRAMER_RUNTIME_PATH,
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,KAAK,UAAU,EAAE,CAAC;YAC3B,OAAO;gBACH,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB;gBACtC,MAAM,EAAE,QAAQ,EAAE,wCAAwC;gBAC1D,YAAY,EAAE,IAAI,EAAE,wDAAwD;aAC/E,CAAA;QACL,CAAC;QACD,OAAO,cAAc,CAAC,SAAS,EAAE,OAAO,EAAE,cAAc,CAAC,CAAA;IAC7D,CAAC;CAAA"}
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.6",
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.18",
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
  }