pyright-internal-node 1.1.367
“Type checker for the Python language”
Basename is uppercase README.mdCLONE_NEWNET constant
SHA-25604a987ba973f36ced32cb1bddf0916ee9d50771639bb12553e21bfed8966f9be
Evidence
1"use strict";
2const fs = require('fs');
3const path = require('path');
4const glob = require('glob');
5const JSONC = require('jsonc-parser');
6const assert = require('assert');
7/**
8 * Builds a faked resource path for production source maps in webpack.
9 *
10 * @param {string} packageName The name of the package where webpack is running.
11 */
12function monorepoResourceNameMapper(packageName) {
13 /**@type {(info: {resourcePath: string}) => string} */
14 const mapper = (info) => {
15 const pa …
35:3… /
36function managedPaths(workspaceRoot) {
37 const contents = fs.readFileSync(path.join(workspaceRoot, 'lerna.json'), 'utf-8');
38 /** @type {{ packages: string[] }} */
39 const data = JSON.parse(contents);
40 const patterns = data.packages;
41 const paths = [path.resolve(workspaceRoot, 'node_modules')];
42 paths.push(...patterns
43 .flatMap((p) => glob.sync(p, { cwd: workspaceRoot }))
44 .map((p) => path.resolve(workspaceRoot, p, 'node_modules')));
45 return paths;
46}
47/**
48 * Builds a webpack caching config, given the calling module's __dirname and __filename.
49 * @param {string} dirname __dirname
50 * @param {string} filename __filename
51 * @param {string | undefined} n …
70:32… as configuration from a tsconfig.json file.
71 * This is an alternative to using tsconfig-paths-webpack-plugin, which
72 * has a number of unfixed bugs.
73 *
74 * https://github.com/dividab/tsconfig-paths/issues/143
75 * https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/59
76 * https://github.com/ …
76:27… dab/tsconfig-paths-webpack-plugin/issues/60
77 * @param {string} tsconfigPath Path to tsconfig
78 */
79function tsconfigResolveAliases(tsconfigPath) {
80 tsconfigPath = path.resolve(tsconfigPath);
81 con …
90:54… ;
91 assert(Array.isArray(toArr) && toArr.length === 1);
92 let to = toArr[0];
93 assert(typeof to === 'string');
94 assert(endWildcard.test(from));
95 assert(endWildcard.test(to));
96 from = from.replace(endWildcard, '');
97 to = to.replace(endWildcard, '');
98 return [from, path.resolve(baseDir, to)];
99 }));
100}
101module.exports = {
102 monorepoResourceNameMapper,
103 cacheConfig,
104 tsconfigResolveAliases,
105};
106//# sourceMappingURL=webpack.js.map
Showing the top 5 files — 5 more files (48 regions) not shown.
No evidence locations were recorded for this file. Raw result