@depup/babel__plugin-transform-typescript 7.28.6-depup.0

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.
@@ -0,0 +1,176 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = transpileNamespace;
7
+ exports.getFirstIdentifier = getFirstIdentifier;
8
+ var _core = require("@babel/core");
9
+ var _globalTypes = require("./global-types.js");
10
+ var _constEnum = require("./const-enum.js");
11
+ function getFirstIdentifier(node) {
12
+ if (_core.types.isIdentifier(node)) {
13
+ return node;
14
+ }
15
+ return getFirstIdentifier(node.left);
16
+ }
17
+ function transpileNamespace(path, allowNamespaces) {
18
+ if (path.node.declare || path.node.id.type === "StringLiteral") {
19
+ path.remove();
20
+ return;
21
+ }
22
+ if (!allowNamespaces) {
23
+ throw path.get("id").buildCodeFrameError("Namespace not marked type-only declare." + " Non-declarative namespaces are only supported experimentally in Babel." + " To enable and review caveats see:" + " https://babeljs.io/docs/en/babel-plugin-transform-typescript");
24
+ }
25
+ const name = getFirstIdentifier(path.node.id).name;
26
+ const value = handleNested(path, path.node);
27
+ if (value === null) {
28
+ const program = path.findParent(p => p.isProgram());
29
+ (0, _globalTypes.registerGlobalType)(program.scope, name);
30
+ path.remove();
31
+ } else if (path.scope.hasOwnBinding(name)) {
32
+ path.replaceWith(value);
33
+ } else {
34
+ path.scope.registerDeclaration(path.replaceWithMultiple([getDeclaration(name), value])[0]);
35
+ }
36
+ }
37
+ function getDeclaration(name) {
38
+ return _core.types.variableDeclaration("let", [_core.types.variableDeclarator(_core.types.identifier(name))]);
39
+ }
40
+ function getMemberExpression(name, itemName) {
41
+ return _core.types.memberExpression(_core.types.identifier(name), _core.types.identifier(itemName));
42
+ }
43
+ function handleVariableDeclaration(node, name, hub) {
44
+ if (node.kind !== "const") {
45
+ throw hub.file.buildCodeFrameError(node, "Namespaces exporting non-const are not supported by Babel." + " Change to const or see:" + " https://babeljs.io/docs/en/babel-plugin-transform-typescript");
46
+ }
47
+ const {
48
+ declarations
49
+ } = node;
50
+ if (declarations.every(declarator => _core.types.isIdentifier(declarator.id))) {
51
+ for (const declarator of declarations) {
52
+ declarator.init = _core.types.assignmentExpression("=", getMemberExpression(name, declarator.id.name), declarator.init);
53
+ }
54
+ return [node];
55
+ }
56
+ const bindingIdentifiers = _core.types.getBindingIdentifiers(node);
57
+ const assignments = [];
58
+ for (const idName in bindingIdentifiers) {
59
+ assignments.push(_core.types.assignmentExpression("=", getMemberExpression(name, idName), _core.types.cloneNode(bindingIdentifiers[idName])));
60
+ }
61
+ return [node, _core.types.expressionStatement(_core.types.sequenceExpression(assignments))];
62
+ }
63
+ function buildNestedAmbientModuleError(path, node) {
64
+ return path.hub.buildError(node, "Ambient modules cannot be nested in other modules or namespaces.", Error);
65
+ }
66
+ function handleNested(path, node, parentExport) {
67
+ const names = new Set();
68
+ const realName = node.id;
69
+ const name = path.scope.generateUid(realName.name);
70
+ const body = node.body;
71
+ let id = node.id;
72
+ let namespaceTopLevel;
73
+ namespaceTopLevel = _core.types.isTSModuleBlock(body) ? body.body : [_core.types.exportNamedDeclaration(body)];
74
+ let isEmpty = true;
75
+ for (let i = 0; i < namespaceTopLevel.length; i++) {
76
+ const subNode = namespaceTopLevel[i];
77
+ switch (subNode.type) {
78
+ case "TSModuleDeclaration":
79
+ {
80
+ if (!_core.types.isIdentifier(subNode.id)) {
81
+ throw buildNestedAmbientModuleError(path, subNode);
82
+ }
83
+ const transformed = handleNested(path, subNode);
84
+ if (transformed !== null) {
85
+ isEmpty = false;
86
+ const moduleName = subNode.id.name;
87
+ if (names.has(moduleName)) {
88
+ namespaceTopLevel[i] = transformed;
89
+ } else {
90
+ names.add(moduleName);
91
+ namespaceTopLevel.splice(i++, 1, getDeclaration(moduleName), transformed);
92
+ }
93
+ }
94
+ continue;
95
+ }
96
+ case "TSEnumDeclaration":
97
+ case "FunctionDeclaration":
98
+ case "ClassDeclaration":
99
+ isEmpty = false;
100
+ names.add(subNode.id.name);
101
+ continue;
102
+ case "VariableDeclaration":
103
+ {
104
+ isEmpty = false;
105
+ for (const name in _core.types.getBindingIdentifiers(subNode)) {
106
+ names.add(name);
107
+ }
108
+ continue;
109
+ }
110
+ default:
111
+ isEmpty && (isEmpty = _core.types.isTypeScript(subNode));
112
+ continue;
113
+ case "ExportNamedDeclaration":
114
+ }
115
+ if ("declare" in subNode.declaration && subNode.declaration.declare) {
116
+ continue;
117
+ }
118
+ switch (subNode.declaration.type) {
119
+ case "TSEnumDeclaration":
120
+ _constEnum.EXPORTED_CONST_ENUMS_IN_NAMESPACE.add(subNode.declaration);
121
+ case "FunctionDeclaration":
122
+ case "ClassDeclaration":
123
+ {
124
+ isEmpty = false;
125
+ const itemName = subNode.declaration.id.name;
126
+ names.add(itemName);
127
+ namespaceTopLevel.splice(i++, 1, subNode.declaration, _core.types.expressionStatement(_core.types.assignmentExpression("=", getMemberExpression(name, itemName), _core.types.identifier(itemName))));
128
+ break;
129
+ }
130
+ case "VariableDeclaration":
131
+ {
132
+ isEmpty = false;
133
+ const nodes = handleVariableDeclaration(subNode.declaration, name, path.hub);
134
+ namespaceTopLevel.splice(i, nodes.length, ...nodes);
135
+ i += nodes.length - 1;
136
+ break;
137
+ }
138
+ case "TSModuleDeclaration":
139
+ {
140
+ if (!_core.types.isIdentifier(subNode.declaration.id)) {
141
+ throw buildNestedAmbientModuleError(path, subNode.declaration);
142
+ }
143
+ const transformed = handleNested(path, subNode.declaration, _core.types.identifier(name));
144
+ if (transformed !== null) {
145
+ isEmpty = false;
146
+ const moduleName = subNode.declaration.id.name;
147
+ if (names.has(moduleName)) {
148
+ namespaceTopLevel[i] = transformed;
149
+ } else {
150
+ names.add(moduleName);
151
+ namespaceTopLevel.splice(i++, 1, getDeclaration(moduleName), transformed);
152
+ }
153
+ } else {
154
+ namespaceTopLevel.splice(i, 1);
155
+ i--;
156
+ }
157
+ }
158
+ }
159
+ }
160
+ if (isEmpty) return null;
161
+ let fallthroughValue = _core.types.objectExpression([]);
162
+ if (parentExport) {
163
+ const memberExpr = _core.types.memberExpression(parentExport, realName);
164
+ fallthroughValue = _core.template.expression.ast`
165
+ ${_core.types.cloneNode(memberExpr)} ||
166
+ (${_core.types.cloneNode(memberExpr)} = ${fallthroughValue})
167
+ `;
168
+ }
169
+ return _core.template.statement.ast`
170
+ (function (${_core.types.identifier(name)}) {
171
+ ${namespaceTopLevel}
172
+ })(${realName} || (${_core.types.cloneNode(realName)} = ${fallthroughValue}));
173
+ `;
174
+ }
175
+
176
+ //# sourceMappingURL=namespace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_core","require","_globalTypes","_constEnum","getFirstIdentifier","node","t","isIdentifier","left","transpileNamespace","path","allowNamespaces","declare","id","type","remove","get","buildCodeFrameError","name","value","handleNested","program","findParent","p","isProgram","registerGlobalType","scope","hasOwnBinding","replaceWith","registerDeclaration","replaceWithMultiple","getDeclaration","variableDeclaration","variableDeclarator","identifier","getMemberExpression","itemName","memberExpression","handleVariableDeclaration","hub","kind","file","declarations","every","declarator","init","assignmentExpression","bindingIdentifiers","getBindingIdentifiers","assignments","idName","push","cloneNode","expressionStatement","sequenceExpression","buildNestedAmbientModuleError","buildError","Error","parentExport","names","Set","realName","generateUid","body","namespaceTopLevel","isTSModuleBlock","exportNamedDeclaration","isEmpty","i","length","subNode","transformed","moduleName","has","add","splice","isTypeScript","declaration","EXPORTED_CONST_ENUMS_IN_NAMESPACE","nodes","fallthroughValue","objectExpression","memberExpr","template","expression","ast","statement"],"sources":["../src/namespace.ts"],"sourcesContent":["import { template, types as t, type NodePath } from \"@babel/core\";\n\nimport { registerGlobalType } from \"./global-types.ts\";\nimport { EXPORTED_CONST_ENUMS_IN_NAMESPACE } from \"./const-enum.ts\";\n\nexport function getFirstIdentifier(node: t.TSEntityName): t.Identifier {\n if (t.isIdentifier(node)) {\n return node;\n }\n // In Babel 8 TSEntityName also includes ThisExpression, however, a namespace\n // id must not be a ThisExpression or a TSQualifiedName { left: ThisExpression }.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n return getFirstIdentifier((node as t.TSQualifiedName).left);\n}\n\nexport default function transpileNamespace(\n path: NodePath<t.TSModuleDeclaration>,\n allowNamespaces: boolean,\n) {\n if (path.node.declare || path.node.id.type === \"StringLiteral\") {\n path.remove();\n return;\n }\n\n if (!allowNamespaces) {\n throw path\n .get(\"id\")\n .buildCodeFrameError(\n \"Namespace not marked type-only declare.\" +\n \" Non-declarative namespaces are only supported experimentally in Babel.\" +\n \" To enable and review caveats see:\" +\n \" https://babeljs.io/docs/en/babel-plugin-transform-typescript\",\n );\n }\n\n const name = getFirstIdentifier(path.node.id).name;\n const value = handleNested(path, path.node);\n if (value === null) {\n // This means that `path` is a type-only namespace.\n // We call `registerGlobalType` here to allow it to be stripped.\n const program = path.findParent(p => p.isProgram());\n registerGlobalType(program.scope, name);\n\n path.remove();\n } else if (path.scope.hasOwnBinding(name)) {\n path.replaceWith(value);\n } else {\n path.scope.registerDeclaration(\n path.replaceWithMultiple([getDeclaration(name), value])[0],\n );\n }\n}\n\nfunction getDeclaration(name: string) {\n return t.variableDeclaration(\"let\", [\n t.variableDeclarator(t.identifier(name)),\n ]);\n}\n\nfunction getMemberExpression(name: string, itemName: string) {\n return t.memberExpression(t.identifier(name), t.identifier(itemName));\n}\n\n/**\n * Convert export const foo = 1 to Namespace.foo = 1;\n *\n * @param {t.VariableDeclaration} node given variable declaration, e.g. `const foo = 1`\n * @param {string} name the generated unique namespace member name\n * @param {*} hub An instance implements HubInterface defined in `@babel/traverse` that can throw a code frame error\n */\nfunction handleVariableDeclaration(\n node: t.VariableDeclaration,\n name: string,\n hub: any,\n): t.Statement[] {\n if (node.kind !== \"const\") {\n throw hub.file.buildCodeFrameError(\n node,\n \"Namespaces exporting non-const are not supported by Babel.\" +\n \" Change to const or see:\" +\n \" https://babeljs.io/docs/en/babel-plugin-transform-typescript\",\n );\n }\n const { declarations } = node;\n if (\n declarations.every(\n (declarator): declarator is t.VariableDeclarator & { id: t.Identifier } =>\n t.isIdentifier(declarator.id),\n )\n ) {\n // `export const a = 1` transforms to `const a = N.a = 1`, the output\n // is smaller than `const a = 1; N.a = a`;\n for (const declarator of declarations) {\n declarator.init = t.assignmentExpression(\n \"=\",\n getMemberExpression(name, declarator.id.name),\n declarator.init,\n );\n }\n return [node];\n }\n // Now we have pattern in declarators\n // `export const [a] = 1` transforms to `const [a] = 1; N.a = a`\n const bindingIdentifiers = t.getBindingIdentifiers(node);\n const assignments = [];\n // getBindingIdentifiers returns an object without prototype.\n // eslint-disable-next-line guard-for-in\n for (const idName in bindingIdentifiers) {\n assignments.push(\n t.assignmentExpression(\n \"=\",\n getMemberExpression(name, idName),\n t.cloneNode(bindingIdentifiers[idName]),\n ),\n );\n }\n return [node, t.expressionStatement(t.sequenceExpression(assignments))];\n}\n\nfunction buildNestedAmbientModuleError(path: NodePath, node: t.Node) {\n return path.hub.buildError(\n node,\n \"Ambient modules cannot be nested in other modules or namespaces.\",\n Error,\n );\n}\n\nfunction handleNested(\n path: NodePath,\n node: t.TSModuleDeclaration,\n parentExport?: t.Expression,\n): t.Statement | null {\n const names = new Set();\n const realName =\n !process.env.BABEL_8_BREAKING || t.isIdentifier(node.id)\n ? (node.id as t.Identifier)\n : getFirstIdentifier(node.id as unknown as t.TSQualifiedName);\n\n const name = path.scope.generateUid(realName.name);\n\n const body = node.body;\n let id = node.id;\n let namespaceTopLevel: t.Statement[];\n if (process.env.BABEL_8_BREAKING) {\n if (t.isTSQualifiedName(id)) {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST shape\n namespaceTopLevel = body.body;\n while (t.isTSQualifiedName(id)) {\n namespaceTopLevel = [\n t.exportNamedDeclaration(\n t.tsModuleDeclaration(\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST shape\n t.cloneNode(id.right),\n t.tsModuleBlock(namespaceTopLevel),\n ),\n ),\n ];\n\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST shape\n id = id.left;\n }\n } else {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST shape\n namespaceTopLevel = body.body;\n }\n } else {\n namespaceTopLevel = t.isTSModuleBlock(body)\n ? body.body\n : // We handle `namespace X.Y {}` as if it was\n // namespace X {\n // export namespace Y {}\n // }\n [t.exportNamedDeclaration(body)];\n }\n\n let isEmpty = true;\n\n for (let i = 0; i < namespaceTopLevel.length; i++) {\n const subNode = namespaceTopLevel[i];\n\n // The first switch is mainly to detect name usage. Only export\n // declarations require further transformation.\n switch (subNode.type) {\n case \"TSModuleDeclaration\": {\n if (!t.isIdentifier(subNode.id)) {\n throw buildNestedAmbientModuleError(path, subNode);\n }\n\n const transformed = handleNested(path, subNode);\n if (transformed !== null) {\n isEmpty = false;\n const moduleName = subNode.id.name;\n if (names.has(moduleName)) {\n namespaceTopLevel[i] = transformed;\n } else {\n names.add(moduleName);\n namespaceTopLevel.splice(\n i++,\n 1,\n getDeclaration(moduleName),\n transformed,\n );\n }\n }\n continue;\n }\n case \"TSEnumDeclaration\":\n case \"FunctionDeclaration\":\n case \"ClassDeclaration\":\n isEmpty = false;\n names.add(subNode.id.name);\n continue;\n case \"VariableDeclaration\": {\n isEmpty = false;\n // getBindingIdentifiers returns an object without prototype.\n // eslint-disable-next-line guard-for-in\n for (const name in t.getBindingIdentifiers(subNode)) {\n names.add(name);\n }\n continue;\n }\n default:\n isEmpty &&= t.isTypeScript(subNode);\n // Neither named declaration nor export, continue to next item.\n continue;\n case \"ExportNamedDeclaration\":\n // Export declarations get parsed using the next switch.\n }\n\n if (\"declare\" in subNode.declaration && subNode.declaration.declare) {\n continue;\n }\n\n // Transform the export declarations that occur inside of a namespace.\n switch (subNode.declaration.type) {\n case \"TSEnumDeclaration\":\n EXPORTED_CONST_ENUMS_IN_NAMESPACE.add(subNode.declaration);\n // fallthrough\n case \"FunctionDeclaration\":\n case \"ClassDeclaration\": {\n isEmpty = false;\n const itemName = subNode.declaration.id.name;\n names.add(itemName);\n namespaceTopLevel.splice(\n i++,\n 1,\n subNode.declaration,\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n getMemberExpression(name, itemName),\n t.identifier(itemName),\n ),\n ),\n );\n break;\n }\n case \"VariableDeclaration\": {\n isEmpty = false;\n const nodes = handleVariableDeclaration(\n subNode.declaration,\n name,\n path.hub,\n );\n namespaceTopLevel.splice(i, nodes.length, ...nodes);\n i += nodes.length - 1;\n break;\n }\n case \"TSModuleDeclaration\": {\n if (!t.isIdentifier(subNode.declaration.id)) {\n throw buildNestedAmbientModuleError(path, subNode.declaration);\n }\n\n const transformed = handleNested(\n path,\n subNode.declaration,\n t.identifier(name),\n );\n if (transformed !== null) {\n isEmpty = false;\n const moduleName = subNode.declaration.id.name;\n if (names.has(moduleName)) {\n namespaceTopLevel[i] = transformed;\n } else {\n names.add(moduleName);\n namespaceTopLevel.splice(\n i++,\n 1,\n getDeclaration(moduleName),\n transformed,\n );\n }\n } else {\n namespaceTopLevel.splice(i, 1);\n i--;\n }\n }\n }\n }\n\n if (isEmpty) return null;\n\n // {}\n let fallthroughValue: t.Expression = t.objectExpression([]);\n\n if (parentExport) {\n const memberExpr = t.memberExpression(parentExport, realName);\n fallthroughValue = template.expression.ast`\n ${t.cloneNode(memberExpr)} ||\n (${t.cloneNode(memberExpr)} = ${fallthroughValue})\n `;\n }\n\n return template.statement.ast`\n (function (${t.identifier(name)}) {\n ${namespaceTopLevel}\n })(${realName} || (${t.cloneNode(realName)} = ${fallthroughValue}));\n `;\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEO,SAASG,kBAAkBA,CAACC,IAAoB,EAAgB;EACrE,IAAIC,WAAC,CAACC,YAAY,CAACF,IAAI,CAAC,EAAE;IACxB,OAAOA,IAAI;EACb;EAIA,OAAOD,kBAAkB,CAAEC,IAAI,CAAuBG,IAAI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AACc,GAAG,CAACD,UAAU,CAAC,EAAE;cACzBR,iBAAiB,CAACI,CAAC,CAAC,GAAGG,WAAW;YACpC,CAAC,MAAM;cACLZ,KAAK,CAACe,GAAG,CAACF,UAAU,CAAC;cACrBR,iBAAiB,CAACW,MAAM,CACtBP,CAAC,EAAE,EACH,CAAC,EACDrC,cAAc,CAACyC,UAAU,CAAC,EAC1BD,WACF,CAAC;YACH;UACF,CAAC,MAAM;YACLP,iBAAiB,CAACW,MAAM,CAACP,CAAC,EAAE,CAAC,CAAC;YAC9BA,CAAC,EAAE;UACL;QACF;IACF;EACF;EAEA,IAAID,OAAO,EAAE,OAAO,IAAI;EAGxB,IAAIa,gBAA8B,GAAG1E,WAAC,CAAC2E,gBAAgB,CAAC,EAAE,CAAC;EAE3D,IAAIvB,YAAY,EAAE;IAChB,MAAMwB,UAAU,GAAG5E,WAAC,CAAC+B,gBAAgB,CAACqB,YAAY,EAAEG,QAAQ,CAAC;IAC7DmB,gBAAgB,GAAGG,cAAQ,CAACC,UAAU,CAACC,GAAG;AAC9C,QAAQ/E,WAAC,CAAC8C,SAAS,CAAC8B,UAAU,CAAC;AAC/B,WAAW5E,WAAC,CAAC8C,SAAS,CAAC8B,UAAU,CAAC,MAAMF,gBAAgB;AACxD,KAAK;EACH;EAEA,OAAOG,cAAQ,CAACG,SAAS,CAACD,GAAG;AAC/B,iBAAiB/E,WAAC,CAAC4B,UAAU,CAAChB,IAAI,CAAC;AACnC,QAAQ8C,iBAAiB;AACzB,SAASH,QAAQ,QAAQvD,WAAC,CAAC8C,SAAS,CAACS,QAAQ,CAAC,MAAMmB,gBAAgB;AACpE,GAAG;AACH","ignoreList":[]}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@depup/babel__plugin-transform-typescript",
3
+ "version": "7.28.6-depup.0",
4
+ "description": "[DepUp] Transform TypeScript into ES.next",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/babel/babel.git",
8
+ "directory": "packages/babel-plugin-transform-typescript"
9
+ },
10
+ "license": "MIT",
11
+ "main": "./lib/index.js",
12
+ "keywords": [
13
+ "depup",
14
+ "dependency-bumped",
15
+ "updated-deps",
16
+ "@babel/plugin-transform-typescript",
17
+ "babel-plugin",
18
+ "typescript"
19
+ ],
20
+ "dependencies": {
21
+ "@babel/helper-annotate-as-pure": "^7.27.3",
22
+ "@babel/helper-create-class-features-plugin": "^7.28.6",
23
+ "@babel/helper-plugin-utils": "^7.28.6",
24
+ "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1",
25
+ "@babel/plugin-syntax-typescript": "^7.28.6"
26
+ },
27
+ "peerDependencies": {
28
+ "@babel/core": "^7.0.0-0"
29
+ },
30
+ "devDependencies": {
31
+ "@babel/core": "^7.28.6",
32
+ "@babel/helper-plugin-test-runner": "^7.27.1",
33
+ "@babel/traverse": "^7.28.6",
34
+ "@babel/types": "^7.28.6"
35
+ },
36
+ "homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-typescript",
37
+ "engines": {
38
+ "node": ">=6.9.0"
39
+ },
40
+ "author": "The Babel Team (https://babel.dev/team)",
41
+ "type": "commonjs",
42
+ "depup": {
43
+ "changes": {},
44
+ "depsUpdated": 0,
45
+ "originalPackage": "@babel/plugin-transform-typescript",
46
+ "originalVersion": "7.28.6",
47
+ "processedAt": "2026-03-17T16:30:34.191Z",
48
+ "smokeTest": "passed"
49
+ }
50
+ }