@teambit/typescript 1.0.1097 → 1.0.1099
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/dist/global-virtual-store-type-paths.d.ts +29 -0
- package/dist/global-virtual-store-type-paths.js +181 -0
- package/dist/global-virtual-store-type-paths.js.map +1 -0
- package/dist/global-virtual-store-type-paths.spec.d.ts +1 -0
- package/dist/global-virtual-store-type-paths.spec.js +246 -0
- package/dist/global-virtual-store-type-paths.spec.js.map +1 -0
- package/dist/{preview-1786219819000.js → preview-1786400681343.js} +2 -2
- package/dist/typescript.main.runtime.d.ts +11 -0
- package/dist/typescript.main.runtime.js +33 -1
- package/dist/typescript.main.runtime.js.map +1 -1
- package/package.json +17 -17
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type TypePaths = Record<string, string[]>;
|
|
2
|
+
/**
|
|
3
|
+
* `@types/react` -> `react`, `@types/babel__core` -> `@babel/core`. The double underscore is
|
|
4
|
+
* DefinitelyTyped's mangling for a scope separator, and only the first one is the separator - a
|
|
5
|
+
* package whose own name contains `__` keeps it.
|
|
6
|
+
*/
|
|
7
|
+
export declare function typesDirToSpecifier(dirName: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* `paths` entries that let a store slot resolve the types it used to reach by walking up out of
|
|
10
|
+
* `node_modules/.pnpm`. Derived purely from {@link hoistedResolutionDirs}, so a root whose
|
|
11
|
+
* directories are gone yields an empty mapping.
|
|
12
|
+
*
|
|
13
|
+
* The layout is the caller's to check. This reads no `.modules.yaml` and asks no questions about
|
|
14
|
+
* the virtual store: a project-local root would get a mapping too, pointing at the same `@types`
|
|
15
|
+
* its own walk already reaches - unnecessary rather than wrong, but unnecessary is reason enough
|
|
16
|
+
* to keep it out. Callers decide per root, gating on `isGlobalVirtualStoreLayout`, because they
|
|
17
|
+
* are the ones holding several roots and deciding which of them participate.
|
|
18
|
+
*
|
|
19
|
+
* Reads the directories on every call rather than caching them: an install can move a workspace
|
|
20
|
+
* onto the global virtual store mid-process, and the envs compiled right after it would otherwise
|
|
21
|
+
* be handed the layout from before.
|
|
22
|
+
*/
|
|
23
|
+
export declare function globalVirtualStoreTypePaths(root: string): TypePaths;
|
|
24
|
+
/**
|
|
25
|
+
* Merge bridge entries under whatever the env and the component already configured: a specifier
|
|
26
|
+
* someone mapped deliberately keeps its mapping, and the bridge only fills in what would
|
|
27
|
+
* otherwise resolve to nothing.
|
|
28
|
+
*/
|
|
29
|
+
export declare function mergeTypePaths(configured: TypePaths | undefined, bridged: TypePaths): TypePaths;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.globalVirtualStoreTypePaths = globalVirtualStoreTypePaths;
|
|
7
|
+
exports.mergeTypePaths = mergeTypePaths;
|
|
8
|
+
exports.typesDirToSpecifier = typesDirToSpecifier;
|
|
9
|
+
function fs() {
|
|
10
|
+
const data = _interopRequireWildcard(require("fs"));
|
|
11
|
+
fs = function () {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
return data;
|
|
15
|
+
}
|
|
16
|
+
function path() {
|
|
17
|
+
const data = _interopRequireWildcard(require("path"));
|
|
18
|
+
path = function () {
|
|
19
|
+
return data;
|
|
20
|
+
};
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
function _dependencyResolver() {
|
|
24
|
+
const data = require("@teambit/dependency-resolver");
|
|
25
|
+
_dependencyResolver = function () {
|
|
26
|
+
return data;
|
|
27
|
+
};
|
|
28
|
+
return data;
|
|
29
|
+
}
|
|
30
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
31
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
32
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
33
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
34
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
35
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
36
|
+
* The type-resolution half of the hoisted-resolution bridge.
|
|
37
|
+
*
|
|
38
|
+
* `NODE_PATH` and the ESM loader in `@teambit/dependency-resolver`'s
|
|
39
|
+
* `hoisted-resolution-bridge` repair `require`/`import` for packages that live in pnpm's global
|
|
40
|
+
* virtual store. TypeScript reads neither, so under that layout a `.d.ts` in a store slot still
|
|
41
|
+
* cannot reach the workspace's `@types`: it resolves `react` to `react/index.js`, gets no
|
|
42
|
+
* typings, and every type derived from it silently degrades - props lose `children`, generics
|
|
43
|
+
* collapse to `unknown` - long before anything errors out at a place that names the cause.
|
|
44
|
+
*
|
|
45
|
+
* TypeScript's only lever here is `paths`, which is a *redirect* and not the fallback `NODE_PATH`
|
|
46
|
+
* is, so a blanket mapping does real damage: pointing every `@types` package at the bridge
|
|
47
|
+
* directories overrides packages that ship their own typings, and the resolution that used to be
|
|
48
|
+
* a last resort starts winning over a package's declared, newer types. This module maps only what
|
|
49
|
+
* the walk used to find and nothing else:
|
|
50
|
+
*
|
|
51
|
+
* - a `@types/x` mapping only when `x` itself ships no typings. That is the case the walk-up
|
|
52
|
+
* existed for; when `x` is self-typed, the walk stopped at `x` and never reached `@types/x`.
|
|
53
|
+
* - `@teambit/*` from the root's own `node_modules`, never the hoisted directory. Core aspects
|
|
54
|
+
* have to be the single copy from the running installation (the same invariant
|
|
55
|
+
* `DependencyLinker` maintains), and the hoisted directory holds transitive - older - copies
|
|
56
|
+
* that would otherwise win.
|
|
57
|
+
*/
|
|
58
|
+
/**
|
|
59
|
+
* `@types/react` -> `react`, `@types/babel__core` -> `@babel/core`. The double underscore is
|
|
60
|
+
* DefinitelyTyped's mangling for a scope separator, and only the first one is the separator - a
|
|
61
|
+
* package whose own name contains `__` keeps it.
|
|
62
|
+
*/
|
|
63
|
+
function typesDirToSpecifier(dirName) {
|
|
64
|
+
const separator = dirName.indexOf('__');
|
|
65
|
+
if (separator === -1) return dirName;
|
|
66
|
+
return `@${dirName.slice(0, separator)}/${dirName.slice(separator + 2)}`;
|
|
67
|
+
}
|
|
68
|
+
/** Whether an `exports` map declares a `types` condition anywhere in its conditional nesting. */
|
|
69
|
+
function exportsDeclareTypes(exportsField) {
|
|
70
|
+
if (!exportsField || typeof exportsField !== 'object') return false;
|
|
71
|
+
return Object.entries(exportsField).some(([condition, target]) => condition === 'types' || exportsDeclareTypes(target));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Every file an `exports` map points at, at any depth of subpath and condition nesting. */
|
|
75
|
+
function exportTargets(exportsField, collected = []) {
|
|
76
|
+
if (typeof exportsField === 'string') collected.push(exportsField);else if (exportsField && typeof exportsField === 'object') {
|
|
77
|
+
Object.values(exportsField).forEach(target => exportTargets(target, collected));
|
|
78
|
+
}
|
|
79
|
+
return collected;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Every extension a declaration file can carry: `.mjs` is typed by `.d.mts`, `.cjs` by `.d.cts`. */
|
|
83
|
+
const DECLARATION_EXTENSIONS = ['.d.ts', '.d.mts', '.d.cts'];
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The declaration file TypeScript infers from an entry point, which is how a package ships types
|
|
87
|
+
* without saying so: `dist/index.js` is typed by `dist/index.d.ts`, and a directory entry point by
|
|
88
|
+
* an `index.d.ts` inside it.
|
|
89
|
+
*
|
|
90
|
+
* All three extensions are tried against each shape rather than the one paired with the entry's
|
|
91
|
+
* own extension. Being too eager here only skips a mapping; missing one redirects the specifier to
|
|
92
|
+
* `@types` and buries the declarations the package actually ships.
|
|
93
|
+
*/
|
|
94
|
+
function declarationsBesideEntry(packageDir, main) {
|
|
95
|
+
const entry = typeof main === 'string' && main ? main : 'index.js';
|
|
96
|
+
const resolved = path().join(packageDir, entry);
|
|
97
|
+
const withoutExtension = resolved.replace(/\.(js|cjs|mjs|jsx)$/, '');
|
|
98
|
+
return DECLARATION_EXTENSIONS.some(extension => fs().existsSync(`${withoutExtension}${extension}`) || fs().existsSync(path().join(resolved, `index${extension}`)) || fs().existsSync(path().join(packageDir, `index${extension}`)));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Whether the package the specifier names ships typings of its own, judged at the first bridge
|
|
103
|
+
* directory that holds it - the same copy the resolver reaches. A package that is not installed
|
|
104
|
+
* at either counts as untyped: nothing shadows the `@types` mapping in that case.
|
|
105
|
+
*
|
|
106
|
+
* Every form a package can ship types in has to count, because a false negative here is not a
|
|
107
|
+
* missed optimization - it redirects a specifier to `@types` and *overrides* the package's own,
|
|
108
|
+
* usually newer, declarations. `types`/`typings`, a `types` condition in `exports`,
|
|
109
|
+
* `typesVersions`, and the declaration file inferred from an entry point - `main` for the classic
|
|
110
|
+
* resolver, any `exports` target for the modern one - all mean the same thing to the resolver,
|
|
111
|
+
* which reached the package itself and never looked at `@types` at all.
|
|
112
|
+
*/
|
|
113
|
+
function shipsOwnTypes(specifier, dirs) {
|
|
114
|
+
for (const dir of dirs) {
|
|
115
|
+
const packageDir = path().join(dir, specifier);
|
|
116
|
+
let manifest;
|
|
117
|
+
try {
|
|
118
|
+
manifest = JSON.parse(fs().readFileSync(path().join(packageDir, 'package.json'), 'utf8'));
|
|
119
|
+
} catch {
|
|
120
|
+
continue; // not in this directory - keep looking in the next
|
|
121
|
+
}
|
|
122
|
+
if (typeof manifest.types === 'string' || typeof manifest.typings === 'string') return true;
|
|
123
|
+
if (manifest.typesVersions && typeof manifest.typesVersions === 'object') return true;
|
|
124
|
+
if (exportsDeclareTypes(manifest.exports)) return true;
|
|
125
|
+
const entries = [manifest.main, ...exportTargets(manifest.exports)];
|
|
126
|
+
return entries.some(entry => declarationsBesideEntry(packageDir, entry));
|
|
127
|
+
}
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* `paths` entries that let a store slot resolve the types it used to reach by walking up out of
|
|
133
|
+
* `node_modules/.pnpm`. Derived purely from {@link hoistedResolutionDirs}, so a root whose
|
|
134
|
+
* directories are gone yields an empty mapping.
|
|
135
|
+
*
|
|
136
|
+
* The layout is the caller's to check. This reads no `.modules.yaml` and asks no questions about
|
|
137
|
+
* the virtual store: a project-local root would get a mapping too, pointing at the same `@types`
|
|
138
|
+
* its own walk already reaches - unnecessary rather than wrong, but unnecessary is reason enough
|
|
139
|
+
* to keep it out. Callers decide per root, gating on `isGlobalVirtualStoreLayout`, because they
|
|
140
|
+
* are the ones holding several roots and deciding which of them participate.
|
|
141
|
+
*
|
|
142
|
+
* Reads the directories on every call rather than caching them: an install can move a workspace
|
|
143
|
+
* onto the global virtual store mid-process, and the envs compiled right after it would otherwise
|
|
144
|
+
* be handed the layout from before.
|
|
145
|
+
*/
|
|
146
|
+
function globalVirtualStoreTypePaths(root) {
|
|
147
|
+
const dirs = (0, _dependencyResolver().hoistedResolutionDirs)(root);
|
|
148
|
+
if (!dirs.length) return {};
|
|
149
|
+
const paths = {};
|
|
150
|
+
for (const dir of dirs) {
|
|
151
|
+
const typesDir = path().join(dir, '@types');
|
|
152
|
+
let entries;
|
|
153
|
+
try {
|
|
154
|
+
entries = fs().readdirSync(typesDir);
|
|
155
|
+
} catch {
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
for (const entry of entries) {
|
|
159
|
+
const specifier = typesDirToSpecifier(entry);
|
|
160
|
+
// walk order decides: the hoisted directory is reached first, so it keeps the specifier
|
|
161
|
+
if (paths[specifier] || shipsOwnTypes(specifier, dirs)) continue;
|
|
162
|
+
paths[specifier] = [path().join(typesDir, entry)];
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
const coreAspects = path().join(root, 'node_modules', '@teambit');
|
|
166
|
+
if (fs().existsSync(coreAspects)) {
|
|
167
|
+
paths['@teambit/*'] = [path().join(coreAspects, '*')];
|
|
168
|
+
}
|
|
169
|
+
return paths;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Merge bridge entries under whatever the env and the component already configured: a specifier
|
|
174
|
+
* someone mapped deliberately keeps its mapping, and the bridge only fills in what would
|
|
175
|
+
* otherwise resolve to nothing.
|
|
176
|
+
*/
|
|
177
|
+
function mergeTypePaths(configured, bridged) {
|
|
178
|
+
return _objectSpread(_objectSpread({}, bridged), configured);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
//# sourceMappingURL=global-virtual-store-type-paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fs","data","_interopRequireWildcard","require","path","_dependencyResolver","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","typesDirToSpecifier","dirName","separator","indexOf","slice","exportsDeclareTypes","exportsField","entries","some","condition","target","exportTargets","collected","values","DECLARATION_EXTENSIONS","declarationsBesideEntry","packageDir","main","entry","resolved","join","withoutExtension","replace","extension","existsSync","shipsOwnTypes","specifier","dirs","dir","manifest","JSON","parse","readFileSync","types","typings","typesVersions","exports","globalVirtualStoreTypePaths","root","hoistedResolutionDirs","paths","typesDir","readdirSync","coreAspects","mergeTypePaths","configured","bridged"],"sources":["global-virtual-store-type-paths.ts"],"sourcesContent":["/**\n * The type-resolution half of the hoisted-resolution bridge.\n *\n * `NODE_PATH` and the ESM loader in `@teambit/dependency-resolver`'s\n * `hoisted-resolution-bridge` repair `require`/`import` for packages that live in pnpm's global\n * virtual store. TypeScript reads neither, so under that layout a `.d.ts` in a store slot still\n * cannot reach the workspace's `@types`: it resolves `react` to `react/index.js`, gets no\n * typings, and every type derived from it silently degrades - props lose `children`, generics\n * collapse to `unknown` - long before anything errors out at a place that names the cause.\n *\n * TypeScript's only lever here is `paths`, which is a *redirect* and not the fallback `NODE_PATH`\n * is, so a blanket mapping does real damage: pointing every `@types` package at the bridge\n * directories overrides packages that ship their own typings, and the resolution that used to be\n * a last resort starts winning over a package's declared, newer types. This module maps only what\n * the walk used to find and nothing else:\n *\n * - a `@types/x` mapping only when `x` itself ships no typings. That is the case the walk-up\n * existed for; when `x` is self-typed, the walk stopped at `x` and never reached `@types/x`.\n * - `@teambit/*` from the root's own `node_modules`, never the hoisted directory. Core aspects\n * have to be the single copy from the running installation (the same invariant\n * `DependencyLinker` maintains), and the hoisted directory holds transitive - older - copies\n * that would otherwise win.\n */\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { hoistedResolutionDirs } from '@teambit/dependency-resolver';\n\nexport type TypePaths = Record<string, string[]>;\n\n/**\n * `@types/react` -> `react`, `@types/babel__core` -> `@babel/core`. The double underscore is\n * DefinitelyTyped's mangling for a scope separator, and only the first one is the separator - a\n * package whose own name contains `__` keeps it.\n */\nexport function typesDirToSpecifier(dirName: string): string {\n const separator = dirName.indexOf('__');\n if (separator === -1) return dirName;\n return `@${dirName.slice(0, separator)}/${dirName.slice(separator + 2)}`;\n}\n\ntype PackageManifest = {\n types?: unknown;\n typings?: unknown;\n typesVersions?: unknown;\n exports?: unknown;\n main?: unknown;\n};\n\n/** Whether an `exports` map declares a `types` condition anywhere in its conditional nesting. */\nfunction exportsDeclareTypes(exportsField: unknown): boolean {\n if (!exportsField || typeof exportsField !== 'object') return false;\n return Object.entries(exportsField as Record<string, unknown>).some(\n ([condition, target]) => condition === 'types' || exportsDeclareTypes(target)\n );\n}\n\n/** Every file an `exports` map points at, at any depth of subpath and condition nesting. */\nfunction exportTargets(exportsField: unknown, collected: string[] = []): string[] {\n if (typeof exportsField === 'string') collected.push(exportsField);\n else if (exportsField && typeof exportsField === 'object') {\n Object.values(exportsField as Record<string, unknown>).forEach((target) => exportTargets(target, collected));\n }\n return collected;\n}\n\n/** Every extension a declaration file can carry: `.mjs` is typed by `.d.mts`, `.cjs` by `.d.cts`. */\nconst DECLARATION_EXTENSIONS = ['.d.ts', '.d.mts', '.d.cts'];\n\n/**\n * The declaration file TypeScript infers from an entry point, which is how a package ships types\n * without saying so: `dist/index.js` is typed by `dist/index.d.ts`, and a directory entry point by\n * an `index.d.ts` inside it.\n *\n * All three extensions are tried against each shape rather than the one paired with the entry's\n * own extension. Being too eager here only skips a mapping; missing one redirects the specifier to\n * `@types` and buries the declarations the package actually ships.\n */\nfunction declarationsBesideEntry(packageDir: string, main: unknown): boolean {\n const entry = typeof main === 'string' && main ? main : 'index.js';\n const resolved = path.join(packageDir, entry);\n const withoutExtension = resolved.replace(/\\.(js|cjs|mjs|jsx)$/, '');\n return DECLARATION_EXTENSIONS.some(\n (extension) =>\n fs.existsSync(`${withoutExtension}${extension}`) ||\n fs.existsSync(path.join(resolved, `index${extension}`)) ||\n fs.existsSync(path.join(packageDir, `index${extension}`))\n );\n}\n\n/**\n * Whether the package the specifier names ships typings of its own, judged at the first bridge\n * directory that holds it - the same copy the resolver reaches. A package that is not installed\n * at either counts as untyped: nothing shadows the `@types` mapping in that case.\n *\n * Every form a package can ship types in has to count, because a false negative here is not a\n * missed optimization - it redirects a specifier to `@types` and *overrides* the package's own,\n * usually newer, declarations. `types`/`typings`, a `types` condition in `exports`,\n * `typesVersions`, and the declaration file inferred from an entry point - `main` for the classic\n * resolver, any `exports` target for the modern one - all mean the same thing to the resolver,\n * which reached the package itself and never looked at `@types` at all.\n */\nfunction shipsOwnTypes(specifier: string, dirs: string[]): boolean {\n for (const dir of dirs) {\n const packageDir = path.join(dir, specifier);\n let manifest: PackageManifest;\n try {\n manifest = JSON.parse(fs.readFileSync(path.join(packageDir, 'package.json'), 'utf8'));\n } catch {\n continue; // not in this directory - keep looking in the next\n }\n if (typeof manifest.types === 'string' || typeof manifest.typings === 'string') return true;\n if (manifest.typesVersions && typeof manifest.typesVersions === 'object') return true;\n if (exportsDeclareTypes(manifest.exports)) return true;\n const entries = [manifest.main, ...exportTargets(manifest.exports)];\n return entries.some((entry) => declarationsBesideEntry(packageDir, entry));\n }\n return false;\n}\n\n/**\n * `paths` entries that let a store slot resolve the types it used to reach by walking up out of\n * `node_modules/.pnpm`. Derived purely from {@link hoistedResolutionDirs}, so a root whose\n * directories are gone yields an empty mapping.\n *\n * The layout is the caller's to check. This reads no `.modules.yaml` and asks no questions about\n * the virtual store: a project-local root would get a mapping too, pointing at the same `@types`\n * its own walk already reaches - unnecessary rather than wrong, but unnecessary is reason enough\n * to keep it out. Callers decide per root, gating on `isGlobalVirtualStoreLayout`, because they\n * are the ones holding several roots and deciding which of them participate.\n *\n * Reads the directories on every call rather than caching them: an install can move a workspace\n * onto the global virtual store mid-process, and the envs compiled right after it would otherwise\n * be handed the layout from before.\n */\nexport function globalVirtualStoreTypePaths(root: string): TypePaths {\n const dirs = hoistedResolutionDirs(root);\n if (!dirs.length) return {};\n const paths: TypePaths = {};\n for (const dir of dirs) {\n const typesDir = path.join(dir, '@types');\n let entries: string[];\n try {\n entries = fs.readdirSync(typesDir);\n } catch {\n continue;\n }\n for (const entry of entries) {\n const specifier = typesDirToSpecifier(entry);\n // walk order decides: the hoisted directory is reached first, so it keeps the specifier\n if (paths[specifier] || shipsOwnTypes(specifier, dirs)) continue;\n paths[specifier] = [path.join(typesDir, entry)];\n }\n }\n const coreAspects = path.join(root, 'node_modules', '@teambit');\n if (fs.existsSync(coreAspects)) {\n paths['@teambit/*'] = [path.join(coreAspects, '*')];\n }\n return paths;\n}\n\n/**\n * Merge bridge entries under whatever the env and the component already configured: a specifier\n * someone mapped deliberately keeps its mapping, and the bridge only fills in what would\n * otherwise resolve to nothing.\n */\nexport function mergeTypePaths(configured: TypePaths | undefined, bridged: TypePaths): TypePaths {\n return { ...bridged, ...configured };\n}\n"],"mappings":";;;;;;;;AAuBA,SAAAA,GAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,EAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,KAAA;EAAA,MAAAH,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,oBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,mBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAqE,SAAAC,wBAAAI,CAAA,EAAAC,CAAA,6BAA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AC,CAAC,MAAM;MACN;IACF;IACA,KAAK,MAAMvB,KAAK,IAAIX,OAAO,EAAE;MAC3B,MAAMmB,SAAS,GAAG1B,mBAAmB,CAACkB,KAAK,CAAC;MAC5C;MACA,IAAIsB,KAAK,CAACd,SAAS,CAAC,IAAID,aAAa,CAACC,SAAS,EAAEC,IAAI,CAAC,EAAE;MACxDa,KAAK,CAACd,SAAS,CAAC,GAAG,CAACvE,IAAI,CAAD,CAAC,CAACiE,IAAI,CAACqB,QAAQ,EAAEvB,KAAK,CAAC,CAAC;IACjD;EACF;EACA,MAAMyB,WAAW,GAAGxF,IAAI,CAAD,CAAC,CAACiE,IAAI,CAACkB,IAAI,EAAE,cAAc,EAAE,UAAU,CAAC;EAC/D,IAAIvF,EAAE,CAAD,CAAC,CAACyE,UAAU,CAACmB,WAAW,CAAC,EAAE;IAC9BH,KAAK,CAAC,YAAY,CAAC,GAAG,CAACrF,IAAI,CAAD,CAAC,CAACiE,IAAI,CAACuB,WAAW,EAAE,GAAG,CAAC,CAAC;EACrD;EACA,OAAOH,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASI,cAAcA,CAACC,UAAiC,EAAEC,OAAkB,EAAa;EAC/F,OAAA/D,aAAA,CAAAA,aAAA,KAAY+D,OAAO,GAAKD,UAAU;AACpC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _chai() {
|
|
4
|
+
const data = require("chai");
|
|
5
|
+
_chai = function () {
|
|
6
|
+
return data;
|
|
7
|
+
};
|
|
8
|
+
return data;
|
|
9
|
+
}
|
|
10
|
+
function _fsExtra() {
|
|
11
|
+
const data = _interopRequireDefault(require("fs-extra"));
|
|
12
|
+
_fsExtra = function () {
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
function _os() {
|
|
18
|
+
const data = _interopRequireDefault(require("os"));
|
|
19
|
+
_os = function () {
|
|
20
|
+
return data;
|
|
21
|
+
};
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
24
|
+
function _path() {
|
|
25
|
+
const data = _interopRequireDefault(require("path"));
|
|
26
|
+
_path = function () {
|
|
27
|
+
return data;
|
|
28
|
+
};
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
function _globalVirtualStoreTypePaths() {
|
|
32
|
+
const data = require("./global-virtual-store-type-paths");
|
|
33
|
+
_globalVirtualStoreTypePaths = function () {
|
|
34
|
+
return data;
|
|
35
|
+
};
|
|
36
|
+
return data;
|
|
37
|
+
}
|
|
38
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
39
|
+
describe('typesDirToSpecifier()', () => {
|
|
40
|
+
it('should leave an unscoped name alone', () => {
|
|
41
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().typesDirToSpecifier)('react')).to.eq('react');
|
|
42
|
+
});
|
|
43
|
+
it('should unmangle a scoped name', () => {
|
|
44
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().typesDirToSpecifier)('babel__core')).to.eq('@babel/core');
|
|
45
|
+
});
|
|
46
|
+
it('should treat only the first separator as the scope separator', () => {
|
|
47
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().typesDirToSpecifier)('scope__pkg__name')).to.eq('@scope/pkg__name');
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
describe('globalVirtualStoreTypePaths()', () => {
|
|
51
|
+
let root;
|
|
52
|
+
const hoisted = () => _path().default.join(root, 'node_modules', '.pnpm', 'node_modules');
|
|
53
|
+
const write = (dir, manifest, files = []) => {
|
|
54
|
+
_fsExtra().default.ensureDirSync(dir);
|
|
55
|
+
if (manifest) _fsExtra().default.writeJsonSync(_path().default.join(dir, 'package.json'), manifest);
|
|
56
|
+
files.forEach(file => _fsExtra().default.outputFileSync(_path().default.join(dir, file), ''));
|
|
57
|
+
};
|
|
58
|
+
beforeEach(() => {
|
|
59
|
+
root = _fsExtra().default.mkdtempSync(_path().default.join(_os().default.tmpdir(), 'gvs-type-paths-'));
|
|
60
|
+
_fsExtra().default.ensureDirSync(_path().default.join(root, 'node_modules'));
|
|
61
|
+
});
|
|
62
|
+
afterEach(() => _fsExtra().default.removeSync(root));
|
|
63
|
+
it('should map a @types package whose runtime package ships no typings', () => {
|
|
64
|
+
write(_path().default.join(root, 'node_modules', '@types', 'react'), {
|
|
65
|
+
name: '@types/react'
|
|
66
|
+
});
|
|
67
|
+
write(_path().default.join(root, 'node_modules', 'react'), {
|
|
68
|
+
name: 'react',
|
|
69
|
+
main: 'index.js'
|
|
70
|
+
});
|
|
71
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(root).react).to.deep.eq([_path().default.join(root, 'node_modules', '@types', 'react')]);
|
|
72
|
+
});
|
|
73
|
+
it('should not map a package that ships typings through the types field', () => {
|
|
74
|
+
write(_path().default.join(root, 'node_modules', '@types', 'glob'), {
|
|
75
|
+
name: '@types/glob'
|
|
76
|
+
});
|
|
77
|
+
write(_path().default.join(root, 'node_modules', 'glob'), {
|
|
78
|
+
name: 'glob',
|
|
79
|
+
types: './dist/index.d.ts'
|
|
80
|
+
});
|
|
81
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(root)).to.not.have.property('glob');
|
|
82
|
+
});
|
|
83
|
+
it('should not map a package that ships an implicit index.d.ts', () => {
|
|
84
|
+
write(_path().default.join(root, 'node_modules', '@types', 'chalk'), {
|
|
85
|
+
name: '@types/chalk'
|
|
86
|
+
});
|
|
87
|
+
write(_path().default.join(root, 'node_modules', 'chalk'), {
|
|
88
|
+
name: 'chalk'
|
|
89
|
+
}, ['index.d.ts']);
|
|
90
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(root)).to.not.have.property('chalk');
|
|
91
|
+
});
|
|
92
|
+
it('should not map a package whose declarations sit beside a nested entry point', () => {
|
|
93
|
+
write(_path().default.join(root, 'node_modules', '@types', 'nested'), {
|
|
94
|
+
name: '@types/nested'
|
|
95
|
+
});
|
|
96
|
+
write(_path().default.join(root, 'node_modules', 'nested'), {
|
|
97
|
+
name: 'nested',
|
|
98
|
+
main: 'dist/index.js'
|
|
99
|
+
}, ['dist/index.d.ts']);
|
|
100
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(root)).to.not.have.property('nested');
|
|
101
|
+
});
|
|
102
|
+
it('should not map a package whose entry point is a directory with an index.d.ts', () => {
|
|
103
|
+
write(_path().default.join(root, 'node_modules', '@types', 'dir-entry'), {
|
|
104
|
+
name: '@types/dir-entry'
|
|
105
|
+
});
|
|
106
|
+
write(_path().default.join(root, 'node_modules', 'dir-entry'), {
|
|
107
|
+
name: 'dir-entry',
|
|
108
|
+
main: './lib'
|
|
109
|
+
}, ['lib/index.d.ts']);
|
|
110
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(root)).to.not.have.property('dir-entry');
|
|
111
|
+
});
|
|
112
|
+
it('should not map a package whose declarations carry the esm extension', () => {
|
|
113
|
+
write(_path().default.join(root, 'node_modules', '@types', 'esm-typed'), {
|
|
114
|
+
name: '@types/esm-typed'
|
|
115
|
+
});
|
|
116
|
+
write(_path().default.join(root, 'node_modules', 'esm-typed'), {
|
|
117
|
+
name: 'esm-typed',
|
|
118
|
+
main: 'dist/index.mjs'
|
|
119
|
+
}, ['dist/index.d.mts']);
|
|
120
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(root)).to.not.have.property('esm-typed');
|
|
121
|
+
});
|
|
122
|
+
it('should not map a package whose declarations carry the cjs extension', () => {
|
|
123
|
+
write(_path().default.join(root, 'node_modules', '@types', 'cjs-typed'), {
|
|
124
|
+
name: '@types/cjs-typed'
|
|
125
|
+
});
|
|
126
|
+
write(_path().default.join(root, 'node_modules', 'cjs-typed'), {
|
|
127
|
+
name: 'cjs-typed',
|
|
128
|
+
main: 'dist/index.cjs'
|
|
129
|
+
}, ['dist/index.d.cts']);
|
|
130
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(root)).to.not.have.property('cjs-typed');
|
|
131
|
+
});
|
|
132
|
+
it('should not map a package whose declarations sit beside an export target', () => {
|
|
133
|
+
// no `types` condition and no `main`: the modern resolver infers the declarations from the
|
|
134
|
+
// target it picked, and so does this
|
|
135
|
+
write(_path().default.join(root, 'node_modules', '@types', 'export-typed'), {
|
|
136
|
+
name: '@types/export-typed'
|
|
137
|
+
});
|
|
138
|
+
write(_path().default.join(root, 'node_modules', 'export-typed'), {
|
|
139
|
+
name: 'export-typed',
|
|
140
|
+
exports: {
|
|
141
|
+
'.': {
|
|
142
|
+
import: './dist/index.mjs'
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
_fsExtra().default.outputFileSync(_path().default.join(root, 'node_modules', 'export-typed', 'dist', 'index.d.mts'), '');
|
|
147
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(root)).to.not.have.property('export-typed');
|
|
148
|
+
});
|
|
149
|
+
it('should not map a package that declares types through a conditional export', () => {
|
|
150
|
+
write(_path().default.join(root, 'node_modules', '@types', 'exported'), {
|
|
151
|
+
name: '@types/exported'
|
|
152
|
+
});
|
|
153
|
+
write(_path().default.join(root, 'node_modules', 'exported'), {
|
|
154
|
+
name: 'exported',
|
|
155
|
+
exports: {
|
|
156
|
+
'.': {
|
|
157
|
+
import: {
|
|
158
|
+
types: './dist/index.d.ts',
|
|
159
|
+
default: './dist/index.js'
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(root)).to.not.have.property('exported');
|
|
165
|
+
});
|
|
166
|
+
it('should not map a package that ships types through typesVersions', () => {
|
|
167
|
+
write(_path().default.join(root, 'node_modules', '@types', 'versioned'), {
|
|
168
|
+
name: '@types/versioned'
|
|
169
|
+
});
|
|
170
|
+
write(_path().default.join(root, 'node_modules', 'versioned'), {
|
|
171
|
+
name: 'versioned',
|
|
172
|
+
typesVersions: {
|
|
173
|
+
'>=4.0': {
|
|
174
|
+
'*': ['types/*']
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(root)).to.not.have.property('versioned');
|
|
179
|
+
});
|
|
180
|
+
it('should still map a package that only ships javascript beside its entry point', () => {
|
|
181
|
+
write(_path().default.join(root, 'node_modules', '@types', 'plain'), {
|
|
182
|
+
name: '@types/plain'
|
|
183
|
+
});
|
|
184
|
+
write(_path().default.join(root, 'node_modules', 'plain'), {
|
|
185
|
+
name: 'plain',
|
|
186
|
+
main: 'dist/index.js'
|
|
187
|
+
}, ['dist/index.js']);
|
|
188
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(root)).to.have.property('plain');
|
|
189
|
+
});
|
|
190
|
+
it('should map a @types package whose runtime package is not installed at all', () => {
|
|
191
|
+
write(_path().default.join(root, 'node_modules', '@types', 'node'), {
|
|
192
|
+
name: '@types/node'
|
|
193
|
+
});
|
|
194
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(root)).to.have.property('node');
|
|
195
|
+
});
|
|
196
|
+
it('should unmangle a scoped @types directory into its specifier', () => {
|
|
197
|
+
write(_path().default.join(root, 'node_modules', '@types', 'babel__core'), {
|
|
198
|
+
name: '@types/babel__core'
|
|
199
|
+
});
|
|
200
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(root)['@babel/core']).to.deep.eq([_path().default.join(root, 'node_modules', '@types', 'babel__core')]);
|
|
201
|
+
});
|
|
202
|
+
it('should let the hoisted directory win a specifier, as the walk out of .pnpm reached it first', () => {
|
|
203
|
+
write(_path().default.join(hoisted(), '@types', 'semver'), {
|
|
204
|
+
name: '@types/semver'
|
|
205
|
+
});
|
|
206
|
+
write(_path().default.join(root, 'node_modules', '@types', 'semver'), {
|
|
207
|
+
name: '@types/semver'
|
|
208
|
+
});
|
|
209
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(root).semver).to.deep.eq([_path().default.join(hoisted(), '@types', 'semver')]);
|
|
210
|
+
});
|
|
211
|
+
it('should map @teambit only to the root, never to the hoisted copies of core aspects', () => {
|
|
212
|
+
write(_path().default.join(hoisted(), '@teambit', 'harmony'), {
|
|
213
|
+
name: '@teambit/harmony'
|
|
214
|
+
});
|
|
215
|
+
write(_path().default.join(root, 'node_modules', '@teambit', 'harmony'), {
|
|
216
|
+
name: '@teambit/harmony'
|
|
217
|
+
});
|
|
218
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(root)['@teambit/*']).to.deep.eq([_path().default.join(root, 'node_modules', '@teambit', '*')]);
|
|
219
|
+
});
|
|
220
|
+
it('should return nothing for a root with no node_modules', () => {
|
|
221
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(_path().default.join(root, 'nope'))).to.deep.eq({});
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
describe('mergeTypePaths()', () => {
|
|
225
|
+
it('should keep a configured mapping over the bridged one', () => {
|
|
226
|
+
const merged = (0, _globalVirtualStoreTypePaths().mergeTypePaths)({
|
|
227
|
+
react: ['/configured']
|
|
228
|
+
}, {
|
|
229
|
+
react: ['/bridged'],
|
|
230
|
+
semver: ['/bridged']
|
|
231
|
+
});
|
|
232
|
+
(0, _chai().expect)(merged).to.deep.eq({
|
|
233
|
+
react: ['/configured'],
|
|
234
|
+
semver: ['/bridged']
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
it('should work with no configured paths at all', () => {
|
|
238
|
+
(0, _chai().expect)((0, _globalVirtualStoreTypePaths().mergeTypePaths)(undefined, {
|
|
239
|
+
react: ['/bridged']
|
|
240
|
+
})).to.deep.eq({
|
|
241
|
+
react: ['/bridged']
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
//# sourceMappingURL=global-virtual-store-type-paths.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_chai","data","require","_fsExtra","_interopRequireDefault","_os","_path","_globalVirtualStoreTypePaths","e","__esModule","default","describe","it","expect","typesDirToSpecifier","to","eq","root","hoisted","path","join","write","dir","manifest","files","fs","ensureDirSync","writeJsonSync","forEach","file","outputFileSync","beforeEach","mkdtempSync","os","tmpdir","afterEach","removeSync","name","main","globalVirtualStoreTypePaths","react","deep","types","not","have","property","exports","import","typesVersions","semver","merged","mergeTypePaths","undefined"],"sources":["global-virtual-store-type-paths.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport fs from 'fs-extra';\nimport os from 'os';\nimport path from 'path';\nimport { globalVirtualStoreTypePaths, mergeTypePaths, typesDirToSpecifier } from './global-virtual-store-type-paths';\n\ndescribe('typesDirToSpecifier()', () => {\n it('should leave an unscoped name alone', () => {\n expect(typesDirToSpecifier('react')).to.eq('react');\n });\n it('should unmangle a scoped name', () => {\n expect(typesDirToSpecifier('babel__core')).to.eq('@babel/core');\n });\n it('should treat only the first separator as the scope separator', () => {\n expect(typesDirToSpecifier('scope__pkg__name')).to.eq('@scope/pkg__name');\n });\n});\n\ndescribe('globalVirtualStoreTypePaths()', () => {\n let root: string;\n const hoisted = () => path.join(root, 'node_modules', '.pnpm', 'node_modules');\n const write = (dir: string, manifest?: Record<string, unknown>, files: string[] = []) => {\n fs.ensureDirSync(dir);\n if (manifest) fs.writeJsonSync(path.join(dir, 'package.json'), manifest);\n files.forEach((file) => fs.outputFileSync(path.join(dir, file), ''));\n };\n\n beforeEach(() => {\n root = fs.mkdtempSync(path.join(os.tmpdir(), 'gvs-type-paths-'));\n fs.ensureDirSync(path.join(root, 'node_modules'));\n });\n afterEach(() => fs.removeSync(root));\n\n it('should map a @types package whose runtime package ships no typings', () => {\n write(path.join(root, 'node_modules', '@types', 'react'), { name: '@types/react' });\n write(path.join(root, 'node_modules', 'react'), { name: 'react', main: 'index.js' });\n expect(globalVirtualStoreTypePaths(root).react).to.deep.eq([path.join(root, 'node_modules', '@types', 'react')]);\n });\n\n it('should not map a package that ships typings through the types field', () => {\n write(path.join(root, 'node_modules', '@types', 'glob'), { name: '@types/glob' });\n write(path.join(root, 'node_modules', 'glob'), { name: 'glob', types: './dist/index.d.ts' });\n expect(globalVirtualStoreTypePaths(root)).to.not.have.property('glob');\n });\n\n it('should not map a package that ships an implicit index.d.ts', () => {\n write(path.join(root, 'node_modules', '@types', 'chalk'), { name: '@types/chalk' });\n write(path.join(root, 'node_modules', 'chalk'), { name: 'chalk' }, ['index.d.ts']);\n expect(globalVirtualStoreTypePaths(root)).to.not.have.property('chalk');\n });\n\n it('should not map a package whose declarations sit beside a nested entry point', () => {\n write(path.join(root, 'node_modules', '@types', 'nested'), { name: '@types/nested' });\n write(path.join(root, 'node_modules', 'nested'), { name: 'nested', main: 'dist/index.js' }, ['dist/index.d.ts']);\n expect(globalVirtualStoreTypePaths(root)).to.not.have.property('nested');\n });\n\n it('should not map a package whose entry point is a directory with an index.d.ts', () => {\n write(path.join(root, 'node_modules', '@types', 'dir-entry'), { name: '@types/dir-entry' });\n write(path.join(root, 'node_modules', 'dir-entry'), { name: 'dir-entry', main: './lib' }, ['lib/index.d.ts']);\n expect(globalVirtualStoreTypePaths(root)).to.not.have.property('dir-entry');\n });\n\n it('should not map a package whose declarations carry the esm extension', () => {\n write(path.join(root, 'node_modules', '@types', 'esm-typed'), { name: '@types/esm-typed' });\n write(path.join(root, 'node_modules', 'esm-typed'), { name: 'esm-typed', main: 'dist/index.mjs' }, [\n 'dist/index.d.mts',\n ]);\n expect(globalVirtualStoreTypePaths(root)).to.not.have.property('esm-typed');\n });\n\n it('should not map a package whose declarations carry the cjs extension', () => {\n write(path.join(root, 'node_modules', '@types', 'cjs-typed'), { name: '@types/cjs-typed' });\n write(path.join(root, 'node_modules', 'cjs-typed'), { name: 'cjs-typed', main: 'dist/index.cjs' }, [\n 'dist/index.d.cts',\n ]);\n expect(globalVirtualStoreTypePaths(root)).to.not.have.property('cjs-typed');\n });\n\n it('should not map a package whose declarations sit beside an export target', () => {\n // no `types` condition and no `main`: the modern resolver infers the declarations from the\n // target it picked, and so does this\n write(path.join(root, 'node_modules', '@types', 'export-typed'), { name: '@types/export-typed' });\n write(path.join(root, 'node_modules', 'export-typed'), {\n name: 'export-typed',\n exports: { '.': { import: './dist/index.mjs' } },\n });\n fs.outputFileSync(path.join(root, 'node_modules', 'export-typed', 'dist', 'index.d.mts'), '');\n expect(globalVirtualStoreTypePaths(root)).to.not.have.property('export-typed');\n });\n\n it('should not map a package that declares types through a conditional export', () => {\n write(path.join(root, 'node_modules', '@types', 'exported'), { name: '@types/exported' });\n write(path.join(root, 'node_modules', 'exported'), {\n name: 'exported',\n exports: { '.': { import: { types: './dist/index.d.ts', default: './dist/index.js' } } },\n });\n expect(globalVirtualStoreTypePaths(root)).to.not.have.property('exported');\n });\n\n it('should not map a package that ships types through typesVersions', () => {\n write(path.join(root, 'node_modules', '@types', 'versioned'), { name: '@types/versioned' });\n write(path.join(root, 'node_modules', 'versioned'), {\n name: 'versioned',\n typesVersions: { '>=4.0': { '*': ['types/*'] } },\n });\n expect(globalVirtualStoreTypePaths(root)).to.not.have.property('versioned');\n });\n\n it('should still map a package that only ships javascript beside its entry point', () => {\n write(path.join(root, 'node_modules', '@types', 'plain'), { name: '@types/plain' });\n write(path.join(root, 'node_modules', 'plain'), { name: 'plain', main: 'dist/index.js' }, ['dist/index.js']);\n expect(globalVirtualStoreTypePaths(root)).to.have.property('plain');\n });\n\n it('should map a @types package whose runtime package is not installed at all', () => {\n write(path.join(root, 'node_modules', '@types', 'node'), { name: '@types/node' });\n expect(globalVirtualStoreTypePaths(root)).to.have.property('node');\n });\n\n it('should unmangle a scoped @types directory into its specifier', () => {\n write(path.join(root, 'node_modules', '@types', 'babel__core'), { name: '@types/babel__core' });\n expect(globalVirtualStoreTypePaths(root)['@babel/core']).to.deep.eq([\n path.join(root, 'node_modules', '@types', 'babel__core'),\n ]);\n });\n\n it('should let the hoisted directory win a specifier, as the walk out of .pnpm reached it first', () => {\n write(path.join(hoisted(), '@types', 'semver'), { name: '@types/semver' });\n write(path.join(root, 'node_modules', '@types', 'semver'), { name: '@types/semver' });\n expect(globalVirtualStoreTypePaths(root).semver).to.deep.eq([path.join(hoisted(), '@types', 'semver')]);\n });\n\n it('should map @teambit only to the root, never to the hoisted copies of core aspects', () => {\n write(path.join(hoisted(), '@teambit', 'harmony'), { name: '@teambit/harmony' });\n write(path.join(root, 'node_modules', '@teambit', 'harmony'), { name: '@teambit/harmony' });\n expect(globalVirtualStoreTypePaths(root)['@teambit/*']).to.deep.eq([\n path.join(root, 'node_modules', '@teambit', '*'),\n ]);\n });\n\n it('should return nothing for a root with no node_modules', () => {\n expect(globalVirtualStoreTypePaths(path.join(root, 'nope'))).to.deep.eq({});\n });\n});\n\ndescribe('mergeTypePaths()', () => {\n it('should keep a configured mapping over the bridged one', () => {\n const merged = mergeTypePaths({ react: ['/configured'] }, { react: ['/bridged'], semver: ['/bridged'] });\n expect(merged).to.deep.eq({ react: ['/configured'], semver: ['/bridged'] });\n });\n it('should work with no configured paths at all', () => {\n expect(mergeTypePaths(undefined, { react: ['/bridged'] })).to.deep.eq({ react: ['/bridged'] });\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;E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UAAU,EAAE,GAAG,CAAC,CACjD,CAAC;EACJ,CAAC,CAAC;EAEFL,EAAE,CAAC,uDAAuD,EAAE,MAAM;IAChE,IAAAC,cAAM,EAAC,IAAA0B,0DAA2B,EAACpB,eAAI,CAACC,IAAI,CAACH,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAACF,EAAE,CAAC0B,IAAI,CAACzB,EAAE,CAAC,CAAC,CAAC,CAAC;EAC7E,CAAC,CAAC;AACJ,CAAC,CAAC;AAEFL,QAAQ,CAAC,kBAAkB,EAAE,MAAM;EACjCC,EAAE,CAAC,uDAAuD,EAAE,MAAM;IAChE,MAAMsC,MAAM,GAAG,IAAAC,6CAAc,EAAC;MAAEX,KAAK,EAAE,CAAC,aAAa;IAAE,CAAC,EAAE;MAAEA,KAAK,EAAE,CAAC,UAAU,CAAC;MAAES,MAAM,EAAE,CAAC,UAAU;IAAE,CAAC,CAAC;IACxG,IAAApC,cAAM,EAACqC,MAAM,CAAC,CAACnC,EAAE,CAAC0B,IAAI,CAACzB,EAAE,CAAC;MAAEwB,KAAK,EAAE,CAAC,aAAa,CAAC;MAAES,MAAM,EAAE,CAAC,UAAU;IAAE,CAAC,CAAC;EAC7E,CAAC,CAAC;EACFrC,EAAE,CAAC,6CAA6C,EAAE,MAAM;IACtD,IAAAC,cAAM,EAAC,IAAAsC,6CAAc,EAACC,SAAS,EAAE;MAAEZ,KAAK,EAAE,CAAC,UAAU;IAAE,CAAC,CAAC,CAAC,CAACzB,EAAE,CAAC0B,IAAI,CAACzB,EAAE,CAAC;MAAEwB,KAAK,EAAE,CAAC,UAAU;IAAE,CAAC,CAAC;EAChG,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.1099/dist/typescript.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.typescript_typescript@1.0.1099/dist/typescript.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -45,6 +45,17 @@ export declare class TypescriptMain {
|
|
|
45
45
|
* create a new compiler.
|
|
46
46
|
*/
|
|
47
47
|
createCompiler(options: TypeScriptCompilerOptions, transformers?: TsConfigTransformer[], tsModule?: typeof ts): Compiler;
|
|
48
|
+
/**
|
|
49
|
+
* Give the compiled program the types a store slot can no longer reach by walking up. Applied
|
|
50
|
+
* last, after every transformer, so it sees the final `paths` and yields to anything configured
|
|
51
|
+
* there. See `./global-virtual-store-type-paths`.
|
|
52
|
+
*
|
|
53
|
+
* Two roots, each gated on the layout its own last install recorded, and both for the same
|
|
54
|
+
* reason the runtime bridge covers both: the workspace, whose components are what gets compiled,
|
|
55
|
+
* and the running installation, whose core aspects the compiled program reaches through the
|
|
56
|
+
* links `DependencyLinker` writes. A bvm installation is project-local and stays out.
|
|
57
|
+
*/
|
|
58
|
+
private bridgeTypeResolution;
|
|
48
59
|
/**
|
|
49
60
|
* get TsserverClient instance if initiated already, otherwise, return undefined.
|
|
50
61
|
*/
|
|
@@ -61,6 +61,13 @@ function _dependencyResolver() {
|
|
|
61
61
|
};
|
|
62
62
|
return data;
|
|
63
63
|
}
|
|
64
|
+
function _globalVirtualStoreTypePaths() {
|
|
65
|
+
const data = require("./global-virtual-store-type-paths");
|
|
66
|
+
_globalVirtualStoreTypePaths = function () {
|
|
67
|
+
return data;
|
|
68
|
+
};
|
|
69
|
+
return data;
|
|
70
|
+
}
|
|
64
71
|
function _pMapSeries() {
|
|
65
72
|
const data = _interopRequireDefault(require("p-map-series"));
|
|
66
73
|
_pMapSeries = function () {
|
|
@@ -201,7 +208,32 @@ class TypescriptMain {
|
|
|
201
208
|
const afterMutationWithoutTsconfig = _objectSpread(_objectSpread({}, afterMutation.raw), {}, {
|
|
202
209
|
tsconfig: ''
|
|
203
210
|
});
|
|
204
|
-
return new (_typescript2().TypescriptCompiler)(_typescript4().TypescriptAspect.id, this.logger, afterMutationWithoutTsconfig, afterMutation.raw.tsconfig, tsModule);
|
|
211
|
+
return new (_typescript2().TypescriptCompiler)(_typescript4().TypescriptAspect.id, this.logger, afterMutationWithoutTsconfig, this.bridgeTypeResolution(afterMutation.raw.tsconfig), tsModule);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Give the compiled program the types a store slot can no longer reach by walking up. Applied
|
|
216
|
+
* last, after every transformer, so it sees the final `paths` and yields to anything configured
|
|
217
|
+
* there. See `./global-virtual-store-type-paths`.
|
|
218
|
+
*
|
|
219
|
+
* Two roots, each gated on the layout its own last install recorded, and both for the same
|
|
220
|
+
* reason the runtime bridge covers both: the workspace, whose components are what gets compiled,
|
|
221
|
+
* and the running installation, whose core aspects the compiled program reaches through the
|
|
222
|
+
* links `DependencyLinker` writes. A bvm installation is project-local and stays out.
|
|
223
|
+
*/
|
|
224
|
+
bridgeTypeResolution(tsconfig) {
|
|
225
|
+
const roots = [this.workspace?.path, (0, _dependencyResolver().selfInstallationRoot)()].filter((root, index, all) => Boolean(root) && all.indexOf(root) === index);
|
|
226
|
+
const bridged = roots.filter(root => (0, _dependencyResolver().isGlobalVirtualStoreLayout)(root)).map(root => (0, _globalVirtualStoreTypePaths().globalVirtualStoreTypePaths)(root));
|
|
227
|
+
if (!bridged.length) return tsconfig;
|
|
228
|
+
// workspace first: where both roots map a specifier, the workspace's copy is the one its
|
|
229
|
+
// components already compile against
|
|
230
|
+
const merged = bridged.reduceRight((acc, paths) => _objectSpread(_objectSpread({}, acc), paths), {});
|
|
231
|
+
if (!Object.keys(merged).length) return tsconfig;
|
|
232
|
+
const compilerOptions = _objectSpread({}, tsconfig?.compilerOptions);
|
|
233
|
+
compilerOptions.paths = (0, _globalVirtualStoreTypePaths().mergeTypePaths)(compilerOptions.paths, merged);
|
|
234
|
+
return _objectSpread(_objectSpread({}, tsconfig), {}, {
|
|
235
|
+
compilerOptions
|
|
236
|
+
});
|
|
205
237
|
}
|
|
206
238
|
|
|
207
239
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_typescript","data","_interopRequireDefault","require","_harmony","_cli","_logger","_schema","_typescriptModules","_workspace","_dependencyResolver","_pMapSeries","_tsServer","_typescript2","_aspectLoader","_watcher","_builder","_envs","_scope","_lodash","_typescript3","_typescript4","_typescript5","_schemaTransformer","_transformers","_checkTypes","_removeTypesTask","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","TypescriptMain","constructor","logger","schemaTransformerSlot","apiTransformerSlot","workspace","scope","depResolver","envs","aspectLoader","createCompiler","options","transformers","tsModule","ts","configMutator","TypescriptConfigMutator","transformerContext","afterMutation","runTransformersWithContext","clone","afterMutationWithoutTsconfig","raw","tsconfig","TypescriptCompiler","TypescriptAspect","id","getTsserverClient","tsServer","registerSchemaTransformer","register","registerApiTransformer","initTsserverClient","projectPath","files","TsserverClient","init","initTsserverClientFromWorkspace","Error","path","createCjsCompiler","getCjsTransformer","createEsmCompiler","getEsmTransformer","cjsTransformer","config","setModule","esmTransformer","setTarget","compilerOptions","module","lib","getAllTransformers","transformersFunc","Array","from","values","map","transformer","isArray","flat","createSchemaExtractor","tsserverPath","contextPath","schemaTransformers","apiTransformers","includeFiles","schemaTransformersFromSlot","apiTransformersFromSlot","flatten","allSchemaTransformers","concat","allApiTransformers","TypeScriptExtractor","getCjsPackageJsonProps","main","types","getEsmPackageJsonProps","type","getSupportedFilesForTsserver","components","c","filesystem","f","endsWith","onPreWatch","componentIds","watchOpts","spawnTSServer","verbose","checkTypes","getMany","printTypeErrors","Boolean","onComponentChange","component","results","pMapSeries","file","onFileChange","provider","schema","loggerExt","cli","watcher","builder","registerParser","TypeScriptParser","createLogger","registerPlugins","SchemaTransformerPlugin","tsMain","ExportDeclarationTransformer","ExportAssignmentTransformer","FunctionLikeTransformer","ParameterTransformer","SetAccessorTransformer","GetAccessorTransformer","IndexSignatureTransformer","PropertyDeclarationTransformer","VariableStatementTransformer","VariableDeclaration","SourceFileTransformer","TypeAliasTransformer","ClassDeclarationTransformer","InterfaceDeclarationTransformer","EnumDeclarationTransformer","BindingElementTransformer","IntersectionTypeTransformer","UnionTypeTransformer","TypeReferenceTransformer","TypeLiteralTransformer","LiteralTypeTransformer","TypeQueryTransformer","ArrayTypeTransformer","TypeOperatorTransformer","KeywordTypeTransformer","TupleTypeTransformer","ParenthesizedTypeTransformer","TypePredicateTransformer","IndexedAccessTypeTransformer","TemplateLiteralTypeSpanTransformer","TemplateLiteralTypeTransformer","ThisTypeTransformer","ConditionalTypeTransformer","NamedTupleTransformer","ConstructorTransformer","ImportDeclarationTransformer","ExpressionStatementTransformer","ModuleDeclarationTransformer","DecoratorTransformer","ObjectLiteralExpressionTransformer","ArrayLiteralExpressionTransformer","PropertyAssignmentTransformer","LiteralValueTransformer","registerOnPreWatch","bind","registerOnComponentChange","registerOnComponentAdd","removeTypesTask","RemoveTypesTask","registerSnapTasks","registerTagTasks","checkTypesCmd","CheckTypesCmd","exports","MainRuntime","SchemaAspect","LoggerAspect","AspectLoaderAspect","WorkspaceAspect","CLIAspect","DependencyResolverAspect","EnvsAspect","WatcherAspect","ScopeAspect","BuilderAspect","Slot","withType","addRuntime","context","newConfig","reduce","acc","_default"],"sources":["typescript.main.runtime.ts"],"sourcesContent":["import ts from 'typescript';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { Slot } from '@teambit/harmony';\nimport type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport type { Compiler } from '@teambit/compiler';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { SchemaExtractor, SchemaMain } from '@teambit/schema';\nimport { SchemaAspect } from '@teambit/schema';\nimport type { PackageJsonProps } from '@teambit/pkg';\nimport { TypescriptConfigMutator } from '@teambit/typescript.modules.ts-config-mutator';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport type { Workspace } from '@teambit/workspace';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { DependencyResolverAspect } from '@teambit/dependency-resolver';\nimport pMapSeries from 'p-map-series';\nimport type { TsserverClientOpts } from '@teambit/ts-server';\nimport { TsserverClient } from '@teambit/ts-server';\nimport { TypescriptCompiler } from '@teambit/typescript.typescript-compiler';\nimport type { AspectLoaderMain } from '@teambit/aspect-loader';\nimport { AspectLoaderAspect } from '@teambit/aspect-loader';\nimport type { WatcherMain, WatchOptions } from '@teambit/watcher';\nimport { WatcherAspect } from '@teambit/watcher';\nimport type { Component, ComponentID } from '@teambit/component';\nimport type { BuilderMain } from '@teambit/builder';\nimport { BuilderAspect } from '@teambit/builder';\nimport type { EnvsMain } from '@teambit/envs';\nimport { EnvsAspect } from '@teambit/envs';\nimport type { ScopeMain } from '@teambit/scope';\nimport { ScopeAspect } from '@teambit/scope';\nimport { flatten } from 'lodash';\nimport { TypeScriptExtractor } from './typescript.extractor';\nimport type { TypeScriptCompilerOptions } from './compiler-options';\nimport { TypescriptAspect } from './typescript.aspect';\nimport { TypeScriptParser } from './typescript.parser';\nimport type { SchemaNodeTransformer, SchemaTransformer } from './schema-transformer';\nimport { SchemaTransformerPlugin } from './schema-transformer.plugin';\nimport {\n ExportDeclarationTransformer,\n TypeAliasTransformer,\n FunctionLikeTransformer,\n SetAccessorTransformer,\n GetAccessorTransformer,\n IndexSignatureTransformer,\n PropertyDeclarationTransformer,\n ParameterTransformer,\n VariableStatementTransformer,\n VariableDeclaration,\n SourceFileTransformer,\n ClassDeclarationTransformer,\n InterfaceDeclarationTransformer,\n EnumDeclarationTransformer,\n BindingElementTransformer,\n ExportAssignmentTransformer,\n ImportDeclarationTransformer,\n IntersectionTypeTransformer,\n UnionTypeTransformer,\n TypeReferenceTransformer,\n TypeLiteralTransformer,\n LiteralTypeTransformer,\n TypeQueryTransformer,\n ArrayTypeTransformer,\n TypeOperatorTransformer,\n KeywordTypeTransformer,\n TupleTypeTransformer,\n ParenthesizedTypeTransformer,\n TypePredicateTransformer,\n IndexedAccessTypeTransformer,\n TemplateLiteralTypeSpanTransformer,\n TemplateLiteralTypeTransformer,\n ThisTypeTransformer,\n ConditionalTypeTransformer,\n NamedTupleTransformer,\n ConstructorTransformer,\n ExpressionStatementTransformer,\n ModuleDeclarationTransformer,\n ObjectLiteralExpressionTransformer,\n ArrayLiteralExpressionTransformer,\n PropertyAssignmentTransformer,\n DecoratorTransformer,\n LiteralValueTransformer,\n} from './transformers';\nimport { CheckTypesCmd } from './cmds/check-types.cmd';\nimport { RemoveTypesTask } from './remove-types-task';\n\nexport type TsMode = 'build' | 'dev';\n\nexport type SchemaTransformerSlot = SlotRegistry<() => SchemaTransformer[]>;\nexport type APITransformerSlot = SlotRegistry<SchemaNodeTransformer[]>;\n\nexport type TsConfigTransformContext = {\n // mode: TsMode;\n};\n\nexport type TsconfigWriterOptions = {\n clean?: boolean;\n silent?: boolean; // no prompt\n dedupe?: boolean;\n dryRun?: boolean;\n dryRunWithTsconfig?: boolean;\n};\n\nexport type TsConfigTransformer = (\n config: TypescriptConfigMutator,\n context: TsConfigTransformContext\n) => TypescriptConfigMutator;\n\nexport class TypescriptMain {\n constructor(\n private logger: Logger,\n readonly schemaTransformerSlot: SchemaTransformerSlot,\n readonly apiTransformerSlot: APITransformerSlot,\n readonly workspace: Workspace,\n readonly scope: ScopeMain,\n readonly depResolver: DependencyResolverMain,\n private envs: EnvsMain,\n private aspectLoader: AspectLoaderMain\n ) {}\n\n private tsServer: TsserverClient;\n /**\n * create a new compiler.\n */\n createCompiler(\n options: TypeScriptCompilerOptions,\n transformers: TsConfigTransformer[] = [],\n tsModule = ts\n ): Compiler {\n const configMutator = new TypescriptConfigMutator(options);\n const transformerContext: TsConfigTransformContext = {};\n const afterMutation = runTransformersWithContext(configMutator.clone(), transformers, transformerContext);\n const afterMutationWithoutTsconfig = { ...afterMutation.raw, tsconfig: '' };\n\n return new TypescriptCompiler(\n TypescriptAspect.id,\n this.logger,\n afterMutationWithoutTsconfig,\n afterMutation.raw.tsconfig,\n tsModule as any\n );\n }\n\n /**\n * get TsserverClient instance if initiated already, otherwise, return undefined.\n */\n getTsserverClient(): TsserverClient | undefined {\n return this.tsServer;\n }\n\n registerSchemaTransformer(transformers: () => SchemaTransformer[]) {\n this.schemaTransformerSlot.register(transformers);\n return this;\n }\n\n registerApiTransformer(transformers: SchemaNodeTransformer[]) {\n this.apiTransformerSlot.register(transformers);\n return this;\n }\n\n /**\n * starts a tsserver process to communicate with its API.\n * @param projectPath absolute path of the project root directory\n * @param options TsserverClientOpts\n * @param files optionally, if check-types is enabled, provide files to open and type check.\n * @returns TsserverClient\n */\n async initTsserverClient(\n projectPath: string,\n options: TsserverClientOpts = {},\n files: string[] = []\n ): Promise<TsserverClient> {\n this.tsServer = new TsserverClient(projectPath, this.logger, options, files);\n await this.tsServer.init();\n return this.tsServer;\n }\n\n /**\n * starts a tsserver process to communicate with its API. use only when running on the workspace.\n * @param options TsserverClientOpts\n * @param files optionally, if check-types is enabled, provide files to open and type check.\n * @returns TsserverClient\n */\n async initTsserverClientFromWorkspace(\n options: TsserverClientOpts = {},\n files: string[] = []\n ): Promise<TsserverClient> {\n if (!this.workspace) {\n throw new Error(`initTsserverClientFromWorkspace: workspace was not found`);\n }\n return this.initTsserverClient(this.workspace.path, options, files);\n }\n\n /**\n * Create a compiler instance and run the cjs transformer for it\n * @param options\n * @param transformers\n * @param tsModule\n * @returns\n */\n createCjsCompiler(options: TypeScriptCompilerOptions, transformers: TsConfigTransformer[] = [], tsModule = ts) {\n return this.createCompiler(options, [this.getCjsTransformer(), ...transformers], tsModule);\n }\n\n /**\n * Create a compiler instance and run the esm transformer for it\n * @param options\n * @param transformers\n * @param tsModule\n * @returns\n */\n createEsmCompiler(options: TypeScriptCompilerOptions, transformers: TsConfigTransformer[] = [], tsModule = ts) {\n return this.createCompiler(options, [this.getEsmTransformer(), ...transformers], tsModule);\n }\n\n /**\n * Create a transformer that change the ts module to CommonJS\n * @returns\n */\n getCjsTransformer(): TsConfigTransformer {\n const cjsTransformer = (config: TypescriptConfigMutator) => {\n config.setModule('CommonJS');\n return config;\n };\n return cjsTransformer;\n }\n\n /**\n * Create a transformer that change the ts module to ES2020\n * @returns\n */\n getEsmTransformer(): TsConfigTransformer {\n const esmTransformer = (config: TypescriptConfigMutator) => {\n config.setTarget('ES2017');\n config.raw.tsconfig.compilerOptions.module = 'es2020';\n config.raw.tsconfig.compilerOptions.lib = ['es2021', 'dom', 'ESNext.String', 'dom.Iterable'];\n return config;\n };\n return esmTransformer;\n }\n\n getAllTransformers(): SchemaTransformer[] {\n const transformersFunc = Array.from(this.schemaTransformerSlot.values());\n // backward compatibility for transformers that are not wrapped with a function (bit < 1.9.80)\n return transformersFunc.map((transformer) => (Array.isArray(transformer) ? transformer : transformer())).flat();\n }\n\n /**\n * create an instance of a typescript semantic schema extractor.\n */\n createSchemaExtractor(\n tsconfig: any,\n tsserverPath?: string,\n contextPath?: string,\n schemaTransformers: SchemaTransformer[] = [],\n apiTransformers: SchemaNodeTransformer[] = [],\n includeFiles: string[] = []\n ): SchemaExtractor {\n const schemaTransformersFromSlot = this.getAllTransformers();\n const apiTransformersFromSlot = flatten(Array.from(this.apiTransformerSlot.values()));\n\n const allSchemaTransformers = schemaTransformers.concat(schemaTransformersFromSlot);\n const allApiTransformers = apiTransformers.concat(apiTransformersFromSlot);\n\n return new TypeScriptExtractor(\n tsconfig,\n allSchemaTransformers,\n allApiTransformers,\n this,\n tsserverPath || this.workspace?.path || '',\n contextPath || this.workspace?.path || '',\n this.depResolver,\n this.workspace,\n this.scope,\n this.aspectLoader,\n this.logger,\n includeFiles\n );\n }\n\n /**\n * add the default package json properties to the component\n * :TODO @gilad why do we need this DSL? can't I just get the args here.\n */\n getCjsPackageJsonProps(): PackageJsonProps {\n return {\n main: 'dist/{main}.js',\n types: '{main}.ts',\n };\n }\n\n /**\n * add type: module to the package.json props and the default props\n * :TODO @gilad why do we need this DSL? can't I just get the args here.\n */\n getEsmPackageJsonProps(): PackageJsonProps {\n return {\n // main: 'dist-esm/{main}.js',\n main: 'dist/{main}.js',\n type: 'module',\n types: '{main}.ts',\n };\n }\n\n getSupportedFilesForTsserver(components: Component[]): string[] {\n const files = components\n .map((c) => c.filesystem.files)\n .flat()\n .map((f) => f.path);\n return files.filter((f) => f.endsWith('.ts') || f.endsWith('.tsx'));\n }\n\n private async onPreWatch(componentIds: ComponentID[], watchOpts: WatchOptions) {\n const workspace = this.workspace;\n if (!workspace || !watchOpts.spawnTSServer) {\n return;\n }\n const { verbose, checkTypes } = watchOpts;\n const files = checkTypes ? this.getSupportedFilesForTsserver(await workspace.getMany(componentIds)) : [];\n const printTypeErrors = Boolean(checkTypes);\n await this.initTsserverClientFromWorkspace({ verbose, checkTypes, printTypeErrors }, files);\n }\n\n private async onComponentChange(component: Component, files: string[]) {\n if (!this.tsServer) {\n return {\n results: 'N/A',\n };\n }\n await pMapSeries(files, (file) => this.tsServer.onFileChange(file));\n return {\n results: 'succeed',\n };\n }\n\n static runtime = MainRuntime;\n static dependencies = [\n SchemaAspect,\n LoggerAspect,\n AspectLoaderAspect,\n WorkspaceAspect,\n CLIAspect,\n DependencyResolverAspect,\n EnvsAspect,\n WatcherAspect,\n ScopeAspect,\n BuilderAspect,\n ];\n static slots = [Slot.withType<SchemaTransformer[]>(), Slot.withType<SchemaNodeTransformer[]>()];\n\n static async provider(\n [schema, loggerExt, aspectLoader, workspace, cli, depResolver, envs, watcher, scope, builder]: [\n SchemaMain,\n LoggerMain,\n AspectLoaderMain,\n Workspace,\n CLIMain,\n DependencyResolverMain,\n EnvsMain,\n WatcherMain,\n ScopeMain,\n BuilderMain,\n ],\n config,\n [schemaTransformerSlot, apiTransformerSlot]: [SchemaTransformerSlot, APITransformerSlot]\n ) {\n schema.registerParser(new TypeScriptParser());\n const logger = loggerExt.createLogger(TypescriptAspect.id);\n\n aspectLoader.registerPlugins([new SchemaTransformerPlugin(schemaTransformerSlot)]);\n const tsMain = new TypescriptMain(\n logger,\n schemaTransformerSlot,\n apiTransformerSlot,\n workspace,\n scope,\n depResolver,\n envs,\n aspectLoader\n );\n tsMain.registerSchemaTransformer(() => [\n new ExportDeclarationTransformer(),\n new ExportAssignmentTransformer(),\n new FunctionLikeTransformer(),\n new ParameterTransformer(),\n new SetAccessorTransformer(),\n new GetAccessorTransformer(),\n new IndexSignatureTransformer(),\n new PropertyDeclarationTransformer(),\n new VariableStatementTransformer(),\n new VariableDeclaration(),\n new SourceFileTransformer(),\n new TypeAliasTransformer(),\n new ClassDeclarationTransformer(),\n new InterfaceDeclarationTransformer(),\n new EnumDeclarationTransformer(),\n new BindingElementTransformer(),\n new IntersectionTypeTransformer(),\n new UnionTypeTransformer(),\n new TypeReferenceTransformer(),\n new TypeLiteralTransformer(),\n new LiteralTypeTransformer(),\n new TypeQueryTransformer(),\n new ArrayTypeTransformer(),\n new TypeOperatorTransformer(),\n new KeywordTypeTransformer(),\n new TupleTypeTransformer(),\n new ParenthesizedTypeTransformer(),\n new TypePredicateTransformer(),\n new IndexedAccessTypeTransformer(),\n new TemplateLiteralTypeSpanTransformer(),\n new TemplateLiteralTypeTransformer(),\n new ThisTypeTransformer(),\n new ConditionalTypeTransformer(),\n new NamedTupleTransformer(),\n new ConstructorTransformer(),\n new ImportDeclarationTransformer(),\n new ExpressionStatementTransformer(),\n new ModuleDeclarationTransformer(),\n new DecoratorTransformer(),\n new ObjectLiteralExpressionTransformer(),\n new ArrayLiteralExpressionTransformer(),\n new PropertyAssignmentTransformer(),\n new LiteralValueTransformer(),\n ]);\n\n if (workspace) {\n watcher.registerOnPreWatch(tsMain.onPreWatch.bind(tsMain));\n workspace.registerOnComponentChange(tsMain.onComponentChange.bind(tsMain));\n workspace.registerOnComponentAdd(tsMain.onComponentChange.bind(tsMain));\n }\n\n const removeTypesTask = new RemoveTypesTask();\n builder.registerSnapTasks([removeTypesTask]);\n builder.registerTagTasks([removeTypesTask]);\n\n const checkTypesCmd = new CheckTypesCmd(tsMain, workspace, logger);\n cli.register(checkTypesCmd);\n\n return tsMain;\n }\n}\n\nTypescriptAspect.addRuntime(TypescriptMain);\n\nexport function runTransformersWithContext(\n config: TypescriptConfigMutator,\n transformers: TsConfigTransformer[] = [],\n context: TsConfigTransformContext\n): TypescriptConfigMutator {\n if (!Array.isArray(transformers)) return config;\n const newConfig = transformers.reduce((acc, transformer) => {\n return transformer(acc, context);\n }, config);\n return newConfig;\n}\n\nexport default TypescriptMain;\n"],"mappings":";;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA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Ac,CAAC;AAEpC,SAASmB,0BAA0BA,CACxC0B,MAA+B,EAC/BjC,YAAmC,GAAG,EAAE,EACxCwK,OAAiC,EACR;EACzB,IAAI,CAAC9H,KAAK,CAACK,OAAO,CAAC/C,YAAY,CAAC,EAAE,OAAOiC,MAAM;EAC/C,MAAMwI,SAAS,GAAGzK,YAAY,CAAC0K,MAAM,CAAC,CAACC,GAAG,EAAE7H,WAAW,KAAK;IAC1D,OAAOA,WAAW,CAAC6H,GAAG,EAAEH,OAAO,CAAC;EAClC,CAAC,EAAEvI,MAAM,CAAC;EACV,OAAOwI,SAAS;AAClB;AAAC,IAAAG,QAAA,GAAAnB,OAAA,CAAAtM,OAAA,GAEciC,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_typescript","data","_interopRequireDefault","require","_harmony","_cli","_logger","_schema","_typescriptModules","_workspace","_dependencyResolver","_globalVirtualStoreTypePaths","_pMapSeries","_tsServer","_typescript2","_aspectLoader","_watcher","_builder","_envs","_scope","_lodash","_typescript3","_typescript4","_typescript5","_schemaTransformer","_transformers","_checkTypes","_removeTypesTask","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","TypescriptMain","constructor","logger","schemaTransformerSlot","apiTransformerSlot","workspace","scope","depResolver","envs","aspectLoader","createCompiler","options","transformers","tsModule","ts","configMutator","TypescriptConfigMutator","transformerContext","afterMutation","runTransformersWithContext","clone","afterMutationWithoutTsconfig","raw","tsconfig","TypescriptCompiler","TypescriptAspect","id","bridgeTypeResolution","roots","path","selfInstallationRoot","root","index","all","Boolean","indexOf","bridged","isGlobalVirtualStoreLayout","map","globalVirtualStoreTypePaths","merged","reduceRight","acc","paths","compilerOptions","mergeTypePaths","getTsserverClient","tsServer","registerSchemaTransformer","register","registerApiTransformer","initTsserverClient","projectPath","files","TsserverClient","init","initTsserverClientFromWorkspace","Error","createCjsCompiler","getCjsTransformer","createEsmCompiler","getEsmTransformer","cjsTransformer","config","setModule","esmTransformer","setTarget","module","lib","getAllTransformers","transformersFunc","Array","from","values","transformer","isArray","flat","createSchemaExtractor","tsserverPath","contextPath","schemaTransformers","apiTransformers","includeFiles","schemaTransformersFromSlot","apiTransformersFromSlot","flatten","allSchemaTransformers","concat","allApiTransformers","TypeScriptExtractor","getCjsPackageJsonProps","main","types","getEsmPackageJsonProps","type","getSupportedFilesForTsserver","components","c","filesystem","f","endsWith","onPreWatch","componentIds","watchOpts","spawnTSServer","verbose","checkTypes","getMany","printTypeErrors","onComponentChange","component","results","pMapSeries","file","onFileChange","provider","schema","loggerExt","cli","watcher","builder","registerParser","TypeScriptParser","createLogger","registerPlugins","SchemaTransformerPlugin","tsMain","ExportDeclarationTransformer","ExportAssignmentTransformer","FunctionLikeTransformer","ParameterTransformer","SetAccessorTransformer","GetAccessorTransformer","IndexSignatureTransformer","PropertyDeclarationTransformer","VariableStatementTransformer","VariableDeclaration","SourceFileTransformer","TypeAliasTransformer","ClassDeclarationTransformer","InterfaceDeclarationTransformer","EnumDeclarationTransformer","BindingElementTransformer","IntersectionTypeTransformer","UnionTypeTransformer","TypeReferenceTransformer","TypeLiteralTransformer","LiteralTypeTransformer","TypeQueryTransformer","ArrayTypeTransformer","TypeOperatorTransformer","KeywordTypeTransformer","TupleTypeTransformer","ParenthesizedTypeTransformer","TypePredicateTransformer","IndexedAccessTypeTransformer","TemplateLiteralTypeSpanTransformer","TemplateLiteralTypeTransformer","ThisTypeTransformer","ConditionalTypeTransformer","NamedTupleTransformer","ConstructorTransformer","ImportDeclarationTransformer","ExpressionStatementTransformer","ModuleDeclarationTransformer","DecoratorTransformer","ObjectLiteralExpressionTransformer","ArrayLiteralExpressionTransformer","PropertyAssignmentTransformer","LiteralValueTransformer","registerOnPreWatch","bind","registerOnComponentChange","registerOnComponentAdd","removeTypesTask","RemoveTypesTask","registerSnapTasks","registerTagTasks","checkTypesCmd","CheckTypesCmd","exports","MainRuntime","SchemaAspect","LoggerAspect","AspectLoaderAspect","WorkspaceAspect","CLIAspect","DependencyResolverAspect","EnvsAspect","WatcherAspect","ScopeAspect","BuilderAspect","Slot","withType","addRuntime","context","newConfig","reduce","_default"],"sources":["typescript.main.runtime.ts"],"sourcesContent":["import ts from 'typescript';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { Slot } from '@teambit/harmony';\nimport type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport type { Compiler } from '@teambit/compiler';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { SchemaExtractor, SchemaMain } from '@teambit/schema';\nimport { SchemaAspect } from '@teambit/schema';\nimport type { PackageJsonProps } from '@teambit/pkg';\nimport { TypescriptConfigMutator } from '@teambit/typescript.modules.ts-config-mutator';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport type { Workspace } from '@teambit/workspace';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport {\n DependencyResolverAspect,\n isGlobalVirtualStoreLayout,\n selfInstallationRoot,\n} from '@teambit/dependency-resolver';\nimport { globalVirtualStoreTypePaths, mergeTypePaths } from './global-virtual-store-type-paths';\nimport pMapSeries from 'p-map-series';\nimport type { TsserverClientOpts } from '@teambit/ts-server';\nimport { TsserverClient } from '@teambit/ts-server';\nimport { TypescriptCompiler } from '@teambit/typescript.typescript-compiler';\nimport type { AspectLoaderMain } from '@teambit/aspect-loader';\nimport { AspectLoaderAspect } from '@teambit/aspect-loader';\nimport type { WatcherMain, WatchOptions } from '@teambit/watcher';\nimport { WatcherAspect } from '@teambit/watcher';\nimport type { Component, ComponentID } from '@teambit/component';\nimport type { BuilderMain } from '@teambit/builder';\nimport { BuilderAspect } from '@teambit/builder';\nimport type { EnvsMain } from '@teambit/envs';\nimport { EnvsAspect } from '@teambit/envs';\nimport type { ScopeMain } from '@teambit/scope';\nimport { ScopeAspect } from '@teambit/scope';\nimport { flatten } from 'lodash';\nimport { TypeScriptExtractor } from './typescript.extractor';\nimport type { TypeScriptCompilerOptions } from './compiler-options';\nimport { TypescriptAspect } from './typescript.aspect';\nimport { TypeScriptParser } from './typescript.parser';\nimport type { SchemaNodeTransformer, SchemaTransformer } from './schema-transformer';\nimport { SchemaTransformerPlugin } from './schema-transformer.plugin';\nimport {\n ExportDeclarationTransformer,\n TypeAliasTransformer,\n FunctionLikeTransformer,\n SetAccessorTransformer,\n GetAccessorTransformer,\n IndexSignatureTransformer,\n PropertyDeclarationTransformer,\n ParameterTransformer,\n VariableStatementTransformer,\n VariableDeclaration,\n SourceFileTransformer,\n ClassDeclarationTransformer,\n InterfaceDeclarationTransformer,\n EnumDeclarationTransformer,\n BindingElementTransformer,\n ExportAssignmentTransformer,\n ImportDeclarationTransformer,\n IntersectionTypeTransformer,\n UnionTypeTransformer,\n TypeReferenceTransformer,\n TypeLiteralTransformer,\n LiteralTypeTransformer,\n TypeQueryTransformer,\n ArrayTypeTransformer,\n TypeOperatorTransformer,\n KeywordTypeTransformer,\n TupleTypeTransformer,\n ParenthesizedTypeTransformer,\n TypePredicateTransformer,\n IndexedAccessTypeTransformer,\n TemplateLiteralTypeSpanTransformer,\n TemplateLiteralTypeTransformer,\n ThisTypeTransformer,\n ConditionalTypeTransformer,\n NamedTupleTransformer,\n ConstructorTransformer,\n ExpressionStatementTransformer,\n ModuleDeclarationTransformer,\n ObjectLiteralExpressionTransformer,\n ArrayLiteralExpressionTransformer,\n PropertyAssignmentTransformer,\n DecoratorTransformer,\n LiteralValueTransformer,\n} from './transformers';\nimport { CheckTypesCmd } from './cmds/check-types.cmd';\nimport { RemoveTypesTask } from './remove-types-task';\n\nexport type TsMode = 'build' | 'dev';\n\nexport type SchemaTransformerSlot = SlotRegistry<() => SchemaTransformer[]>;\nexport type APITransformerSlot = SlotRegistry<SchemaNodeTransformer[]>;\n\nexport type TsConfigTransformContext = {\n // mode: TsMode;\n};\n\nexport type TsconfigWriterOptions = {\n clean?: boolean;\n silent?: boolean; // no prompt\n dedupe?: boolean;\n dryRun?: boolean;\n dryRunWithTsconfig?: boolean;\n};\n\nexport type TsConfigTransformer = (\n config: TypescriptConfigMutator,\n context: TsConfigTransformContext\n) => TypescriptConfigMutator;\n\nexport class TypescriptMain {\n constructor(\n private logger: Logger,\n readonly schemaTransformerSlot: SchemaTransformerSlot,\n readonly apiTransformerSlot: APITransformerSlot,\n readonly workspace: Workspace,\n readonly scope: ScopeMain,\n readonly depResolver: DependencyResolverMain,\n private envs: EnvsMain,\n private aspectLoader: AspectLoaderMain\n ) {}\n\n private tsServer: TsserverClient;\n /**\n * create a new compiler.\n */\n createCompiler(\n options: TypeScriptCompilerOptions,\n transformers: TsConfigTransformer[] = [],\n tsModule = ts\n ): Compiler {\n const configMutator = new TypescriptConfigMutator(options);\n const transformerContext: TsConfigTransformContext = {};\n const afterMutation = runTransformersWithContext(configMutator.clone(), transformers, transformerContext);\n const afterMutationWithoutTsconfig = { ...afterMutation.raw, tsconfig: '' };\n\n return new TypescriptCompiler(\n TypescriptAspect.id,\n this.logger,\n afterMutationWithoutTsconfig,\n this.bridgeTypeResolution(afterMutation.raw.tsconfig),\n tsModule as any\n );\n }\n\n /**\n * Give the compiled program the types a store slot can no longer reach by walking up. Applied\n * last, after every transformer, so it sees the final `paths` and yields to anything configured\n * there. See `./global-virtual-store-type-paths`.\n *\n * Two roots, each gated on the layout its own last install recorded, and both for the same\n * reason the runtime bridge covers both: the workspace, whose components are what gets compiled,\n * and the running installation, whose core aspects the compiled program reaches through the\n * links `DependencyLinker` writes. A bvm installation is project-local and stays out.\n */\n private bridgeTypeResolution(tsconfig: any): any {\n const roots = [this.workspace?.path, selfInstallationRoot()].filter(\n (root, index, all): root is string => Boolean(root) && all.indexOf(root) === index\n );\n const bridged = roots\n .filter((root) => isGlobalVirtualStoreLayout(root))\n .map((root) => globalVirtualStoreTypePaths(root));\n if (!bridged.length) return tsconfig;\n // workspace first: where both roots map a specifier, the workspace's copy is the one its\n // components already compile against\n const merged = bridged.reduceRight((acc, paths) => ({ ...acc, ...paths }), {});\n if (!Object.keys(merged).length) return tsconfig;\n const compilerOptions = { ...tsconfig?.compilerOptions };\n compilerOptions.paths = mergeTypePaths(compilerOptions.paths, merged);\n return { ...tsconfig, compilerOptions };\n }\n\n /**\n * get TsserverClient instance if initiated already, otherwise, return undefined.\n */\n getTsserverClient(): TsserverClient | undefined {\n return this.tsServer;\n }\n\n registerSchemaTransformer(transformers: () => SchemaTransformer[]) {\n this.schemaTransformerSlot.register(transformers);\n return this;\n }\n\n registerApiTransformer(transformers: SchemaNodeTransformer[]) {\n this.apiTransformerSlot.register(transformers);\n return this;\n }\n\n /**\n * starts a tsserver process to communicate with its API.\n * @param projectPath absolute path of the project root directory\n * @param options TsserverClientOpts\n * @param files optionally, if check-types is enabled, provide files to open and type check.\n * @returns TsserverClient\n */\n async initTsserverClient(\n projectPath: string,\n options: TsserverClientOpts = {},\n files: string[] = []\n ): Promise<TsserverClient> {\n this.tsServer = new TsserverClient(projectPath, this.logger, options, files);\n await this.tsServer.init();\n return this.tsServer;\n }\n\n /**\n * starts a tsserver process to communicate with its API. use only when running on the workspace.\n * @param options TsserverClientOpts\n * @param files optionally, if check-types is enabled, provide files to open and type check.\n * @returns TsserverClient\n */\n async initTsserverClientFromWorkspace(\n options: TsserverClientOpts = {},\n files: string[] = []\n ): Promise<TsserverClient> {\n if (!this.workspace) {\n throw new Error(`initTsserverClientFromWorkspace: workspace was not found`);\n }\n return this.initTsserverClient(this.workspace.path, options, files);\n }\n\n /**\n * Create a compiler instance and run the cjs transformer for it\n * @param options\n * @param transformers\n * @param tsModule\n * @returns\n */\n createCjsCompiler(options: TypeScriptCompilerOptions, transformers: TsConfigTransformer[] = [], tsModule = ts) {\n return this.createCompiler(options, [this.getCjsTransformer(), ...transformers], tsModule);\n }\n\n /**\n * Create a compiler instance and run the esm transformer for it\n * @param options\n * @param transformers\n * @param tsModule\n * @returns\n */\n createEsmCompiler(options: TypeScriptCompilerOptions, transformers: TsConfigTransformer[] = [], tsModule = ts) {\n return this.createCompiler(options, [this.getEsmTransformer(), ...transformers], tsModule);\n }\n\n /**\n * Create a transformer that change the ts module to CommonJS\n * @returns\n */\n getCjsTransformer(): TsConfigTransformer {\n const cjsTransformer = (config: TypescriptConfigMutator) => {\n config.setModule('CommonJS');\n return config;\n };\n return cjsTransformer;\n }\n\n /**\n * Create a transformer that change the ts module to ES2020\n * @returns\n */\n getEsmTransformer(): TsConfigTransformer {\n const esmTransformer = (config: TypescriptConfigMutator) => {\n config.setTarget('ES2017');\n config.raw.tsconfig.compilerOptions.module = 'es2020';\n config.raw.tsconfig.compilerOptions.lib = ['es2021', 'dom', 'ESNext.String', 'dom.Iterable'];\n return config;\n };\n return esmTransformer;\n }\n\n getAllTransformers(): SchemaTransformer[] {\n const transformersFunc = Array.from(this.schemaTransformerSlot.values());\n // backward compatibility for transformers that are not wrapped with a function (bit < 1.9.80)\n return transformersFunc.map((transformer) => (Array.isArray(transformer) ? transformer : transformer())).flat();\n }\n\n /**\n * create an instance of a typescript semantic schema extractor.\n */\n createSchemaExtractor(\n tsconfig: any,\n tsserverPath?: string,\n contextPath?: string,\n schemaTransformers: SchemaTransformer[] = [],\n apiTransformers: SchemaNodeTransformer[] = [],\n includeFiles: string[] = []\n ): SchemaExtractor {\n const schemaTransformersFromSlot = this.getAllTransformers();\n const apiTransformersFromSlot = flatten(Array.from(this.apiTransformerSlot.values()));\n\n const allSchemaTransformers = schemaTransformers.concat(schemaTransformersFromSlot);\n const allApiTransformers = apiTransformers.concat(apiTransformersFromSlot);\n\n return new TypeScriptExtractor(\n tsconfig,\n allSchemaTransformers,\n allApiTransformers,\n this,\n tsserverPath || this.workspace?.path || '',\n contextPath || this.workspace?.path || '',\n this.depResolver,\n this.workspace,\n this.scope,\n this.aspectLoader,\n this.logger,\n includeFiles\n );\n }\n\n /**\n * add the default package json properties to the component\n * :TODO @gilad why do we need this DSL? can't I just get the args here.\n */\n getCjsPackageJsonProps(): PackageJsonProps {\n return {\n main: 'dist/{main}.js',\n types: '{main}.ts',\n };\n }\n\n /**\n * add type: module to the package.json props and the default props\n * :TODO @gilad why do we need this DSL? can't I just get the args here.\n */\n getEsmPackageJsonProps(): PackageJsonProps {\n return {\n // main: 'dist-esm/{main}.js',\n main: 'dist/{main}.js',\n type: 'module',\n types: '{main}.ts',\n };\n }\n\n getSupportedFilesForTsserver(components: Component[]): string[] {\n const files = components\n .map((c) => c.filesystem.files)\n .flat()\n .map((f) => f.path);\n return files.filter((f) => f.endsWith('.ts') || f.endsWith('.tsx'));\n }\n\n private async onPreWatch(componentIds: ComponentID[], watchOpts: WatchOptions) {\n const workspace = this.workspace;\n if (!workspace || !watchOpts.spawnTSServer) {\n return;\n }\n const { verbose, checkTypes } = watchOpts;\n const files = checkTypes ? this.getSupportedFilesForTsserver(await workspace.getMany(componentIds)) : [];\n const printTypeErrors = Boolean(checkTypes);\n await this.initTsserverClientFromWorkspace({ verbose, checkTypes, printTypeErrors }, files);\n }\n\n private async onComponentChange(component: Component, files: string[]) {\n if (!this.tsServer) {\n return {\n results: 'N/A',\n };\n }\n await pMapSeries(files, (file) => this.tsServer.onFileChange(file));\n return {\n results: 'succeed',\n };\n }\n\n static runtime = MainRuntime;\n static dependencies = [\n SchemaAspect,\n LoggerAspect,\n AspectLoaderAspect,\n WorkspaceAspect,\n CLIAspect,\n DependencyResolverAspect,\n EnvsAspect,\n WatcherAspect,\n ScopeAspect,\n BuilderAspect,\n ];\n static slots = [Slot.withType<SchemaTransformer[]>(), Slot.withType<SchemaNodeTransformer[]>()];\n\n static async provider(\n [schema, loggerExt, aspectLoader, workspace, cli, depResolver, envs, watcher, scope, builder]: [\n SchemaMain,\n LoggerMain,\n AspectLoaderMain,\n Workspace,\n CLIMain,\n DependencyResolverMain,\n EnvsMain,\n WatcherMain,\n ScopeMain,\n BuilderMain,\n ],\n config,\n [schemaTransformerSlot, apiTransformerSlot]: [SchemaTransformerSlot, APITransformerSlot]\n ) {\n schema.registerParser(new TypeScriptParser());\n const logger = loggerExt.createLogger(TypescriptAspect.id);\n\n aspectLoader.registerPlugins([new SchemaTransformerPlugin(schemaTransformerSlot)]);\n const tsMain = new TypescriptMain(\n logger,\n schemaTransformerSlot,\n apiTransformerSlot,\n workspace,\n scope,\n depResolver,\n envs,\n aspectLoader\n );\n tsMain.registerSchemaTransformer(() => [\n new ExportDeclarationTransformer(),\n new ExportAssignmentTransformer(),\n new FunctionLikeTransformer(),\n new ParameterTransformer(),\n new SetAccessorTransformer(),\n new GetAccessorTransformer(),\n new IndexSignatureTransformer(),\n new PropertyDeclarationTransformer(),\n new VariableStatementTransformer(),\n new VariableDeclaration(),\n new SourceFileTransformer(),\n new TypeAliasTransformer(),\n new ClassDeclarationTransformer(),\n new InterfaceDeclarationTransformer(),\n new EnumDeclarationTransformer(),\n new BindingElementTransformer(),\n new IntersectionTypeTransformer(),\n new UnionTypeTransformer(),\n new TypeReferenceTransformer(),\n new TypeLiteralTransformer(),\n new LiteralTypeTransformer(),\n new TypeQueryTransformer(),\n new ArrayTypeTransformer(),\n new TypeOperatorTransformer(),\n new KeywordTypeTransformer(),\n new TupleTypeTransformer(),\n new ParenthesizedTypeTransformer(),\n new TypePredicateTransformer(),\n new IndexedAccessTypeTransformer(),\n new TemplateLiteralTypeSpanTransformer(),\n new TemplateLiteralTypeTransformer(),\n new ThisTypeTransformer(),\n new ConditionalTypeTransformer(),\n new NamedTupleTransformer(),\n new ConstructorTransformer(),\n new ImportDeclarationTransformer(),\n new ExpressionStatementTransformer(),\n new ModuleDeclarationTransformer(),\n new DecoratorTransformer(),\n new ObjectLiteralExpressionTransformer(),\n new ArrayLiteralExpressionTransformer(),\n new PropertyAssignmentTransformer(),\n new LiteralValueTransformer(),\n ]);\n\n if (workspace) {\n watcher.registerOnPreWatch(tsMain.onPreWatch.bind(tsMain));\n workspace.registerOnComponentChange(tsMain.onComponentChange.bind(tsMain));\n workspace.registerOnComponentAdd(tsMain.onComponentChange.bind(tsMain));\n }\n\n const removeTypesTask = new RemoveTypesTask();\n builder.registerSnapTasks([removeTypesTask]);\n builder.registerTagTasks([removeTypesTask]);\n\n const checkTypesCmd = new CheckTypesCmd(tsMain, workspace, logger);\n cli.register(checkTypesCmd);\n\n return tsMain;\n }\n}\n\nTypescriptAspect.addRuntime(TypescriptMain);\n\nexport function runTransformersWithContext(\n config: TypescriptConfigMutator,\n transformers: TsConfigTransformer[] = [],\n context: TsConfigTransformContext\n): TypescriptConfigMutator {\n if (!Array.isArray(transformers)) return config;\n const newConfig = transformers.reduce((acc, transformer) => {\n return transformer(acc, context);\n }, config);\n return newConfig;\n}\n\nexport default TypescriptMain;\n"],"mappings":";;;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,mBAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA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C5H,KAAK,CAACI,OAAO,CAAC/D,YAAY,CAAC,EAAE,OAAOmD,MAAM;EAC/C,MAAMqI,SAAS,GAAGxL,YAAY,CAACyL,MAAM,CAAC,CAAC3J,GAAG,EAAEgC,WAAW,KAAK;IAC1D,OAAOA,WAAW,CAAChC,GAAG,EAAEyJ,OAAO,CAAC;EAClC,CAAC,EAAEpI,MAAM,CAAC;EACV,OAAOqI,SAAS;AAClB;AAAC,IAAAE,QAAA,GAAAlB,OAAA,CAAArN,OAAA,GAEciC,cAAc","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/typescript",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1099",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/typescript/typescript",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.typescript",
|
|
8
8
|
"name": "typescript",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.1099"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -19,30 +19,30 @@
|
|
|
19
19
|
"@teambit/legacy.utils": "0.0.48",
|
|
20
20
|
"@teambit/typescript.modules.ts-config-mutator": "0.0.97",
|
|
21
21
|
"@teambit/typescript.typescript-compiler": "5.0.1",
|
|
22
|
+
"@teambit/component.sources": "0.0.197",
|
|
22
23
|
"@teambit/semantics.entities.semantic-schema": "0.0.113",
|
|
23
24
|
"@teambit/ts-server": "0.0.91",
|
|
24
25
|
"@teambit/harmony": "0.4.12",
|
|
25
|
-
"@teambit/compiler": "1.0.1097",
|
|
26
|
-
"@teambit/builder": "1.0.1097",
|
|
27
|
-
"@teambit/component.sources": "0.0.197",
|
|
28
|
-
"@teambit/component": "1.0.1097",
|
|
29
|
-
"@teambit/dependency-resolver": "1.0.1097",
|
|
30
|
-
"@teambit/formatter": "1.0.1097",
|
|
31
|
-
"@teambit/aspect-loader": "1.0.1097",
|
|
32
|
-
"@teambit/envs": "1.0.1097",
|
|
33
26
|
"@teambit/logger": "0.0.1457",
|
|
34
|
-
"@teambit/schema": "1.0.1097",
|
|
35
|
-
"@teambit/scope": "1.0.1097",
|
|
36
|
-
"@teambit/workspace": "1.0.1097",
|
|
37
27
|
"@teambit/cli": "0.0.1364",
|
|
38
|
-
"@teambit/
|
|
39
|
-
"@teambit/
|
|
40
|
-
"@teambit/
|
|
28
|
+
"@teambit/legacy.constants": "0.0.41",
|
|
29
|
+
"@teambit/compiler": "1.0.1099",
|
|
30
|
+
"@teambit/dependency-resolver": "1.0.1099",
|
|
31
|
+
"@teambit/builder": "1.0.1099",
|
|
32
|
+
"@teambit/component": "1.0.1099",
|
|
33
|
+
"@teambit/formatter": "1.0.1099",
|
|
34
|
+
"@teambit/aspect-loader": "1.0.1099",
|
|
35
|
+
"@teambit/envs": "1.0.1099",
|
|
36
|
+
"@teambit/schema": "1.0.1099",
|
|
37
|
+
"@teambit/scope": "1.0.1099",
|
|
38
|
+
"@teambit/workspace": "1.0.1099",
|
|
39
|
+
"@teambit/pkg": "1.0.1099",
|
|
40
|
+
"@teambit/watcher": "1.0.1099"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
+
"@types/fs-extra": "9.0.7",
|
|
43
44
|
"@types/lodash": "4.14.165",
|
|
44
45
|
"@types/minimatch": "3.0.4",
|
|
45
|
-
"@types/fs-extra": "9.0.7",
|
|
46
46
|
"@types/mocha": "9.1.0",
|
|
47
47
|
"@teambit/typescript.aspect-docs.typescript": "0.0.180",
|
|
48
48
|
"@teambit/harmony.envs.core-aspect-env": "2.0.6"
|