@stencil/core 2.19.2-0 → 2.19.3
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/cli/config-flags.d.ts +31 -19
- package/cli/index.cjs +357 -187
- package/cli/index.js +357 -187
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +363 -526
- package/compiler/stencil.min.js +2 -2
- package/dependencies.json +1 -1
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +1 -1
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +1 -1
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/package.json +1 -1
- package/internal/package.json +1 -1
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +1 -1
- package/mock-doc/index.js +1 -1
- package/mock-doc/package.json +1 -1
- package/package.json +4 -4
- package/screenshot/package.json +1 -1
- package/sys/node/autoprefixer.js +2 -2
- package/sys/node/index.js +1 -1
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +2 -2
- package/testing/package.json +1 -1
package/compiler/stencil.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Compiler v2.19.
|
|
2
|
+
Stencil Compiler v2.19.3 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
(function(exports) {
|
|
5
5
|
'use strict';
|
|
@@ -812,7 +812,7 @@ const formatErrorCode = (errorCode) => {
|
|
|
812
812
|
* @param path the Windows-based path to convert
|
|
813
813
|
* @returns the converted path
|
|
814
814
|
*/
|
|
815
|
-
const normalizePath$
|
|
815
|
+
const normalizePath$1 = (path) => {
|
|
816
816
|
if (typeof path !== 'string') {
|
|
817
817
|
throw new Error(`invalid path to normalize`);
|
|
818
818
|
}
|
|
@@ -951,10 +951,10 @@ const pathComponents = (path, rootLength) => {
|
|
|
951
951
|
* @param p the path to normalize
|
|
952
952
|
* @returns the normalized path, sans any query strings
|
|
953
953
|
*/
|
|
954
|
-
const normalizeFsPath = (p) => normalizePath$
|
|
954
|
+
const normalizeFsPath = (p) => normalizePath$1(p.split('?')[0].replace(/\0/g, ''));
|
|
955
955
|
const normalizeFsPathQuery = (importPath) => {
|
|
956
956
|
const pathParts = importPath.split('?');
|
|
957
|
-
const filePath = normalizePath$
|
|
957
|
+
const filePath = normalizePath$1(pathParts[0]);
|
|
958
958
|
const ext = filePath.split('.').pop().toLowerCase();
|
|
959
959
|
const params = pathParts.length > 1 ? new URLSearchParams(pathParts[1]) : null;
|
|
960
960
|
const format = params ? params.get('format') : null;
|
|
@@ -980,7 +980,7 @@ const augmentDiagnosticWithNode = (d, node) => {
|
|
|
980
980
|
if (!sourceFile) {
|
|
981
981
|
return d;
|
|
982
982
|
}
|
|
983
|
-
d.absFilePath = normalizePath$
|
|
983
|
+
d.absFilePath = normalizePath$1(sourceFile.fileName);
|
|
984
984
|
const sourceText = sourceFile.text;
|
|
985
985
|
const srcLines = splitLineBreaks(sourceText);
|
|
986
986
|
const start = node.getStart();
|
|
@@ -1959,10 +1959,10 @@ const setPlatformPath = (platformPath) => {
|
|
|
1959
1959
|
const joinOrg = path$5.join;
|
|
1960
1960
|
const relativeOrg = path$5.relative;
|
|
1961
1961
|
const resolveOrg = path$5.resolve;
|
|
1962
|
-
normalize$1 = path$5.normalize = (...args) => normalizePath$
|
|
1963
|
-
join = path$5.join = (...args) => normalizePath$
|
|
1964
|
-
relative$1 = path$5.relative = (...args) => normalizePath$
|
|
1965
|
-
resolve$1 = path$5.resolve = (...args) => normalizePath$
|
|
1962
|
+
normalize$1 = path$5.normalize = (...args) => normalizePath$1(normalizeOrg.apply(path$5, args));
|
|
1963
|
+
join = path$5.join = (...args) => normalizePath$1(joinOrg.apply(path$5, args));
|
|
1964
|
+
relative$1 = path$5.relative = (...args) => normalizePath$1(relativeOrg.apply(path$5, args));
|
|
1965
|
+
resolve$1 = path$5.resolve = (...args) => normalizePath$1(resolveOrg.apply(path$5, args));
|
|
1966
1966
|
basename = path$5.basename;
|
|
1967
1967
|
dirname = path$5.dirname;
|
|
1968
1968
|
extname$1 = path$5.extname;
|
|
@@ -2039,16 +2039,16 @@ const process$3 = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), p
|
|
|
2039
2039
|
'default': process_1
|
|
2040
2040
|
});
|
|
2041
2041
|
|
|
2042
|
-
const buildId = '
|
|
2042
|
+
const buildId = '20221115135850';
|
|
2043
2043
|
const minfyJsId = 'terser5.6.1_7';
|
|
2044
|
-
const optimizeCssId = 'autoprefixer10.4.
|
|
2044
|
+
const optimizeCssId = 'autoprefixer10.4.13_postcss8.4.19_7';
|
|
2045
2045
|
const parse5Version = '7.1.1';
|
|
2046
2046
|
const rollupVersion = '2.42.3';
|
|
2047
2047
|
const sizzleVersion = '2.42.3';
|
|
2048
2048
|
const terserVersion = '5.6.1';
|
|
2049
2049
|
const typescriptVersion = '4.7.4';
|
|
2050
|
-
const vermoji = '
|
|
2051
|
-
const version$3 = '2.19.
|
|
2050
|
+
const vermoji = '🌏';
|
|
2051
|
+
const version$3 = '2.19.3';
|
|
2052
2052
|
const versions = {
|
|
2053
2053
|
stencil: version$3,
|
|
2054
2054
|
parse5: parse5Version,
|
|
@@ -2359,7 +2359,7 @@ const realpathSync$2 = (fs$3.realpathSync = (p) => {
|
|
|
2359
2359
|
if (results.error) {
|
|
2360
2360
|
throw results.error;
|
|
2361
2361
|
}
|
|
2362
|
-
return normalizePath$
|
|
2362
|
+
return normalizePath$1(results.path);
|
|
2363
2363
|
});
|
|
2364
2364
|
const statSync = (fs$3.statSync = (p) => {
|
|
2365
2365
|
const fsStats = fs$3.__sys.statSync(p);
|
|
@@ -3668,7 +3668,7 @@ const setPackageVersionByContent = (pkgVersions, pkgContent) => {
|
|
|
3668
3668
|
const isLocalModule = (p) => p.startsWith('.') || p.startsWith('/');
|
|
3669
3669
|
const isStencilCoreImport = (p) => p.startsWith('@stencil/core');
|
|
3670
3670
|
const shouldFetchModule = (p) => IS_FETCH_ENV && IS_BROWSER_ENV && isNodeModulePath(p);
|
|
3671
|
-
const isNodeModulePath = (p) => normalizePath$
|
|
3671
|
+
const isNodeModulePath = (p) => normalizePath$1(p).split('/').includes('node_modules');
|
|
3672
3672
|
const getModuleId = (orgImport) => {
|
|
3673
3673
|
if (orgImport.startsWith('~')) {
|
|
3674
3674
|
orgImport = orgImport.substring(1);
|
|
@@ -3693,7 +3693,7 @@ const getModuleId = (orgImport) => {
|
|
|
3693
3693
|
return m;
|
|
3694
3694
|
};
|
|
3695
3695
|
const getPackageDirPath = (p, moduleId) => {
|
|
3696
|
-
const parts = normalizePath$
|
|
3696
|
+
const parts = normalizePath$1(p).split('/');
|
|
3697
3697
|
const m = getModuleId(moduleId);
|
|
3698
3698
|
for (let i = parts.length - 1; i >= 1; i--) {
|
|
3699
3699
|
if (parts[i - 1] === 'node_modules') {
|
|
@@ -3735,7 +3735,7 @@ const known404Urls = new Set();
|
|
|
3735
3735
|
* @returns a URL for the file of interest
|
|
3736
3736
|
*/
|
|
3737
3737
|
const getStencilModuleUrl = (compilerExe, path) => {
|
|
3738
|
-
path = normalizePath$
|
|
3738
|
+
path = normalizePath$1(path);
|
|
3739
3739
|
let parts = path.split('/');
|
|
3740
3740
|
const nmIndex = parts.lastIndexOf('node_modules');
|
|
3741
3741
|
if (nmIndex > -1 && nmIndex < parts.length - 1) {
|
|
@@ -3754,7 +3754,7 @@ const getStencilModuleUrl = (compilerExe, path) => {
|
|
|
3754
3754
|
const getCommonDirUrl = (sys, pkgVersions, dirPath, fileName) => getNodeModuleFetchUrl(sys, pkgVersions, dirPath) + '/' + fileName;
|
|
3755
3755
|
const getNodeModuleFetchUrl = (sys, pkgVersions, filePath) => {
|
|
3756
3756
|
// /node_modules/lodash/package.json
|
|
3757
|
-
filePath = normalizePath$
|
|
3757
|
+
filePath = normalizePath$1(filePath);
|
|
3758
3758
|
// ["node_modules", "lodash", "package.json"]
|
|
3759
3759
|
let pathParts = filePath.split('/').filter((p) => p.length);
|
|
3760
3760
|
const nmIndex = pathParts.lastIndexOf('node_modules');
|
|
@@ -3904,7 +3904,7 @@ const resolveModuleIdAsync = (sys, inMemoryFs, opts) => {
|
|
|
3904
3904
|
rejectPromise(err);
|
|
3905
3905
|
}
|
|
3906
3906
|
else {
|
|
3907
|
-
resolveId = normalizePath$
|
|
3907
|
+
resolveId = normalizePath$1(resolveId);
|
|
3908
3908
|
const results = {
|
|
3909
3909
|
moduleId: opts.moduleId,
|
|
3910
3910
|
resolveId,
|
|
@@ -4176,9 +4176,9 @@ const createSystem = (c) => {
|
|
|
4176
4176
|
const dir = dirname(p);
|
|
4177
4177
|
const base = basename(p);
|
|
4178
4178
|
if (dir.endsWith('/')) {
|
|
4179
|
-
return normalizePath$
|
|
4179
|
+
return normalizePath$1(`${dir}${base}`);
|
|
4180
4180
|
}
|
|
4181
|
-
return normalizePath$
|
|
4181
|
+
return normalizePath$1(`${dir}/${base}`);
|
|
4182
4182
|
};
|
|
4183
4183
|
const accessSync = (p) => {
|
|
4184
4184
|
const item = items.get(normalize(p));
|
|
@@ -4278,8 +4278,8 @@ const createSystem = (c) => {
|
|
|
4278
4278
|
};
|
|
4279
4279
|
const realpath = async (p) => realpathSync(p);
|
|
4280
4280
|
const rename = async (oldPath, newPath) => {
|
|
4281
|
-
oldPath = normalizePath$
|
|
4282
|
-
newPath = normalizePath$
|
|
4281
|
+
oldPath = normalizePath$1(oldPath);
|
|
4282
|
+
newPath = normalizePath$1(newPath);
|
|
4283
4283
|
const results = {
|
|
4284
4284
|
oldPath,
|
|
4285
4285
|
newPath,
|
|
@@ -10102,7 +10102,7 @@ const getComponentGraph = (sys, prerenderCtx, componentGraphPath) => {
|
|
|
10102
10102
|
const prerenderEnsureDir = (sys, prerenderCtx, p) => {
|
|
10103
10103
|
const allDirs = [];
|
|
10104
10104
|
while (true) {
|
|
10105
|
-
p = normalizePath$
|
|
10105
|
+
p = normalizePath$1(sys.platformPath.dirname(p));
|
|
10106
10106
|
if (typeof p === 'string' && p.length > 0 && !isRootPath(p)) {
|
|
10107
10107
|
allDirs.push(p);
|
|
10108
10108
|
}
|
|
@@ -11793,7 +11793,7 @@ const serializeImportPath = (data, styleImportData) => {
|
|
|
11793
11793
|
if (isString$1(data.importerPath) && isAbsolute$1(data.importeePath)) {
|
|
11794
11794
|
p = relative$1(dirname(data.importerPath), data.importeePath);
|
|
11795
11795
|
}
|
|
11796
|
-
p = normalizePath$
|
|
11796
|
+
p = normalizePath$1(p);
|
|
11797
11797
|
if (!p.startsWith('.')) {
|
|
11798
11798
|
p = './' + p;
|
|
11799
11799
|
}
|
|
@@ -12099,11 +12099,11 @@ const getCssToEsmImports = (varNames, cssText, filePath, modeName) => {
|
|
|
12099
12099
|
}
|
|
12100
12100
|
else if (path$5.isAbsolute(cssImportData.url)) {
|
|
12101
12101
|
// absolute path already
|
|
12102
|
-
cssImportData.filePath = normalizePath$
|
|
12102
|
+
cssImportData.filePath = normalizePath$1(cssImportData.url);
|
|
12103
12103
|
}
|
|
12104
12104
|
else {
|
|
12105
12105
|
// relative path
|
|
12106
|
-
cssImportData.filePath = normalizePath$
|
|
12106
|
+
cssImportData.filePath = normalizePath$1(path$5.resolve(dir, cssImportData.url));
|
|
12107
12107
|
}
|
|
12108
12108
|
cssImportData.varName = createCssVarName(cssImportData.filePath, modeName);
|
|
12109
12109
|
if (varNames.has(cssImportData.varName)) {
|
|
@@ -12229,7 +12229,7 @@ class CompilerContext {
|
|
|
12229
12229
|
}
|
|
12230
12230
|
}
|
|
12231
12231
|
const getModuleLegacy = (_config, compilerCtx, sourceFilePath) => {
|
|
12232
|
-
sourceFilePath = normalizePath$
|
|
12232
|
+
sourceFilePath = normalizePath$1(sourceFilePath);
|
|
12233
12233
|
const moduleFile = compilerCtx.moduleMap.get(sourceFilePath);
|
|
12234
12234
|
if (moduleFile != null) {
|
|
12235
12235
|
return moduleFile;
|
|
@@ -12313,7 +12313,7 @@ const relativeImport = (pathFrom, pathTo, ext, addPrefix = true) => {
|
|
|
12313
12313
|
relativePath = './' + relativePath;
|
|
12314
12314
|
}
|
|
12315
12315
|
}
|
|
12316
|
-
return normalizePath$
|
|
12316
|
+
return normalizePath$1(`${relativePath}/${basename(pathTo, ext)}`);
|
|
12317
12317
|
};
|
|
12318
12318
|
const getComponentsDtsSrcFilePath = (config) => join(config.srcDir, GENERATED_DTS$1);
|
|
12319
12319
|
const getComponentsDtsTypesFilePath = (outputTarget) => join(outputTarget.typesDir, GENERATED_DTS$1);
|
|
@@ -18425,7 +18425,7 @@ const canSkipAssetsCopy = (compilerCtx, entryModules, filesChanged) => {
|
|
|
18425
18425
|
// loop through each of the changed files
|
|
18426
18426
|
filesChanged.forEach((changedFile) => {
|
|
18427
18427
|
// get the directory of where the changed file is in
|
|
18428
|
-
const changedFileDirPath = normalizePath$
|
|
18428
|
+
const changedFileDirPath = normalizePath$1(dirname(changedFile));
|
|
18429
18429
|
// loop through all the possible asset directories
|
|
18430
18430
|
entryModules.forEach((entryModule) => {
|
|
18431
18431
|
entryModule.cmps.forEach((cmp) => {
|
|
@@ -18433,7 +18433,7 @@ const canSkipAssetsCopy = (compilerCtx, entryModules, filesChanged) => {
|
|
|
18433
18433
|
// loop through each of the asset directories of each component
|
|
18434
18434
|
cmp.assetsDirs.forEach((assetsDir) => {
|
|
18435
18435
|
// get the absolute of the asset directory
|
|
18436
|
-
const assetDirPath = normalizePath$
|
|
18436
|
+
const assetDirPath = normalizePath$1(assetsDir.absolutePath);
|
|
18437
18437
|
// if the changed file directory is this asset directory
|
|
18438
18438
|
// then we should recopy everything over again
|
|
18439
18439
|
if (changedFileDirPath === assetDirPath) {
|
|
@@ -18523,7 +18523,7 @@ const filterCopyTasks = (config, tasks, changedFiles) => {
|
|
|
18523
18523
|
}
|
|
18524
18524
|
}
|
|
18525
18525
|
else {
|
|
18526
|
-
copySrc = normalizePath$
|
|
18526
|
+
copySrc = normalizePath$1(getSrcAbsPath(config, copySrc + '/'));
|
|
18527
18527
|
if (changedFiles.some((f) => f.startsWith(copySrc))) {
|
|
18528
18528
|
return true;
|
|
18529
18529
|
}
|
|
@@ -18590,7 +18590,7 @@ const mapImportsToPathAliases = (config, destinationFilePath, outputTarget) => {
|
|
|
18590
18590
|
// In order to make sure the relative path works when the destination depth is different than the source
|
|
18591
18591
|
// file structure depth, we need to determine where the resolved file exists relative to the destination directory
|
|
18592
18592
|
const resolvePathInDestination = module.resolvedModule.resolvedFileName.replace(config.srcDir, outputTarget.collectionDir);
|
|
18593
|
-
importPath = normalizePath$
|
|
18593
|
+
importPath = normalizePath$1(relative$1(dirname(destinationFilePath), resolvePathInDestination).replace(extensionRegex, ''));
|
|
18594
18594
|
}
|
|
18595
18595
|
}
|
|
18596
18596
|
return transformCtx.factory.updateImportDeclaration(node, node.decorators, node.modifiers, node.importClause, transformCtx.factory.createStringLiteral(importPath), node.assertClause);
|
|
@@ -18671,9 +18671,9 @@ const writeCollectionManifests = async (config, compilerCtx, buildCtx, outputTar
|
|
|
18671
18671
|
// couple core component meta data between specific versions of the compiler
|
|
18672
18672
|
const writeCollectionManifest = async (compilerCtx, collectionData, outputTarget) => {
|
|
18673
18673
|
// get the absolute path to the directory where the collection will be saved
|
|
18674
|
-
const collectionDir = normalizePath$
|
|
18674
|
+
const collectionDir = normalizePath$1(outputTarget.collectionDir);
|
|
18675
18675
|
// create an absolute file path to the actual collection json file
|
|
18676
|
-
const collectionFilePath = normalizePath$
|
|
18676
|
+
const collectionFilePath = normalizePath$1(join(collectionDir, COLLECTION_MANIFEST_FILE_NAME));
|
|
18677
18677
|
// don't bother serializing/writing the collection if we're not creating a distribution
|
|
18678
18678
|
await compilerCtx.fs.writeFile(collectionFilePath, collectionData);
|
|
18679
18679
|
};
|
|
@@ -18694,7 +18694,7 @@ const serializeCollectionManifest = (config, compilerCtx, buildCtx) => {
|
|
|
18694
18694
|
})),
|
|
18695
18695
|
};
|
|
18696
18696
|
if (config.globalScript) {
|
|
18697
|
-
const mod = compilerCtx.moduleMap.get(normalizePath$
|
|
18697
|
+
const mod = compilerCtx.moduleMap.get(normalizePath$1(config.globalScript));
|
|
18698
18698
|
if (mod) {
|
|
18699
18699
|
collectionManifest.global = relative$1(config.srcDir, mod.jsFilePath);
|
|
18700
18700
|
}
|
|
@@ -21114,18 +21114,18 @@ const attachScopes$1 = function attachScopes(ast, propertyName = 'scope') {
|
|
|
21114
21114
|
};
|
|
21115
21115
|
|
|
21116
21116
|
// Helper since Typescript can't detect readonly arrays with Array.isArray
|
|
21117
|
-
function isArray$
|
|
21117
|
+
function isArray$4(arg) {
|
|
21118
21118
|
return Array.isArray(arg);
|
|
21119
21119
|
}
|
|
21120
|
-
function ensureArray$
|
|
21121
|
-
if (isArray$
|
|
21120
|
+
function ensureArray$3(thing) {
|
|
21121
|
+
if (isArray$4(thing))
|
|
21122
21122
|
return thing;
|
|
21123
21123
|
if (thing == null)
|
|
21124
21124
|
return [];
|
|
21125
21125
|
return [thing];
|
|
21126
21126
|
}
|
|
21127
21127
|
|
|
21128
|
-
function getMatcherString$
|
|
21128
|
+
function getMatcherString$3(id, resolutionBase) {
|
|
21129
21129
|
if (resolutionBase === false) {
|
|
21130
21130
|
return id;
|
|
21131
21131
|
}
|
|
@@ -21141,21 +21141,21 @@ function getMatcherString$4(id, resolutionBase) {
|
|
|
21141
21141
|
// otherwise Node will force backslash (\) on windows
|
|
21142
21142
|
return posix$1.join(basePath, id);
|
|
21143
21143
|
}
|
|
21144
|
-
const createFilter$
|
|
21144
|
+
const createFilter$3 = function createFilter(include, exclude, options) {
|
|
21145
21145
|
const resolutionBase = options && options.resolve;
|
|
21146
21146
|
const getMatcher = (id) => id instanceof RegExp
|
|
21147
21147
|
? id
|
|
21148
21148
|
: {
|
|
21149
21149
|
test: (what) => {
|
|
21150
21150
|
// this refactor is a tad overly verbose but makes for easy debugging
|
|
21151
|
-
const pattern = getMatcherString$
|
|
21151
|
+
const pattern = getMatcherString$3(id, resolutionBase);
|
|
21152
21152
|
const fn = picomatch(pattern, { dot: true });
|
|
21153
21153
|
const result = fn(what);
|
|
21154
21154
|
return result;
|
|
21155
21155
|
}
|
|
21156
21156
|
};
|
|
21157
|
-
const includeMatchers = ensureArray$
|
|
21158
|
-
const excludeMatchers = ensureArray$
|
|
21157
|
+
const includeMatchers = ensureArray$3(include).map(getMatcher);
|
|
21158
|
+
const excludeMatchers = ensureArray$3(exclude).map(getMatcher);
|
|
21159
21159
|
return function result(id) {
|
|
21160
21160
|
if (typeof id !== 'string')
|
|
21161
21161
|
return false;
|
|
@@ -21176,15 +21176,15 @@ const createFilter$4 = function createFilter(include, exclude, options) {
|
|
|
21176
21176
|
};
|
|
21177
21177
|
};
|
|
21178
21178
|
|
|
21179
|
-
const reservedWords$
|
|
21180
|
-
const builtins$
|
|
21181
|
-
const forbiddenIdentifiers$
|
|
21182
|
-
forbiddenIdentifiers$
|
|
21183
|
-
const makeLegalIdentifier$
|
|
21179
|
+
const reservedWords$3 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
|
|
21180
|
+
const builtins$4 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
|
|
21181
|
+
const forbiddenIdentifiers$3 = new Set(`${reservedWords$3} ${builtins$4}`.split(' '));
|
|
21182
|
+
forbiddenIdentifiers$3.add('');
|
|
21183
|
+
const makeLegalIdentifier$1 = function makeLegalIdentifier(str) {
|
|
21184
21184
|
let identifier = str
|
|
21185
21185
|
.replace(/-(\w)/g, (_, letter) => letter.toUpperCase())
|
|
21186
21186
|
.replace(/[^$_a-zA-Z0-9]/g, '_');
|
|
21187
|
-
if (/\d/.test(identifier[0]) || forbiddenIdentifiers$
|
|
21187
|
+
if (/\d/.test(identifier[0]) || forbiddenIdentifiers$3.has(identifier)) {
|
|
21188
21188
|
identifier = `_${identifier}`;
|
|
21189
21189
|
}
|
|
21190
21190
|
return identifier || '_';
|
|
@@ -22873,13 +22873,13 @@ var concatMap = function (xs, fn) {
|
|
|
22873
22873
|
var res = [];
|
|
22874
22874
|
for (var i = 0; i < xs.length; i++) {
|
|
22875
22875
|
var x = fn(xs[i], i);
|
|
22876
|
-
if (isArray$
|
|
22876
|
+
if (isArray$3(x)) res.push.apply(res, x);
|
|
22877
22877
|
else res.push(x);
|
|
22878
22878
|
}
|
|
22879
22879
|
return res;
|
|
22880
22880
|
};
|
|
22881
22881
|
|
|
22882
|
-
var isArray$
|
|
22882
|
+
var isArray$3 = Array.isArray || function (xs) {
|
|
22883
22883
|
return Object.prototype.toString.call(xs) === '[object Array]';
|
|
22884
22884
|
};
|
|
22885
22885
|
|
|
@@ -27742,12 +27742,12 @@ function equals(a, b, strict) {
|
|
|
27742
27742
|
/* eslint-disable import/prefer-default-export */
|
|
27743
27743
|
|
|
27744
27744
|
function getName(id) {
|
|
27745
|
-
const name = makeLegalIdentifier$
|
|
27745
|
+
const name = makeLegalIdentifier$1(basename(id, extname$1(id)));
|
|
27746
27746
|
if (name !== 'index') {
|
|
27747
27747
|
return name;
|
|
27748
27748
|
}
|
|
27749
27749
|
const segments = dirname(id).split(sep);
|
|
27750
|
-
return makeLegalIdentifier$
|
|
27750
|
+
return makeLegalIdentifier$1(segments[segments.length - 1]);
|
|
27751
27751
|
}
|
|
27752
27752
|
|
|
27753
27753
|
/* eslint-disable no-param-reassign, no-shadow, no-underscore-dangle, no-continue */
|
|
@@ -27766,7 +27766,7 @@ const functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionEx
|
|
|
27766
27766
|
|
|
27767
27767
|
function deconflict(scope, globals, identifier) {
|
|
27768
27768
|
let i = 1;
|
|
27769
|
-
let deconflicted = makeLegalIdentifier$
|
|
27769
|
+
let deconflicted = makeLegalIdentifier$1(identifier);
|
|
27770
27770
|
|
|
27771
27771
|
while (scope.contains(deconflicted) || globals.has(deconflicted) || deconflicted in blacklist) {
|
|
27772
27772
|
deconflicted = `${identifier}_${i}`;
|
|
@@ -28181,7 +28181,7 @@ function transformCommonjs(
|
|
|
28181
28181
|
node.right.properties.forEach((prop) => {
|
|
28182
28182
|
if (prop.computed || !('key' in prop) || prop.key.type !== 'Identifier') return;
|
|
28183
28183
|
const { name } = prop.key;
|
|
28184
|
-
if (name === makeLegalIdentifier$
|
|
28184
|
+
if (name === makeLegalIdentifier$1(name)) ;
|
|
28185
28185
|
});
|
|
28186
28186
|
return;
|
|
28187
28187
|
}
|
|
@@ -28189,7 +28189,7 @@ function transformCommonjs(
|
|
|
28189
28189
|
}
|
|
28190
28190
|
|
|
28191
28191
|
const name = getDefinePropertyCallName(node, 'exports');
|
|
28192
|
-
if (name && name === makeLegalIdentifier$
|
|
28192
|
+
if (name && name === makeLegalIdentifier$1(name)) ;
|
|
28193
28193
|
|
|
28194
28194
|
// if this is `var x = require('x')`, we can do `import x from 'x'`
|
|
28195
28195
|
if (
|
|
@@ -28668,7 +28668,7 @@ function getResolveId(extensions) {
|
|
|
28668
28668
|
|
|
28669
28669
|
function commonjs(options = {}) {
|
|
28670
28670
|
const extensions = options.extensions || ['.js'];
|
|
28671
|
-
const filter = createFilter$
|
|
28671
|
+
const filter = createFilter$3(options.include, options.exclude);
|
|
28672
28672
|
const {
|
|
28673
28673
|
ignoreGlobal,
|
|
28674
28674
|
requireReturnsDefault: requireReturnsDefaultOption,
|
|
@@ -28846,57 +28846,204 @@ function commonjs(options = {}) {
|
|
|
28846
28846
|
};
|
|
28847
28847
|
}
|
|
28848
28848
|
|
|
28849
|
+
const addExtension = function addExtension(filename, ext = '.js') {
|
|
28850
|
+
let result = `${filename}`;
|
|
28851
|
+
if (!extname$1(filename))
|
|
28852
|
+
result += ext;
|
|
28853
|
+
return result;
|
|
28854
|
+
};
|
|
28855
|
+
|
|
28856
|
+
const extractors$2 = {
|
|
28857
|
+
ArrayPattern(names, param) {
|
|
28858
|
+
for (const element of param.elements) {
|
|
28859
|
+
if (element)
|
|
28860
|
+
extractors$2[element.type](names, element);
|
|
28861
|
+
}
|
|
28862
|
+
},
|
|
28863
|
+
AssignmentPattern(names, param) {
|
|
28864
|
+
extractors$2[param.left.type](names, param.left);
|
|
28865
|
+
},
|
|
28866
|
+
Identifier(names, param) {
|
|
28867
|
+
names.push(param.name);
|
|
28868
|
+
},
|
|
28869
|
+
MemberExpression() { },
|
|
28870
|
+
ObjectPattern(names, param) {
|
|
28871
|
+
for (const prop of param.properties) {
|
|
28872
|
+
// @ts-ignore Typescript reports that this is not a valid type
|
|
28873
|
+
if (prop.type === 'RestElement') {
|
|
28874
|
+
extractors$2.RestElement(names, prop);
|
|
28875
|
+
}
|
|
28876
|
+
else {
|
|
28877
|
+
extractors$2[prop.value.type](names, prop.value);
|
|
28878
|
+
}
|
|
28879
|
+
}
|
|
28880
|
+
},
|
|
28881
|
+
RestElement(names, param) {
|
|
28882
|
+
extractors$2[param.argument.type](names, param.argument);
|
|
28883
|
+
}
|
|
28884
|
+
};
|
|
28885
|
+
const extractAssignedNames$2 = function extractAssignedNames(param) {
|
|
28886
|
+
const names = [];
|
|
28887
|
+
extractors$2[param.type](names, param);
|
|
28888
|
+
return names;
|
|
28889
|
+
};
|
|
28890
|
+
|
|
28891
|
+
const blockDeclarations = {
|
|
28892
|
+
const: true,
|
|
28893
|
+
let: true
|
|
28894
|
+
};
|
|
28895
|
+
class Scope$2 {
|
|
28896
|
+
constructor(options = {}) {
|
|
28897
|
+
this.parent = options.parent;
|
|
28898
|
+
this.isBlockScope = !!options.block;
|
|
28899
|
+
this.declarations = Object.create(null);
|
|
28900
|
+
if (options.params) {
|
|
28901
|
+
options.params.forEach((param) => {
|
|
28902
|
+
extractAssignedNames$2(param).forEach((name) => {
|
|
28903
|
+
this.declarations[name] = true;
|
|
28904
|
+
});
|
|
28905
|
+
});
|
|
28906
|
+
}
|
|
28907
|
+
}
|
|
28908
|
+
addDeclaration(node, isBlockDeclaration, isVar) {
|
|
28909
|
+
if (!isBlockDeclaration && this.isBlockScope) {
|
|
28910
|
+
// it's a `var` or function node, and this
|
|
28911
|
+
// is a block scope, so we need to go up
|
|
28912
|
+
this.parent.addDeclaration(node, isBlockDeclaration, isVar);
|
|
28913
|
+
}
|
|
28914
|
+
else if (node.id) {
|
|
28915
|
+
extractAssignedNames$2(node.id).forEach((name) => {
|
|
28916
|
+
this.declarations[name] = true;
|
|
28917
|
+
});
|
|
28918
|
+
}
|
|
28919
|
+
}
|
|
28920
|
+
contains(name) {
|
|
28921
|
+
return this.declarations[name] || (this.parent ? this.parent.contains(name) : false);
|
|
28922
|
+
}
|
|
28923
|
+
}
|
|
28924
|
+
const attachScopes = function attachScopes(ast, propertyName = 'scope') {
|
|
28925
|
+
let scope = new Scope$2();
|
|
28926
|
+
walk(ast, {
|
|
28927
|
+
enter(n, parent) {
|
|
28928
|
+
const node = n;
|
|
28929
|
+
// function foo () {...}
|
|
28930
|
+
// class Foo {...}
|
|
28931
|
+
if (/(Function|Class)Declaration/.test(node.type)) {
|
|
28932
|
+
scope.addDeclaration(node, false, false);
|
|
28933
|
+
}
|
|
28934
|
+
// var foo = 1
|
|
28935
|
+
if (node.type === 'VariableDeclaration') {
|
|
28936
|
+
const { kind } = node;
|
|
28937
|
+
const isBlockDeclaration = blockDeclarations[kind];
|
|
28938
|
+
node.declarations.forEach((declaration) => {
|
|
28939
|
+
scope.addDeclaration(declaration, isBlockDeclaration, true);
|
|
28940
|
+
});
|
|
28941
|
+
}
|
|
28942
|
+
let newScope;
|
|
28943
|
+
// create new function scope
|
|
28944
|
+
if (/Function/.test(node.type)) {
|
|
28945
|
+
const func = node;
|
|
28946
|
+
newScope = new Scope$2({
|
|
28947
|
+
parent: scope,
|
|
28948
|
+
block: false,
|
|
28949
|
+
params: func.params
|
|
28950
|
+
});
|
|
28951
|
+
// named function expressions - the name is considered
|
|
28952
|
+
// part of the function's scope
|
|
28953
|
+
if (func.type === 'FunctionExpression' && func.id) {
|
|
28954
|
+
newScope.addDeclaration(func, false, false);
|
|
28955
|
+
}
|
|
28956
|
+
}
|
|
28957
|
+
// create new for scope
|
|
28958
|
+
if (/For(In|Of)?Statement/.test(node.type)) {
|
|
28959
|
+
newScope = new Scope$2({
|
|
28960
|
+
parent: scope,
|
|
28961
|
+
block: true
|
|
28962
|
+
});
|
|
28963
|
+
}
|
|
28964
|
+
// create new block scope
|
|
28965
|
+
if (node.type === 'BlockStatement' && !/Function/.test(parent.type)) {
|
|
28966
|
+
newScope = new Scope$2({
|
|
28967
|
+
parent: scope,
|
|
28968
|
+
block: true
|
|
28969
|
+
});
|
|
28970
|
+
}
|
|
28971
|
+
// catch clause has its own block scope
|
|
28972
|
+
if (node.type === 'CatchClause') {
|
|
28973
|
+
newScope = new Scope$2({
|
|
28974
|
+
parent: scope,
|
|
28975
|
+
params: node.param ? [node.param] : [],
|
|
28976
|
+
block: true
|
|
28977
|
+
});
|
|
28978
|
+
}
|
|
28979
|
+
if (newScope) {
|
|
28980
|
+
Object.defineProperty(node, propertyName, {
|
|
28981
|
+
value: newScope,
|
|
28982
|
+
configurable: true
|
|
28983
|
+
});
|
|
28984
|
+
scope = newScope;
|
|
28985
|
+
}
|
|
28986
|
+
},
|
|
28987
|
+
leave(n) {
|
|
28988
|
+
const node = n;
|
|
28989
|
+
if (node[propertyName])
|
|
28990
|
+
scope = scope.parent;
|
|
28991
|
+
}
|
|
28992
|
+
});
|
|
28993
|
+
return scope;
|
|
28994
|
+
};
|
|
28995
|
+
|
|
28849
28996
|
// Helper since Typescript can't detect readonly arrays with Array.isArray
|
|
28850
|
-
function isArray$
|
|
28997
|
+
function isArray$2(arg) {
|
|
28851
28998
|
return Array.isArray(arg);
|
|
28852
28999
|
}
|
|
28853
|
-
function ensureArray$
|
|
28854
|
-
if (isArray$
|
|
29000
|
+
function ensureArray$2(thing) {
|
|
29001
|
+
if (isArray$2(thing))
|
|
28855
29002
|
return thing;
|
|
28856
29003
|
if (thing == null)
|
|
28857
29004
|
return [];
|
|
28858
29005
|
return [thing];
|
|
28859
29006
|
}
|
|
28860
29007
|
|
|
28861
|
-
const normalizePath
|
|
29008
|
+
const normalizePath = function normalizePath(filename) {
|
|
28862
29009
|
return filename.split(win32$1.sep).join(posix$1.sep);
|
|
28863
29010
|
};
|
|
28864
29011
|
|
|
28865
|
-
function getMatcherString$
|
|
29012
|
+
function getMatcherString$2(id, resolutionBase) {
|
|
28866
29013
|
if (resolutionBase === false || isAbsolute$1(id) || id.startsWith('*')) {
|
|
28867
|
-
return normalizePath
|
|
29014
|
+
return normalizePath(id);
|
|
28868
29015
|
}
|
|
28869
29016
|
// resolve('') is valid and will default to process.cwd()
|
|
28870
|
-
const basePath = normalizePath
|
|
29017
|
+
const basePath = normalizePath(resolve$1(resolutionBase || ''))
|
|
28871
29018
|
// escape all possible (posix + win) path characters that might interfere with regex
|
|
28872
29019
|
.replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
|
|
28873
29020
|
// Note that we use posix.join because:
|
|
28874
29021
|
// 1. the basePath has been normalized to use /
|
|
28875
29022
|
// 2. the incoming glob (id) matcher, also uses /
|
|
28876
29023
|
// otherwise Node will force backslash (\) on windows
|
|
28877
|
-
return posix$1.join(basePath, normalizePath
|
|
29024
|
+
return posix$1.join(basePath, normalizePath(id));
|
|
28878
29025
|
}
|
|
28879
|
-
const createFilter$
|
|
29026
|
+
const createFilter$2 = function createFilter(include, exclude, options) {
|
|
28880
29027
|
const resolutionBase = options && options.resolve;
|
|
28881
29028
|
const getMatcher = (id) => id instanceof RegExp
|
|
28882
29029
|
? id
|
|
28883
29030
|
: {
|
|
28884
29031
|
test: (what) => {
|
|
28885
29032
|
// this refactor is a tad overly verbose but makes for easy debugging
|
|
28886
|
-
const pattern = getMatcherString$
|
|
29033
|
+
const pattern = getMatcherString$2(id, resolutionBase);
|
|
28887
29034
|
const fn = picomatch(pattern, { dot: true });
|
|
28888
29035
|
const result = fn(what);
|
|
28889
29036
|
return result;
|
|
28890
29037
|
}
|
|
28891
29038
|
};
|
|
28892
|
-
const includeMatchers = ensureArray$
|
|
28893
|
-
const excludeMatchers = ensureArray$
|
|
29039
|
+
const includeMatchers = ensureArray$2(include).map(getMatcher);
|
|
29040
|
+
const excludeMatchers = ensureArray$2(exclude).map(getMatcher);
|
|
28894
29041
|
return function result(id) {
|
|
28895
29042
|
if (typeof id !== 'string')
|
|
28896
29043
|
return false;
|
|
28897
29044
|
if (/\0/.test(id))
|
|
28898
29045
|
return false;
|
|
28899
|
-
const pathId = normalizePath
|
|
29046
|
+
const pathId = normalizePath(id);
|
|
28900
29047
|
for (let i = 0; i < excludeMatchers.length; ++i) {
|
|
28901
29048
|
const matcher = excludeMatchers[i];
|
|
28902
29049
|
if (matcher.test(pathId))
|
|
@@ -28911,52 +29058,52 @@ const createFilter$3 = function createFilter(include, exclude, options) {
|
|
|
28911
29058
|
};
|
|
28912
29059
|
};
|
|
28913
29060
|
|
|
28914
|
-
const reservedWords$
|
|
28915
|
-
const builtins$
|
|
28916
|
-
const forbiddenIdentifiers$
|
|
28917
|
-
forbiddenIdentifiers$
|
|
28918
|
-
const makeLegalIdentifier
|
|
29061
|
+
const reservedWords$2 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
|
|
29062
|
+
const builtins$3 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
|
|
29063
|
+
const forbiddenIdentifiers$2 = new Set(`${reservedWords$2} ${builtins$3}`.split(' '));
|
|
29064
|
+
forbiddenIdentifiers$2.add('');
|
|
29065
|
+
const makeLegalIdentifier = function makeLegalIdentifier(str) {
|
|
28919
29066
|
let identifier = str
|
|
28920
29067
|
.replace(/-(\w)/g, (_, letter) => letter.toUpperCase())
|
|
28921
29068
|
.replace(/[^$_a-zA-Z0-9]/g, '_');
|
|
28922
|
-
if (/\d/.test(identifier[0]) || forbiddenIdentifiers$
|
|
29069
|
+
if (/\d/.test(identifier[0]) || forbiddenIdentifiers$2.has(identifier)) {
|
|
28923
29070
|
identifier = `_${identifier}`;
|
|
28924
29071
|
}
|
|
28925
29072
|
return identifier || '_';
|
|
28926
29073
|
};
|
|
28927
29074
|
|
|
28928
|
-
function stringify
|
|
29075
|
+
function stringify(obj) {
|
|
28929
29076
|
return (JSON.stringify(obj) || 'undefined').replace(/[\u2028\u2029]/g, (char) => `\\u${`000${char.charCodeAt(0).toString(16)}`.slice(-4)}`);
|
|
28930
29077
|
}
|
|
28931
|
-
function serializeArray
|
|
29078
|
+
function serializeArray(arr, indent, baseIndent) {
|
|
28932
29079
|
let output = '[';
|
|
28933
29080
|
const separator = indent ? `\n${baseIndent}${indent}` : '';
|
|
28934
29081
|
for (let i = 0; i < arr.length; i++) {
|
|
28935
29082
|
const key = arr[i];
|
|
28936
|
-
output += `${i > 0 ? ',' : ''}${separator}${serialize
|
|
29083
|
+
output += `${i > 0 ? ',' : ''}${separator}${serialize(key, indent, baseIndent + indent)}`;
|
|
28937
29084
|
}
|
|
28938
29085
|
return `${output}${indent ? `\n${baseIndent}` : ''}]`;
|
|
28939
29086
|
}
|
|
28940
|
-
function serializeObject
|
|
29087
|
+
function serializeObject(obj, indent, baseIndent) {
|
|
28941
29088
|
let output = '{';
|
|
28942
29089
|
const separator = indent ? `\n${baseIndent}${indent}` : '';
|
|
28943
29090
|
const entries = Object.entries(obj);
|
|
28944
29091
|
for (let i = 0; i < entries.length; i++) {
|
|
28945
29092
|
const [key, value] = entries[i];
|
|
28946
|
-
const stringKey = makeLegalIdentifier
|
|
28947
|
-
output += `${i > 0 ? ',' : ''}${separator}${stringKey}:${indent ? ' ' : ''}${serialize
|
|
29093
|
+
const stringKey = makeLegalIdentifier(key) === key ? key : stringify(key);
|
|
29094
|
+
output += `${i > 0 ? ',' : ''}${separator}${stringKey}:${indent ? ' ' : ''}${serialize(value, indent, baseIndent + indent)}`;
|
|
28948
29095
|
}
|
|
28949
29096
|
return `${output}${indent ? `\n${baseIndent}` : ''}}`;
|
|
28950
29097
|
}
|
|
28951
|
-
function serialize
|
|
29098
|
+
function serialize(obj, indent, baseIndent) {
|
|
28952
29099
|
if (typeof obj === 'object' && obj !== null) {
|
|
28953
29100
|
if (Array.isArray(obj))
|
|
28954
|
-
return serializeArray
|
|
29101
|
+
return serializeArray(obj, indent, baseIndent);
|
|
28955
29102
|
if (obj instanceof Date)
|
|
28956
29103
|
return `new Date(${obj.getTime()})`;
|
|
28957
29104
|
if (obj instanceof RegExp)
|
|
28958
29105
|
return obj.toString();
|
|
28959
|
-
return serializeObject
|
|
29106
|
+
return serializeObject(obj, indent, baseIndent);
|
|
28960
29107
|
}
|
|
28961
29108
|
if (typeof obj === 'number') {
|
|
28962
29109
|
if (obj === Infinity)
|
|
@@ -28970,14 +29117,15 @@ function serialize$1(obj, indent, baseIndent) {
|
|
|
28970
29117
|
}
|
|
28971
29118
|
if (typeof obj === 'symbol') {
|
|
28972
29119
|
const key = Symbol.keyFor(obj);
|
|
29120
|
+
// eslint-disable-next-line no-undefined
|
|
28973
29121
|
if (key !== undefined)
|
|
28974
|
-
return `Symbol.for(${stringify
|
|
29122
|
+
return `Symbol.for(${stringify(key)})`;
|
|
28975
29123
|
}
|
|
28976
29124
|
if (typeof obj === 'bigint')
|
|
28977
29125
|
return `${obj}n`;
|
|
28978
|
-
return stringify
|
|
29126
|
+
return stringify(obj);
|
|
28979
29127
|
}
|
|
28980
|
-
const dataToEsm
|
|
29128
|
+
const dataToEsm = function dataToEsm(data, options = {}) {
|
|
28981
29129
|
const t = options.compact ? '' : 'indent' in options ? options.indent : '\t';
|
|
28982
29130
|
const _ = options.compact ? '' : ' ';
|
|
28983
29131
|
const n = options.compact ? '' : '\n';
|
|
@@ -28988,31 +29136,42 @@ const dataToEsm$1 = function dataToEsm(data, options = {}) {
|
|
|
28988
29136
|
data instanceof Date ||
|
|
28989
29137
|
data instanceof RegExp ||
|
|
28990
29138
|
data === null) {
|
|
28991
|
-
const code = serialize
|
|
29139
|
+
const code = serialize(data, options.compact ? null : t, '');
|
|
28992
29140
|
const magic = _ || (/^[{[\-\/]/.test(code) ? '' : ' '); // eslint-disable-line no-useless-escape
|
|
28993
29141
|
return `export default${magic}${code};`;
|
|
28994
29142
|
}
|
|
28995
29143
|
let namedExportCode = '';
|
|
28996
29144
|
const defaultExportRows = [];
|
|
28997
29145
|
for (const [key, value] of Object.entries(data)) {
|
|
28998
|
-
if (key === makeLegalIdentifier
|
|
29146
|
+
if (key === makeLegalIdentifier(key)) {
|
|
28999
29147
|
if (options.objectShorthand)
|
|
29000
29148
|
defaultExportRows.push(key);
|
|
29001
29149
|
else
|
|
29002
29150
|
defaultExportRows.push(`${key}:${_}${key}`);
|
|
29003
|
-
namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize
|
|
29151
|
+
namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
|
|
29004
29152
|
}
|
|
29005
29153
|
else {
|
|
29006
|
-
defaultExportRows.push(`${stringify
|
|
29154
|
+
defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, '')}`);
|
|
29007
29155
|
}
|
|
29008
29156
|
}
|
|
29009
29157
|
return `${namedExportCode}export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;
|
|
29010
29158
|
};
|
|
29011
29159
|
|
|
29160
|
+
// TODO: remove this in next major
|
|
29161
|
+
var index = {
|
|
29162
|
+
addExtension,
|
|
29163
|
+
attachScopes,
|
|
29164
|
+
createFilter: createFilter$2,
|
|
29165
|
+
dataToEsm,
|
|
29166
|
+
extractAssignedNames: extractAssignedNames$2,
|
|
29167
|
+
makeLegalIdentifier,
|
|
29168
|
+
normalizePath
|
|
29169
|
+
};
|
|
29170
|
+
|
|
29012
29171
|
function json(options) {
|
|
29013
29172
|
if ( options === void 0 ) options = {};
|
|
29014
29173
|
|
|
29015
|
-
var filter = createFilter$
|
|
29174
|
+
var filter = createFilter$2(options.include, options.exclude);
|
|
29016
29175
|
var indent = 'indent' in options ? options.indent : '\t';
|
|
29017
29176
|
|
|
29018
29177
|
return {
|
|
@@ -29025,7 +29184,7 @@ function json(options) {
|
|
|
29025
29184
|
try {
|
|
29026
29185
|
var parsed = JSON.parse(code);
|
|
29027
29186
|
return {
|
|
29028
|
-
code: dataToEsm
|
|
29187
|
+
code: dataToEsm(parsed, {
|
|
29029
29188
|
preferConst: options.preferConst,
|
|
29030
29189
|
compact: options.compact,
|
|
29031
29190
|
namedExports: options.namedExports,
|
|
@@ -29198,18 +29357,18 @@ var isModule = function (sauce) {
|
|
|
29198
29357
|
};
|
|
29199
29358
|
|
|
29200
29359
|
// Helper since Typescript can't detect readonly arrays with Array.isArray
|
|
29201
|
-
function isArray$
|
|
29360
|
+
function isArray$1(arg) {
|
|
29202
29361
|
return Array.isArray(arg);
|
|
29203
29362
|
}
|
|
29204
|
-
function ensureArray$
|
|
29205
|
-
if (isArray$
|
|
29363
|
+
function ensureArray$1(thing) {
|
|
29364
|
+
if (isArray$1(thing))
|
|
29206
29365
|
return thing;
|
|
29207
29366
|
if (thing == null)
|
|
29208
29367
|
return [];
|
|
29209
29368
|
return [thing];
|
|
29210
29369
|
}
|
|
29211
29370
|
|
|
29212
|
-
function getMatcherString$
|
|
29371
|
+
function getMatcherString$1(id, resolutionBase) {
|
|
29213
29372
|
if (resolutionBase === false) {
|
|
29214
29373
|
return id;
|
|
29215
29374
|
}
|
|
@@ -29225,21 +29384,21 @@ function getMatcherString$2(id, resolutionBase) {
|
|
|
29225
29384
|
// otherwise Node will force backslash (\) on windows
|
|
29226
29385
|
return posix$1.join(basePath, id);
|
|
29227
29386
|
}
|
|
29228
|
-
const createFilter$
|
|
29387
|
+
const createFilter$1 = function createFilter(include, exclude, options) {
|
|
29229
29388
|
const resolutionBase = options && options.resolve;
|
|
29230
29389
|
const getMatcher = (id) => id instanceof RegExp
|
|
29231
29390
|
? id
|
|
29232
29391
|
: {
|
|
29233
29392
|
test: (what) => {
|
|
29234
29393
|
// this refactor is a tad overly verbose but makes for easy debugging
|
|
29235
|
-
const pattern = getMatcherString$
|
|
29394
|
+
const pattern = getMatcherString$1(id, resolutionBase);
|
|
29236
29395
|
const fn = picomatch(pattern, { dot: true });
|
|
29237
29396
|
const result = fn(what);
|
|
29238
29397
|
return result;
|
|
29239
29398
|
}
|
|
29240
29399
|
};
|
|
29241
|
-
const includeMatchers = ensureArray$
|
|
29242
|
-
const excludeMatchers = ensureArray$
|
|
29400
|
+
const includeMatchers = ensureArray$1(include).map(getMatcher);
|
|
29401
|
+
const excludeMatchers = ensureArray$1(exclude).map(getMatcher);
|
|
29243
29402
|
return function result(id) {
|
|
29244
29403
|
if (typeof id !== 'string')
|
|
29245
29404
|
return false;
|
|
@@ -29260,10 +29419,10 @@ const createFilter$2 = function createFilter(include, exclude, options) {
|
|
|
29260
29419
|
};
|
|
29261
29420
|
};
|
|
29262
29421
|
|
|
29263
|
-
const reservedWords$
|
|
29264
|
-
const builtins$
|
|
29265
|
-
const forbiddenIdentifiers$
|
|
29266
|
-
forbiddenIdentifiers$
|
|
29422
|
+
const reservedWords$1$1 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
|
|
29423
|
+
const builtins$2 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
|
|
29424
|
+
const forbiddenIdentifiers$1 = new Set(`${reservedWords$1$1} ${builtins$2}`.split(' '));
|
|
29425
|
+
forbiddenIdentifiers$1.add('');
|
|
29267
29426
|
|
|
29268
29427
|
const exists = promisify(fs$3.exists);
|
|
29269
29428
|
const readFile$1 = promisify(fs$3.readFile);
|
|
@@ -29456,7 +29615,7 @@ function getPackageInfo(options) {
|
|
|
29456
29615
|
if (typeof packageSideEffects === 'boolean') {
|
|
29457
29616
|
internalPackageInfo.hasModuleSideEffects = () => packageSideEffects;
|
|
29458
29617
|
} else if (Array.isArray(packageSideEffects)) {
|
|
29459
|
-
internalPackageInfo.hasModuleSideEffects = createFilter$
|
|
29618
|
+
internalPackageInfo.hasModuleSideEffects = createFilter$1(packageSideEffects, null, {
|
|
29460
29619
|
resolve: pkgRoot
|
|
29461
29620
|
});
|
|
29462
29621
|
}
|
|
@@ -29511,7 +29670,7 @@ function resolveImportSpecifiers(importSpecifierList, resolveOptions) {
|
|
|
29511
29670
|
|
|
29512
29671
|
/* eslint-disable no-param-reassign, no-shadow, no-undefined */
|
|
29513
29672
|
|
|
29514
|
-
const builtins$
|
|
29673
|
+
const builtins$1$1 = new Set(builtinModules_1);
|
|
29515
29674
|
const ES6_BROWSER_EMPTY = '\0node-resolve:empty.js';
|
|
29516
29675
|
const nullFn = () => null;
|
|
29517
29676
|
const deepFreeze = (object) => {
|
|
@@ -29691,7 +29850,7 @@ function nodeResolve(opts = {}) {
|
|
|
29691
29850
|
importSpecifierList.push(`./${importee}`);
|
|
29692
29851
|
}
|
|
29693
29852
|
|
|
29694
|
-
const importeeIsBuiltin = builtins$
|
|
29853
|
+
const importeeIsBuiltin = builtins$1$1.has(importee);
|
|
29695
29854
|
|
|
29696
29855
|
if (importeeIsBuiltin && (!preferBuiltins || !isPreferBuiltinsSet)) {
|
|
29697
29856
|
// The `resolve` library will not resolve packages with the same
|
|
@@ -29739,7 +29898,7 @@ function nodeResolve(opts = {}) {
|
|
|
29739
29898
|
idToPackageInfo.set(resolved, packageInfo);
|
|
29740
29899
|
|
|
29741
29900
|
if (hasPackageEntry) {
|
|
29742
|
-
if (builtins$
|
|
29901
|
+
if (builtins$1$1.has(resolved) && preferBuiltins && isPreferBuiltinsSet) {
|
|
29743
29902
|
return null;
|
|
29744
29903
|
} else if (importeeIsBuiltin && preferBuiltins) {
|
|
29745
29904
|
if (!isPreferBuiltinsSet) {
|
|
@@ -30799,18 +30958,18 @@ MagicString$2.prototype.trimStart = function trimStart (charType) {
|
|
|
30799
30958
|
};
|
|
30800
30959
|
|
|
30801
30960
|
// Helper since Typescript can't detect readonly arrays with Array.isArray
|
|
30802
|
-
function isArray$
|
|
30961
|
+
function isArray$5(arg) {
|
|
30803
30962
|
return Array.isArray(arg);
|
|
30804
30963
|
}
|
|
30805
|
-
function ensureArray$
|
|
30806
|
-
if (isArray$
|
|
30964
|
+
function ensureArray$4(thing) {
|
|
30965
|
+
if (isArray$5(thing))
|
|
30807
30966
|
return thing;
|
|
30808
30967
|
if (thing == null)
|
|
30809
30968
|
return [];
|
|
30810
30969
|
return [thing];
|
|
30811
30970
|
}
|
|
30812
30971
|
|
|
30813
|
-
function getMatcherString
|
|
30972
|
+
function getMatcherString(id, resolutionBase) {
|
|
30814
30973
|
if (resolutionBase === false) {
|
|
30815
30974
|
return id;
|
|
30816
30975
|
}
|
|
@@ -30826,21 +30985,21 @@ function getMatcherString$1(id, resolutionBase) {
|
|
|
30826
30985
|
// otherwise Node will force backslash (\) on windows
|
|
30827
30986
|
return posix$1.join(basePath, id);
|
|
30828
30987
|
}
|
|
30829
|
-
const createFilter
|
|
30988
|
+
const createFilter = function createFilter(include, exclude, options) {
|
|
30830
30989
|
const resolutionBase = options && options.resolve;
|
|
30831
30990
|
const getMatcher = (id) => id instanceof RegExp
|
|
30832
30991
|
? id
|
|
30833
30992
|
: {
|
|
30834
30993
|
test: (what) => {
|
|
30835
30994
|
// this refactor is a tad overly verbose but makes for easy debugging
|
|
30836
|
-
const pattern = getMatcherString
|
|
30995
|
+
const pattern = getMatcherString(id, resolutionBase);
|
|
30837
30996
|
const fn = picomatch(pattern, { dot: true });
|
|
30838
30997
|
const result = fn(what);
|
|
30839
30998
|
return result;
|
|
30840
30999
|
}
|
|
30841
31000
|
};
|
|
30842
|
-
const includeMatchers = ensureArray$
|
|
30843
|
-
const excludeMatchers = ensureArray$
|
|
31001
|
+
const includeMatchers = ensureArray$4(include).map(getMatcher);
|
|
31002
|
+
const excludeMatchers = ensureArray$4(exclude).map(getMatcher);
|
|
30844
31003
|
return function result(id) {
|
|
30845
31004
|
if (typeof id !== 'string')
|
|
30846
31005
|
return false;
|
|
@@ -30861,10 +31020,10 @@ const createFilter$1 = function createFilter(include, exclude, options) {
|
|
|
30861
31020
|
};
|
|
30862
31021
|
};
|
|
30863
31022
|
|
|
30864
|
-
const reservedWords$
|
|
30865
|
-
const builtins$
|
|
30866
|
-
const forbiddenIdentifiers
|
|
30867
|
-
forbiddenIdentifiers
|
|
31023
|
+
const reservedWords$4 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
|
|
31024
|
+
const builtins$5 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
|
|
31025
|
+
const forbiddenIdentifiers = new Set(`${reservedWords$4} ${builtins$5}`.split(' '));
|
|
31026
|
+
forbiddenIdentifiers.add('');
|
|
30868
31027
|
|
|
30869
31028
|
function escape(str) {
|
|
30870
31029
|
return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
|
|
@@ -30903,7 +31062,7 @@ function mapToFunctions(object) {
|
|
|
30903
31062
|
function replace(options) {
|
|
30904
31063
|
if ( options === void 0 ) options = {};
|
|
30905
31064
|
|
|
30906
|
-
var filter = createFilter
|
|
31065
|
+
var filter = createFilter(options.include, options.exclude);
|
|
30907
31066
|
var delimiters = options.delimiters;
|
|
30908
31067
|
var functionValues = mapToFunctions(getReplacements(options));
|
|
30909
31068
|
var keys = Object.keys(functionValues)
|
|
@@ -30964,328 +31123,6 @@ function replace(options) {
|
|
|
30964
31123
|
}
|
|
30965
31124
|
}
|
|
30966
31125
|
|
|
30967
|
-
const addExtension = function addExtension(filename, ext = '.js') {
|
|
30968
|
-
let result = `${filename}`;
|
|
30969
|
-
if (!extname$1(filename))
|
|
30970
|
-
result += ext;
|
|
30971
|
-
return result;
|
|
30972
|
-
};
|
|
30973
|
-
|
|
30974
|
-
const extractors$2 = {
|
|
30975
|
-
ArrayPattern(names, param) {
|
|
30976
|
-
for (const element of param.elements) {
|
|
30977
|
-
if (element)
|
|
30978
|
-
extractors$2[element.type](names, element);
|
|
30979
|
-
}
|
|
30980
|
-
},
|
|
30981
|
-
AssignmentPattern(names, param) {
|
|
30982
|
-
extractors$2[param.left.type](names, param.left);
|
|
30983
|
-
},
|
|
30984
|
-
Identifier(names, param) {
|
|
30985
|
-
names.push(param.name);
|
|
30986
|
-
},
|
|
30987
|
-
MemberExpression() { },
|
|
30988
|
-
ObjectPattern(names, param) {
|
|
30989
|
-
for (const prop of param.properties) {
|
|
30990
|
-
// @ts-ignore Typescript reports that this is not a valid type
|
|
30991
|
-
if (prop.type === 'RestElement') {
|
|
30992
|
-
extractors$2.RestElement(names, prop);
|
|
30993
|
-
}
|
|
30994
|
-
else {
|
|
30995
|
-
extractors$2[prop.value.type](names, prop.value);
|
|
30996
|
-
}
|
|
30997
|
-
}
|
|
30998
|
-
},
|
|
30999
|
-
RestElement(names, param) {
|
|
31000
|
-
extractors$2[param.argument.type](names, param.argument);
|
|
31001
|
-
}
|
|
31002
|
-
};
|
|
31003
|
-
const extractAssignedNames$2 = function extractAssignedNames(param) {
|
|
31004
|
-
const names = [];
|
|
31005
|
-
extractors$2[param.type](names, param);
|
|
31006
|
-
return names;
|
|
31007
|
-
};
|
|
31008
|
-
|
|
31009
|
-
const blockDeclarations = {
|
|
31010
|
-
const: true,
|
|
31011
|
-
let: true
|
|
31012
|
-
};
|
|
31013
|
-
class Scope$2 {
|
|
31014
|
-
constructor(options = {}) {
|
|
31015
|
-
this.parent = options.parent;
|
|
31016
|
-
this.isBlockScope = !!options.block;
|
|
31017
|
-
this.declarations = Object.create(null);
|
|
31018
|
-
if (options.params) {
|
|
31019
|
-
options.params.forEach((param) => {
|
|
31020
|
-
extractAssignedNames$2(param).forEach((name) => {
|
|
31021
|
-
this.declarations[name] = true;
|
|
31022
|
-
});
|
|
31023
|
-
});
|
|
31024
|
-
}
|
|
31025
|
-
}
|
|
31026
|
-
addDeclaration(node, isBlockDeclaration, isVar) {
|
|
31027
|
-
if (!isBlockDeclaration && this.isBlockScope) {
|
|
31028
|
-
// it's a `var` or function node, and this
|
|
31029
|
-
// is a block scope, so we need to go up
|
|
31030
|
-
this.parent.addDeclaration(node, isBlockDeclaration, isVar);
|
|
31031
|
-
}
|
|
31032
|
-
else if (node.id) {
|
|
31033
|
-
extractAssignedNames$2(node.id).forEach((name) => {
|
|
31034
|
-
this.declarations[name] = true;
|
|
31035
|
-
});
|
|
31036
|
-
}
|
|
31037
|
-
}
|
|
31038
|
-
contains(name) {
|
|
31039
|
-
return this.declarations[name] || (this.parent ? this.parent.contains(name) : false);
|
|
31040
|
-
}
|
|
31041
|
-
}
|
|
31042
|
-
const attachScopes = function attachScopes(ast, propertyName = 'scope') {
|
|
31043
|
-
let scope = new Scope$2();
|
|
31044
|
-
walk(ast, {
|
|
31045
|
-
enter(n, parent) {
|
|
31046
|
-
const node = n;
|
|
31047
|
-
// function foo () {...}
|
|
31048
|
-
// class Foo {...}
|
|
31049
|
-
if (/(Function|Class)Declaration/.test(node.type)) {
|
|
31050
|
-
scope.addDeclaration(node, false, false);
|
|
31051
|
-
}
|
|
31052
|
-
// var foo = 1
|
|
31053
|
-
if (node.type === 'VariableDeclaration') {
|
|
31054
|
-
const { kind } = node;
|
|
31055
|
-
const isBlockDeclaration = blockDeclarations[kind];
|
|
31056
|
-
node.declarations.forEach((declaration) => {
|
|
31057
|
-
scope.addDeclaration(declaration, isBlockDeclaration, true);
|
|
31058
|
-
});
|
|
31059
|
-
}
|
|
31060
|
-
let newScope;
|
|
31061
|
-
// create new function scope
|
|
31062
|
-
if (/Function/.test(node.type)) {
|
|
31063
|
-
const func = node;
|
|
31064
|
-
newScope = new Scope$2({
|
|
31065
|
-
parent: scope,
|
|
31066
|
-
block: false,
|
|
31067
|
-
params: func.params
|
|
31068
|
-
});
|
|
31069
|
-
// named function expressions - the name is considered
|
|
31070
|
-
// part of the function's scope
|
|
31071
|
-
if (func.type === 'FunctionExpression' && func.id) {
|
|
31072
|
-
newScope.addDeclaration(func, false, false);
|
|
31073
|
-
}
|
|
31074
|
-
}
|
|
31075
|
-
// create new for scope
|
|
31076
|
-
if (/For(In|Of)?Statement/.test(node.type)) {
|
|
31077
|
-
newScope = new Scope$2({
|
|
31078
|
-
parent: scope,
|
|
31079
|
-
block: true
|
|
31080
|
-
});
|
|
31081
|
-
}
|
|
31082
|
-
// create new block scope
|
|
31083
|
-
if (node.type === 'BlockStatement' && !/Function/.test(parent.type)) {
|
|
31084
|
-
newScope = new Scope$2({
|
|
31085
|
-
parent: scope,
|
|
31086
|
-
block: true
|
|
31087
|
-
});
|
|
31088
|
-
}
|
|
31089
|
-
// catch clause has its own block scope
|
|
31090
|
-
if (node.type === 'CatchClause') {
|
|
31091
|
-
newScope = new Scope$2({
|
|
31092
|
-
parent: scope,
|
|
31093
|
-
params: node.param ? [node.param] : [],
|
|
31094
|
-
block: true
|
|
31095
|
-
});
|
|
31096
|
-
}
|
|
31097
|
-
if (newScope) {
|
|
31098
|
-
Object.defineProperty(node, propertyName, {
|
|
31099
|
-
value: newScope,
|
|
31100
|
-
configurable: true
|
|
31101
|
-
});
|
|
31102
|
-
scope = newScope;
|
|
31103
|
-
}
|
|
31104
|
-
},
|
|
31105
|
-
leave(n) {
|
|
31106
|
-
const node = n;
|
|
31107
|
-
if (node[propertyName])
|
|
31108
|
-
scope = scope.parent;
|
|
31109
|
-
}
|
|
31110
|
-
});
|
|
31111
|
-
return scope;
|
|
31112
|
-
};
|
|
31113
|
-
|
|
31114
|
-
// Helper since Typescript can't detect readonly arrays with Array.isArray
|
|
31115
|
-
function isArray$6(arg) {
|
|
31116
|
-
return Array.isArray(arg);
|
|
31117
|
-
}
|
|
31118
|
-
function ensureArray$5(thing) {
|
|
31119
|
-
if (isArray$6(thing))
|
|
31120
|
-
return thing;
|
|
31121
|
-
if (thing == null)
|
|
31122
|
-
return [];
|
|
31123
|
-
return [thing];
|
|
31124
|
-
}
|
|
31125
|
-
|
|
31126
|
-
const normalizePath = function normalizePath(filename) {
|
|
31127
|
-
return filename.split(win32$1.sep).join(posix$1.sep);
|
|
31128
|
-
};
|
|
31129
|
-
|
|
31130
|
-
function getMatcherString(id, resolutionBase) {
|
|
31131
|
-
if (resolutionBase === false || isAbsolute$1(id) || id.startsWith('*')) {
|
|
31132
|
-
return normalizePath(id);
|
|
31133
|
-
}
|
|
31134
|
-
// resolve('') is valid and will default to process.cwd()
|
|
31135
|
-
const basePath = normalizePath(resolve$1(resolutionBase || ''))
|
|
31136
|
-
// escape all possible (posix + win) path characters that might interfere with regex
|
|
31137
|
-
.replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
|
|
31138
|
-
// Note that we use posix.join because:
|
|
31139
|
-
// 1. the basePath has been normalized to use /
|
|
31140
|
-
// 2. the incoming glob (id) matcher, also uses /
|
|
31141
|
-
// otherwise Node will force backslash (\) on windows
|
|
31142
|
-
return posix$1.join(basePath, normalizePath(id));
|
|
31143
|
-
}
|
|
31144
|
-
const createFilter = function createFilter(include, exclude, options) {
|
|
31145
|
-
const resolutionBase = options && options.resolve;
|
|
31146
|
-
const getMatcher = (id) => id instanceof RegExp
|
|
31147
|
-
? id
|
|
31148
|
-
: {
|
|
31149
|
-
test: (what) => {
|
|
31150
|
-
// this refactor is a tad overly verbose but makes for easy debugging
|
|
31151
|
-
const pattern = getMatcherString(id, resolutionBase);
|
|
31152
|
-
const fn = picomatch(pattern, { dot: true });
|
|
31153
|
-
const result = fn(what);
|
|
31154
|
-
return result;
|
|
31155
|
-
}
|
|
31156
|
-
};
|
|
31157
|
-
const includeMatchers = ensureArray$5(include).map(getMatcher);
|
|
31158
|
-
const excludeMatchers = ensureArray$5(exclude).map(getMatcher);
|
|
31159
|
-
return function result(id) {
|
|
31160
|
-
if (typeof id !== 'string')
|
|
31161
|
-
return false;
|
|
31162
|
-
if (/\0/.test(id))
|
|
31163
|
-
return false;
|
|
31164
|
-
const pathId = normalizePath(id);
|
|
31165
|
-
for (let i = 0; i < excludeMatchers.length; ++i) {
|
|
31166
|
-
const matcher = excludeMatchers[i];
|
|
31167
|
-
if (matcher.test(pathId))
|
|
31168
|
-
return false;
|
|
31169
|
-
}
|
|
31170
|
-
for (let i = 0; i < includeMatchers.length; ++i) {
|
|
31171
|
-
const matcher = includeMatchers[i];
|
|
31172
|
-
if (matcher.test(pathId))
|
|
31173
|
-
return true;
|
|
31174
|
-
}
|
|
31175
|
-
return !includeMatchers.length;
|
|
31176
|
-
};
|
|
31177
|
-
};
|
|
31178
|
-
|
|
31179
|
-
const reservedWords$5 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
|
|
31180
|
-
const builtins$6 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
|
|
31181
|
-
const forbiddenIdentifiers = new Set(`${reservedWords$5} ${builtins$6}`.split(' '));
|
|
31182
|
-
forbiddenIdentifiers.add('');
|
|
31183
|
-
const makeLegalIdentifier = function makeLegalIdentifier(str) {
|
|
31184
|
-
let identifier = str
|
|
31185
|
-
.replace(/-(\w)/g, (_, letter) => letter.toUpperCase())
|
|
31186
|
-
.replace(/[^$_a-zA-Z0-9]/g, '_');
|
|
31187
|
-
if (/\d/.test(identifier[0]) || forbiddenIdentifiers.has(identifier)) {
|
|
31188
|
-
identifier = `_${identifier}`;
|
|
31189
|
-
}
|
|
31190
|
-
return identifier || '_';
|
|
31191
|
-
};
|
|
31192
|
-
|
|
31193
|
-
function stringify(obj) {
|
|
31194
|
-
return (JSON.stringify(obj) || 'undefined').replace(/[\u2028\u2029]/g, (char) => `\\u${`000${char.charCodeAt(0).toString(16)}`.slice(-4)}`);
|
|
31195
|
-
}
|
|
31196
|
-
function serializeArray(arr, indent, baseIndent) {
|
|
31197
|
-
let output = '[';
|
|
31198
|
-
const separator = indent ? `\n${baseIndent}${indent}` : '';
|
|
31199
|
-
for (let i = 0; i < arr.length; i++) {
|
|
31200
|
-
const key = arr[i];
|
|
31201
|
-
output += `${i > 0 ? ',' : ''}${separator}${serialize(key, indent, baseIndent + indent)}`;
|
|
31202
|
-
}
|
|
31203
|
-
return `${output}${indent ? `\n${baseIndent}` : ''}]`;
|
|
31204
|
-
}
|
|
31205
|
-
function serializeObject(obj, indent, baseIndent) {
|
|
31206
|
-
let output = '{';
|
|
31207
|
-
const separator = indent ? `\n${baseIndent}${indent}` : '';
|
|
31208
|
-
const entries = Object.entries(obj);
|
|
31209
|
-
for (let i = 0; i < entries.length; i++) {
|
|
31210
|
-
const [key, value] = entries[i];
|
|
31211
|
-
const stringKey = makeLegalIdentifier(key) === key ? key : stringify(key);
|
|
31212
|
-
output += `${i > 0 ? ',' : ''}${separator}${stringKey}:${indent ? ' ' : ''}${serialize(value, indent, baseIndent + indent)}`;
|
|
31213
|
-
}
|
|
31214
|
-
return `${output}${indent ? `\n${baseIndent}` : ''}}`;
|
|
31215
|
-
}
|
|
31216
|
-
function serialize(obj, indent, baseIndent) {
|
|
31217
|
-
if (typeof obj === 'object' && obj !== null) {
|
|
31218
|
-
if (Array.isArray(obj))
|
|
31219
|
-
return serializeArray(obj, indent, baseIndent);
|
|
31220
|
-
if (obj instanceof Date)
|
|
31221
|
-
return `new Date(${obj.getTime()})`;
|
|
31222
|
-
if (obj instanceof RegExp)
|
|
31223
|
-
return obj.toString();
|
|
31224
|
-
return serializeObject(obj, indent, baseIndent);
|
|
31225
|
-
}
|
|
31226
|
-
if (typeof obj === 'number') {
|
|
31227
|
-
if (obj === Infinity)
|
|
31228
|
-
return 'Infinity';
|
|
31229
|
-
if (obj === -Infinity)
|
|
31230
|
-
return '-Infinity';
|
|
31231
|
-
if (obj === 0)
|
|
31232
|
-
return 1 / obj === Infinity ? '0' : '-0';
|
|
31233
|
-
if (obj !== obj)
|
|
31234
|
-
return 'NaN'; // eslint-disable-line no-self-compare
|
|
31235
|
-
}
|
|
31236
|
-
if (typeof obj === 'symbol') {
|
|
31237
|
-
const key = Symbol.keyFor(obj);
|
|
31238
|
-
// eslint-disable-next-line no-undefined
|
|
31239
|
-
if (key !== undefined)
|
|
31240
|
-
return `Symbol.for(${stringify(key)})`;
|
|
31241
|
-
}
|
|
31242
|
-
if (typeof obj === 'bigint')
|
|
31243
|
-
return `${obj}n`;
|
|
31244
|
-
return stringify(obj);
|
|
31245
|
-
}
|
|
31246
|
-
const dataToEsm = function dataToEsm(data, options = {}) {
|
|
31247
|
-
const t = options.compact ? '' : 'indent' in options ? options.indent : '\t';
|
|
31248
|
-
const _ = options.compact ? '' : ' ';
|
|
31249
|
-
const n = options.compact ? '' : '\n';
|
|
31250
|
-
const declarationType = options.preferConst ? 'const' : 'var';
|
|
31251
|
-
if (options.namedExports === false ||
|
|
31252
|
-
typeof data !== 'object' ||
|
|
31253
|
-
Array.isArray(data) ||
|
|
31254
|
-
data instanceof Date ||
|
|
31255
|
-
data instanceof RegExp ||
|
|
31256
|
-
data === null) {
|
|
31257
|
-
const code = serialize(data, options.compact ? null : t, '');
|
|
31258
|
-
const magic = _ || (/^[{[\-\/]/.test(code) ? '' : ' '); // eslint-disable-line no-useless-escape
|
|
31259
|
-
return `export default${magic}${code};`;
|
|
31260
|
-
}
|
|
31261
|
-
let namedExportCode = '';
|
|
31262
|
-
const defaultExportRows = [];
|
|
31263
|
-
for (const [key, value] of Object.entries(data)) {
|
|
31264
|
-
if (key === makeLegalIdentifier(key)) {
|
|
31265
|
-
if (options.objectShorthand)
|
|
31266
|
-
defaultExportRows.push(key);
|
|
31267
|
-
else
|
|
31268
|
-
defaultExportRows.push(`${key}:${_}${key}`);
|
|
31269
|
-
namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
|
|
31270
|
-
}
|
|
31271
|
-
else {
|
|
31272
|
-
defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, '')}`);
|
|
31273
|
-
}
|
|
31274
|
-
}
|
|
31275
|
-
return `${namedExportCode}export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;
|
|
31276
|
-
};
|
|
31277
|
-
|
|
31278
|
-
// TODO: remove this in next major
|
|
31279
|
-
var index = {
|
|
31280
|
-
addExtension,
|
|
31281
|
-
attachScopes,
|
|
31282
|
-
createFilter,
|
|
31283
|
-
dataToEsm,
|
|
31284
|
-
extractAssignedNames: extractAssignedNames$2,
|
|
31285
|
-
makeLegalIdentifier,
|
|
31286
|
-
normalizePath
|
|
31287
|
-
};
|
|
31288
|
-
|
|
31289
31126
|
var minimalisticAssert = assert;
|
|
31290
31127
|
|
|
31291
31128
|
function assert(val, msg) {
|
|
@@ -52175,7 +52012,7 @@ const lazyComponentPlugin = (buildCtx) => {
|
|
|
52175
52012
|
const createComponentExport = (cmp) => {
|
|
52176
52013
|
const originalClassName = cmp.componentClassName;
|
|
52177
52014
|
const underscoredClassName = cmp.tagName.replace(/-/g, '_');
|
|
52178
|
-
const filePath = normalizePath$
|
|
52015
|
+
const filePath = normalizePath$1(cmp.sourceFilePath);
|
|
52179
52016
|
return `export { ${originalClassName} as ${underscoredClassName} } from '${filePath}';`;
|
|
52180
52017
|
};
|
|
52181
52018
|
|
|
@@ -52300,7 +52137,7 @@ const appDataPlugin = (config, compilerCtx, buildCtx, build, platform) => {
|
|
|
52300
52137
|
return { code: module.staticSourceFileText, map: sourceMap };
|
|
52301
52138
|
},
|
|
52302
52139
|
transform(code, id) {
|
|
52303
|
-
id = normalizePath$
|
|
52140
|
+
id = normalizePath$1(id);
|
|
52304
52141
|
if (globalScripts.some((s) => s.path === id)) {
|
|
52305
52142
|
const program = this.parse(code, {});
|
|
52306
52143
|
const needsDefault = !program.body.some((s) => s.type === 'ExportDefaultDeclaration');
|
|
@@ -52342,7 +52179,7 @@ const getGlobalScriptData = (config, compilerCtx) => {
|
|
|
52342
52179
|
if (globalScript) {
|
|
52343
52180
|
globalScripts.push({
|
|
52344
52181
|
defaultName: createJsVarName(config.namespace + 'GlobalScript'),
|
|
52345
|
-
path: normalizePath$
|
|
52182
|
+
path: normalizePath$1(globalScript),
|
|
52346
52183
|
});
|
|
52347
52184
|
}
|
|
52348
52185
|
}
|
|
@@ -52354,7 +52191,7 @@ const getGlobalScriptData = (config, compilerCtx) => {
|
|
|
52354
52191
|
}
|
|
52355
52192
|
globalScripts.push({
|
|
52356
52193
|
defaultName,
|
|
52357
|
-
path: normalizePath$
|
|
52194
|
+
path: normalizePath$1(collection.global.sourceFilePath),
|
|
52358
52195
|
});
|
|
52359
52196
|
}
|
|
52360
52197
|
});
|
|
@@ -52509,14 +52346,14 @@ export const Build = {
|
|
|
52509
52346
|
};
|
|
52510
52347
|
const getStencilInternalModule = (config, compilerExe, internalModule) => {
|
|
52511
52348
|
if (isRemoteUrl(compilerExe)) {
|
|
52512
|
-
return normalizePath$
|
|
52349
|
+
return normalizePath$1(config.sys.getLocalModulePath({
|
|
52513
52350
|
rootDir: config.rootDir,
|
|
52514
52351
|
moduleId: '@stencil/core',
|
|
52515
52352
|
path: 'internal/' + internalModule,
|
|
52516
52353
|
}));
|
|
52517
52354
|
}
|
|
52518
52355
|
const compilerExeDir = dirname(compilerExe);
|
|
52519
|
-
return normalizePath$
|
|
52356
|
+
return normalizePath$1(join(compilerExeDir, '..', 'internal', internalModule));
|
|
52520
52357
|
};
|
|
52521
52358
|
const getHydratedFlagHead = (h) => {
|
|
52522
52359
|
// {visibility:hidden}.hydrated{visibility:inherit}
|
|
@@ -52782,18 +52619,18 @@ const getCssImports = async (config, compilerCtx, buildCtx, filePath, styleText)
|
|
|
52782
52619
|
}
|
|
52783
52620
|
else if (isAbsolute$1(cssImportData.url)) {
|
|
52784
52621
|
// absolute path already
|
|
52785
|
-
cssImportData.filePath = normalizePath$
|
|
52622
|
+
cssImportData.filePath = normalizePath$1(cssImportData.url);
|
|
52786
52623
|
}
|
|
52787
52624
|
else {
|
|
52788
52625
|
// relative path
|
|
52789
|
-
cssImportData.filePath = normalizePath$
|
|
52626
|
+
cssImportData.filePath = normalizePath$1(join(dir, cssImportData.url));
|
|
52790
52627
|
}
|
|
52791
52628
|
if (importeeExt !== 'css' && !cssImportData.filePath.toLowerCase().endsWith('.css')) {
|
|
52792
52629
|
cssImportData.filePath += `.${importeeExt}`;
|
|
52793
52630
|
if (importeeExt === 'scss') {
|
|
52794
52631
|
const fileName = '_' + basename(cssImportData.filePath);
|
|
52795
52632
|
const dirPath = dirname(cssImportData.filePath);
|
|
52796
|
-
cssImportData.altFilePath = normalizePath$
|
|
52633
|
+
cssImportData.altFilePath = normalizePath$1(join(dirPath, fileName));
|
|
52797
52634
|
}
|
|
52798
52635
|
}
|
|
52799
52636
|
// we set `filePath` to `""` when the object is created above, so if it
|
|
@@ -53432,7 +53269,7 @@ const resolveRemoteModuleIdSync = (config, inMemoryFs, opts) => {
|
|
|
53432
53269
|
};
|
|
53433
53270
|
const resolveRemotePackageJsonSync = (config, inMemoryFs, moduleId) => {
|
|
53434
53271
|
if (inMemoryFs) {
|
|
53435
|
-
const filePath = normalizePath$
|
|
53272
|
+
const filePath = normalizePath$1(config.sys.getLocalModulePath({ rootDir: config.rootDir, moduleId, path: 'package.json' }));
|
|
53436
53273
|
let pkgJson = inMemoryFs.readFileSync(filePath);
|
|
53437
53274
|
if (!isString$1(pkgJson) && IS_WEB_WORKER_ENV) {
|
|
53438
53275
|
const url = config.sys.getRemoteModuleUrl({ moduleId, path: 'package.json' });
|
|
@@ -53702,7 +53539,7 @@ const getTypescriptPathFromUrl = (config, tsExecutingUrl, url) => {
|
|
|
53702
53539
|
moduleId: '@stencil/core',
|
|
53703
53540
|
path: tsFilePath,
|
|
53704
53541
|
});
|
|
53705
|
-
return normalizePath$
|
|
53542
|
+
return normalizePath$1(tsNodePath);
|
|
53706
53543
|
}
|
|
53707
53544
|
return url;
|
|
53708
53545
|
};
|
|
@@ -53769,7 +53606,7 @@ const tsResolveModuleNamePackageJsonPath = (config, compilerCtx, moduleName, con
|
|
|
53769
53606
|
const pkgJsonPath = join(resolvedFileName, 'package.json');
|
|
53770
53607
|
const exists = config.sys.accessSync(pkgJsonPath);
|
|
53771
53608
|
if (exists) {
|
|
53772
|
-
return normalizePath$
|
|
53609
|
+
return normalizePath$1(pkgJsonPath);
|
|
53773
53610
|
}
|
|
53774
53611
|
}
|
|
53775
53612
|
}
|
|
@@ -53783,7 +53620,7 @@ const patchedTsResolveModule = (config, inMemoryFs, moduleName, containingFile)
|
|
|
53783
53620
|
if (isLocalModule(moduleName)) {
|
|
53784
53621
|
const containingDir = dirname(containingFile);
|
|
53785
53622
|
let resolvedFileName = join(containingDir, moduleName);
|
|
53786
|
-
resolvedFileName = normalizePath$
|
|
53623
|
+
resolvedFileName = normalizePath$1(ensureExtension(resolvedFileName, containingFile));
|
|
53787
53624
|
if (isAbsolute$1(resolvedFileName) && !inMemoryFs.accessSync(resolvedFileName)) {
|
|
53788
53625
|
return null;
|
|
53789
53626
|
}
|
|
@@ -53812,7 +53649,7 @@ const tsResolveNodeModule = (config, inMemoryFs, moduleId, containingFile) => {
|
|
|
53812
53649
|
const rtn = {
|
|
53813
53650
|
resolvedModule: {
|
|
53814
53651
|
extension: t.Extension.Dts,
|
|
53815
|
-
resolvedFileName: normalizePath$
|
|
53652
|
+
resolvedFileName: normalizePath$1(config.sys.getLocalModulePath({
|
|
53816
53653
|
rootDir: config.rootDir,
|
|
53817
53654
|
moduleId: '@stencil/core',
|
|
53818
53655
|
path: 'internal/index.d.ts',
|
|
@@ -53889,10 +53726,10 @@ const getTsResolveExtension = (p) => {
|
|
|
53889
53726
|
};
|
|
53890
53727
|
const shouldPatchRemoteTypeScript = (compilerExe) => !IS_NODE_ENV && isRemoteUrl(compilerExe);
|
|
53891
53728
|
|
|
53892
|
-
const getModule = (compilerCtx, filePath) => compilerCtx.moduleMap.get(normalizePath$
|
|
53729
|
+
const getModule = (compilerCtx, filePath) => compilerCtx.moduleMap.get(normalizePath$1(filePath));
|
|
53893
53730
|
const createModule = (staticSourceFile, // this is NOT the original
|
|
53894
53731
|
staticSourceFileText, emitFilepath) => ({
|
|
53895
|
-
sourceFilePath: normalizePath$
|
|
53732
|
+
sourceFilePath: normalizePath$1(staticSourceFile.fileName),
|
|
53896
53733
|
jsFilePath: emitFilepath,
|
|
53897
53734
|
staticSourceFile,
|
|
53898
53735
|
staticSourceFileText,
|
|
@@ -55017,7 +54854,7 @@ const parseDocsType = (checker, type, parts) => {
|
|
|
55017
54854
|
}
|
|
55018
54855
|
};
|
|
55019
54856
|
const getModuleFromSourceFile = (compilerCtx, tsSourceFile) => {
|
|
55020
|
-
const sourceFilePath = normalizePath$
|
|
54857
|
+
const sourceFilePath = normalizePath$1(tsSourceFile.fileName);
|
|
55021
54858
|
const moduleFile = compilerCtx.moduleMap.get(sourceFilePath);
|
|
55022
54859
|
if (moduleFile != null) {
|
|
55023
54860
|
return moduleFile;
|
|
@@ -58605,9 +58442,9 @@ const generateDocData = async (config, compilerCtx, buildCtx) => {
|
|
|
58605
58442
|
const getDocsComponents = async (config, compilerCtx, buildCtx) => {
|
|
58606
58443
|
const results = await Promise.all(buildCtx.moduleFiles.map(async (moduleFile) => {
|
|
58607
58444
|
const filePath = moduleFile.sourceFilePath;
|
|
58608
|
-
const dirPath = normalizePath$
|
|
58609
|
-
const readmePath = normalizePath$
|
|
58610
|
-
const usagesDir = normalizePath$
|
|
58445
|
+
const dirPath = normalizePath$1(dirname(filePath));
|
|
58446
|
+
const readmePath = normalizePath$1(join(dirPath, 'readme.md'));
|
|
58447
|
+
const usagesDir = normalizePath$1(join(dirPath, 'usage'));
|
|
58611
58448
|
const readme = await getUserReadmeContent(compilerCtx, readmePath);
|
|
58612
58449
|
const usage = await generateUsages(compilerCtx, usagesDir);
|
|
58613
58450
|
return moduleFile.cmps
|
|
@@ -59163,7 +59000,7 @@ const depsToMarkdown = (cmp, cmps) => {
|
|
|
59163
59000
|
const getCmpLink = (from, to, cmps) => {
|
|
59164
59001
|
const destCmp = cmps.find((c) => c.tag === to);
|
|
59165
59002
|
if (destCmp) {
|
|
59166
|
-
const cmpRelPath = normalizePath$
|
|
59003
|
+
const cmpRelPath = normalizePath$1(relative$1(from.dirPath, destCmp.dirPath));
|
|
59167
59004
|
return `[${to}](${cmpRelPath})`;
|
|
59168
59005
|
}
|
|
59169
59006
|
return to;
|
|
@@ -59614,18 +59451,18 @@ const generateLoader = async (config, compilerCtx, outputTarget) => {
|
|
|
59614
59451
|
const es2017EntryPoint = join(es2017Dir, 'loader.js');
|
|
59615
59452
|
const polyfillsEntryPoint = join(es2017Dir, 'polyfills/index.js');
|
|
59616
59453
|
const cjsEntryPoint = join(cjsDir, 'loader.cjs.js');
|
|
59617
|
-
const polyfillsExport = `export * from '${normalizePath$
|
|
59454
|
+
const polyfillsExport = `export * from '${normalizePath$1(relative$1(loaderPath, polyfillsEntryPoint))}';`;
|
|
59618
59455
|
const indexContent = `${generatePreamble(config)}
|
|
59619
59456
|
${es5HtmlElement}
|
|
59620
59457
|
${polyfillsExport}
|
|
59621
|
-
export * from '${normalizePath$
|
|
59458
|
+
export * from '${normalizePath$1(relative$1(loaderPath, es5EntryPoint))}';
|
|
59622
59459
|
`;
|
|
59623
59460
|
const indexES2017Content = `${generatePreamble(config)}
|
|
59624
59461
|
${polyfillsExport}
|
|
59625
|
-
export * from '${normalizePath$
|
|
59462
|
+
export * from '${normalizePath$1(relative$1(loaderPath, es2017EntryPoint))}';
|
|
59626
59463
|
`;
|
|
59627
59464
|
const indexCjsContent = `${generatePreamble(config)}
|
|
59628
|
-
module.exports = require('${normalizePath$
|
|
59465
|
+
module.exports = require('${normalizePath$1(relative$1(loaderPath, cjsEntryPoint))}');
|
|
59629
59466
|
module.exports.applyPolyfills = function() { return Promise.resolve() };
|
|
59630
59467
|
`;
|
|
59631
59468
|
const indexDtsPath = join(loaderPath, 'index.d.ts');
|
|
@@ -59722,7 +59559,7 @@ const generateCustomElementsTypesOutput$1 = async (config, compilerCtx, buildCtx
|
|
|
59722
59559
|
const usersIndexJsPath = join(config.srcDir, 'index.ts');
|
|
59723
59560
|
const hasUserIndex = await compilerCtx.fs.access(usersIndexJsPath);
|
|
59724
59561
|
if (hasUserIndex) {
|
|
59725
|
-
const userIndexRelPath = normalizePath$
|
|
59562
|
+
const userIndexRelPath = normalizePath$1(dirname(componentsDtsRelPath));
|
|
59726
59563
|
code.push(`export * from '${userIndexRelPath}';`);
|
|
59727
59564
|
}
|
|
59728
59565
|
else {
|
|
@@ -59775,7 +59612,7 @@ const relDts$1 = (fromPath, dtsPath) => {
|
|
|
59775
59612
|
if (!dtsPath.startsWith('.')) {
|
|
59776
59613
|
dtsPath = '.' + dtsPath;
|
|
59777
59614
|
}
|
|
59778
|
-
return normalizePath$
|
|
59615
|
+
return normalizePath$1(dtsPath.replace('.d.ts', ''));
|
|
59779
59616
|
};
|
|
59780
59617
|
|
|
59781
59618
|
const generateCustomElementsBundleTypes = async (config, compilerCtx, buildCtx, distDtsFilePath) => {
|
|
@@ -59830,7 +59667,7 @@ const generateCustomElementsTypesOutput = async (config, compilerCtx, buildCtx,
|
|
|
59830
59667
|
const usersIndexJsPath = join(config.srcDir, 'index.ts');
|
|
59831
59668
|
const hasUserIndex = await compilerCtx.fs.access(usersIndexJsPath);
|
|
59832
59669
|
if (hasUserIndex) {
|
|
59833
|
-
const userIndexRelPath = normalizePath$
|
|
59670
|
+
const userIndexRelPath = normalizePath$1(dirname(componentsDtsRelPath));
|
|
59834
59671
|
code.push(`export * from '${userIndexRelPath}';`);
|
|
59835
59672
|
}
|
|
59836
59673
|
else {
|
|
@@ -59857,7 +59694,7 @@ const relDts = (fromPath, dtsPath) => {
|
|
|
59857
59694
|
if (!dtsPath.startsWith('.')) {
|
|
59858
59695
|
dtsPath = '.' + dtsPath;
|
|
59859
59696
|
}
|
|
59860
|
-
return normalizePath$
|
|
59697
|
+
return normalizePath$1(dtsPath.replace('.d.ts', ''));
|
|
59861
59698
|
};
|
|
59862
59699
|
|
|
59863
59700
|
/**
|
|
@@ -59877,7 +59714,7 @@ const updateStencilTypesImports = (typesDir, dtsFilePath, dtsContent) => {
|
|
|
59877
59714
|
if (!coreDtsPath.startsWith('.')) {
|
|
59878
59715
|
coreDtsPath = `./${coreDtsPath}`;
|
|
59879
59716
|
}
|
|
59880
|
-
coreDtsPath = normalizePath$
|
|
59717
|
+
coreDtsPath = normalizePath$1(coreDtsPath);
|
|
59881
59718
|
if (dtsContent.includes('@stencil/core')) {
|
|
59882
59719
|
dtsContent = dtsContent.replace(/(from\s*(:?'|"))@stencil\/core\/internal('|")/g, `$1${coreDtsPath}$2`);
|
|
59883
59720
|
dtsContent = dtsContent.replace(/(from\s*(:?'|"))@stencil\/core('|")/g, `$1${coreDtsPath}$2`);
|
|
@@ -60321,7 +60158,7 @@ const generateComponentTypesFile = (config, buildCtx, areTypesInternal) => {
|
|
|
60321
60158
|
const typeData = typeImportData[filePath];
|
|
60322
60159
|
let importFilePath;
|
|
60323
60160
|
if (isAbsolute$1(filePath)) {
|
|
60324
|
-
importFilePath = normalizePath$
|
|
60161
|
+
importFilePath = normalizePath$1('./' + relative$1(config.srcDir, filePath)).replace(/\.(tsx|ts)$/, '');
|
|
60325
60162
|
}
|
|
60326
60163
|
else {
|
|
60327
60164
|
importFilePath = filePath;
|
|
@@ -60698,7 +60535,7 @@ self.addEventListener('activate', function(e) {
|
|
|
60698
60535
|
`;
|
|
60699
60536
|
|
|
60700
60537
|
const generateServiceWorkerUrl = (outputTarget, serviceWorker) => {
|
|
60701
|
-
let swUrl = normalizePath$
|
|
60538
|
+
let swUrl = normalizePath$1(relative$1(outputTarget.appDir, serviceWorker.swDest));
|
|
60702
60539
|
if (swUrl.charAt(0) !== '/') {
|
|
60703
60540
|
swUrl = '/' + swUrl;
|
|
60704
60541
|
}
|
|
@@ -61028,7 +60865,7 @@ const optimizeCss = async (config, compilerCtx, diagnostics, styleText, filePath
|
|
|
61028
60865
|
return styleText;
|
|
61029
60866
|
}
|
|
61030
60867
|
if (typeof filePath === 'string') {
|
|
61031
|
-
filePath = normalizePath$
|
|
60868
|
+
filePath = normalizePath$1(filePath);
|
|
61032
60869
|
}
|
|
61033
60870
|
const opts = {
|
|
61034
60871
|
input: styleText,
|
|
@@ -61076,7 +60913,7 @@ const buildGlobalStyles = async (config, compilerCtx, buildCtx) => {
|
|
|
61076
60913
|
return compilerCtx.cachedGlobalStyle;
|
|
61077
60914
|
}
|
|
61078
60915
|
try {
|
|
61079
|
-
globalStylePath = normalizePath$
|
|
60916
|
+
globalStylePath = normalizePath$1(globalStylePath);
|
|
61080
60917
|
compilerCtx.addWatchFile(globalStylePath);
|
|
61081
60918
|
const transformResults = await runPluginTransforms(config, compilerCtx, buildCtx, globalStylePath);
|
|
61082
60919
|
if (transformResults) {
|
|
@@ -63323,16 +63160,16 @@ const normalizeExternalStyle = (componentFilePath, externalStyle) => {
|
|
|
63323
63160
|
if (isAbsolute$1(externalStyle.originalComponentPath)) {
|
|
63324
63161
|
// this path is absolute already!
|
|
63325
63162
|
// add to our list of style absolute paths
|
|
63326
|
-
externalStyle.absolutePath = normalizePath$
|
|
63163
|
+
externalStyle.absolutePath = normalizePath$1(externalStyle.originalComponentPath);
|
|
63327
63164
|
// if this is an absolute path already, let's convert it to be relative
|
|
63328
|
-
externalStyle.relativePath = normalizePath$
|
|
63165
|
+
externalStyle.relativePath = normalizePath$1(relative$1(componentDir, externalStyle.originalComponentPath));
|
|
63329
63166
|
}
|
|
63330
63167
|
else {
|
|
63331
63168
|
// this path is relative to the component
|
|
63332
63169
|
// add to our list of style relative paths
|
|
63333
|
-
externalStyle.relativePath = normalizePath$
|
|
63170
|
+
externalStyle.relativePath = normalizePath$1(externalStyle.originalComponentPath);
|
|
63334
63171
|
// create the absolute path to the style file
|
|
63335
|
-
externalStyle.absolutePath = normalizePath$
|
|
63172
|
+
externalStyle.absolutePath = normalizePath$1(join(componentDir, externalStyle.originalComponentPath));
|
|
63336
63173
|
}
|
|
63337
63174
|
};
|
|
63338
63175
|
|
|
@@ -63587,10 +63424,10 @@ const parseVirtualProp = (tag) => {
|
|
|
63587
63424
|
};
|
|
63588
63425
|
const parseAssetsDirs = (staticMembers, componentFilePath) => {
|
|
63589
63426
|
const dirs = getStaticValue(staticMembers, 'assetsDirs') || [];
|
|
63590
|
-
const componentDir = normalizePath$
|
|
63427
|
+
const componentDir = normalizePath$1(dirname(componentFilePath));
|
|
63591
63428
|
return dirs.map((dir) => {
|
|
63592
63429
|
// get the relative path from the component file to the assets directory
|
|
63593
|
-
dir = normalizePath$
|
|
63430
|
+
dir = normalizePath$1(dir.trim());
|
|
63594
63431
|
let absolutePath = dir;
|
|
63595
63432
|
let cmpRelativePath = dir;
|
|
63596
63433
|
if (isAbsolute$1(dir)) {
|
|
@@ -63649,7 +63486,7 @@ const parseGlobal = (config, compilerCtx, buildCtx, collectionDir, collectionMan
|
|
|
63649
63486
|
if (typeof collectionManifest.global !== 'string') {
|
|
63650
63487
|
return;
|
|
63651
63488
|
}
|
|
63652
|
-
const sourceFilePath = normalizePath$
|
|
63489
|
+
const sourceFilePath = normalizePath$1(join(collectionDir, collectionManifest.global));
|
|
63653
63490
|
const globalModule = transpileCollectionModule(config, compilerCtx, buildCtx, collection, sourceFilePath);
|
|
63654
63491
|
collection.global = globalModule;
|
|
63655
63492
|
};
|
|
@@ -63689,7 +63526,7 @@ const parseCollection = (config, compilerCtx, buildCtx, moduleId, pkgJsonFilePat
|
|
|
63689
63526
|
return null;
|
|
63690
63527
|
}
|
|
63691
63528
|
// get the directory where the collection collection file is sitting
|
|
63692
|
-
const collectionDir = normalizePath$
|
|
63529
|
+
const collectionDir = normalizePath$1(dirname(collectionFilePath));
|
|
63693
63530
|
// parse the json string into our collection data
|
|
63694
63531
|
collection = parseCollectionManifest(config, compilerCtx, buildCtx, collectionName, collectionDir, collectionJsonStr);
|
|
63695
63532
|
collection.moduleId = moduleId;
|
|
@@ -63780,12 +63617,12 @@ const parseModuleImport = (config, compilerCtx, buildCtx, moduleFile, dirPath, i
|
|
|
63780
63617
|
}
|
|
63781
63618
|
if (isAbsolute$1(importPath)) {
|
|
63782
63619
|
// absolute import
|
|
63783
|
-
importPath = normalizePath$
|
|
63620
|
+
importPath = normalizePath$1(importPath);
|
|
63784
63621
|
moduleFile.localImports.push(importPath);
|
|
63785
63622
|
}
|
|
63786
63623
|
else if (importPath.startsWith('.')) {
|
|
63787
63624
|
// relative import
|
|
63788
|
-
importPath = normalizePath$
|
|
63625
|
+
importPath = normalizePath$1(resolve$1(dirPath, importPath));
|
|
63789
63626
|
moduleFile.localImports.push(importPath);
|
|
63790
63627
|
}
|
|
63791
63628
|
else {
|
|
@@ -63796,14 +63633,14 @@ const parseModuleImport = (config, compilerCtx, buildCtx, moduleFile, dirPath, i
|
|
|
63796
63633
|
};
|
|
63797
63634
|
|
|
63798
63635
|
const updateModule = (config, compilerCtx, buildCtx, tsSourceFile, sourceFileText, emitFilePath, typeChecker, collection) => {
|
|
63799
|
-
const sourceFilePath = normalizePath$
|
|
63636
|
+
const sourceFilePath = normalizePath$1(tsSourceFile.fileName);
|
|
63800
63637
|
const prevModuleFile = getModule(compilerCtx, sourceFilePath);
|
|
63801
63638
|
if (prevModuleFile && prevModuleFile.staticSourceFileText === sourceFileText) {
|
|
63802
63639
|
return prevModuleFile;
|
|
63803
63640
|
}
|
|
63804
63641
|
const srcDirPath = dirname(sourceFilePath);
|
|
63805
63642
|
const emitFileName = basename(emitFilePath);
|
|
63806
|
-
emitFilePath = normalizePath$
|
|
63643
|
+
emitFilePath = normalizePath$1(join(srcDirPath, emitFileName));
|
|
63807
63644
|
const moduleFile = createModule(tsSourceFile, sourceFileText, emitFilePath);
|
|
63808
63645
|
if (emitFilePath.endsWith('.js.map')) {
|
|
63809
63646
|
moduleFile.sourceMapPath = emitFilePath;
|
|
@@ -63813,7 +63650,7 @@ const updateModule = (config, compilerCtx, buildCtx, tsSourceFile, sourceFileTex
|
|
|
63813
63650
|
moduleFile.sourceMapPath = prevModuleFile.sourceMapPath;
|
|
63814
63651
|
moduleFile.sourceMapFileText = prevModuleFile.sourceMapFileText;
|
|
63815
63652
|
}
|
|
63816
|
-
const moduleFileKey = normalizePath$
|
|
63653
|
+
const moduleFileKey = normalizePath$1(moduleFile.sourceFilePath);
|
|
63817
63654
|
compilerCtx.moduleMap.set(moduleFileKey, moduleFile);
|
|
63818
63655
|
compilerCtx.changedModules.add(moduleFile.sourceFilePath);
|
|
63819
63656
|
const visitNode = (node) => {
|
|
@@ -63883,7 +63720,7 @@ const runTsProgram = async (config, compilerCtx, buildCtx, tsBuilder) => {
|
|
|
63883
63720
|
updateModule(config, compilerCtx, buildCtx, tsSourceFiles[0], data, emitFilePath, tsTypeChecker, null);
|
|
63884
63721
|
}
|
|
63885
63722
|
else if (emitFilePath.endsWith('.d.ts')) {
|
|
63886
|
-
const srcDtsPath = normalizePath$
|
|
63723
|
+
const srcDtsPath = normalizePath$1(tsSourceFiles[0].fileName);
|
|
63887
63724
|
const relativeEmitFilepath = getRelativeDts(config, srcDtsPath, emitFilePath);
|
|
63888
63725
|
emittedDts.push(srcDtsPath);
|
|
63889
63726
|
typesOutputTarget.forEach((o) => {
|
|
@@ -63919,7 +63756,7 @@ const runTsProgram = async (config, compilerCtx, buildCtx, tsBuilder) => {
|
|
|
63919
63756
|
const srcRootDtsFiles = tsProgram
|
|
63920
63757
|
.getRootFileNames()
|
|
63921
63758
|
.filter((f) => f.endsWith('.d.ts') && !f.endsWith('components.d.ts'))
|
|
63922
|
-
.map(normalizePath$
|
|
63759
|
+
.map(normalizePath$1)
|
|
63923
63760
|
.filter((f) => !emittedDts.includes(f))
|
|
63924
63761
|
.map((srcRootDtsFilePath) => {
|
|
63925
63762
|
const relativeEmitFilepath = relative$1(config.srcDir, srcRootDtsFilePath);
|
|
@@ -63955,7 +63792,7 @@ const getRelativeDts = (config, srcPath, emitDtsPath) => {
|
|
|
63955
63792
|
const b = basename(emitDtsPath);
|
|
63956
63793
|
parts.push(b);
|
|
63957
63794
|
emitDtsPath = join(emitDtsPath, '..');
|
|
63958
|
-
srcPath = normalizePath$
|
|
63795
|
+
srcPath = normalizePath$1(join(srcPath, '..'));
|
|
63959
63796
|
}
|
|
63960
63797
|
return join(...parts.reverse());
|
|
63961
63798
|
};
|
|
@@ -64137,7 +63974,7 @@ const excludeHmrFiles = (config, excludeHmr, filesChanged) => {
|
|
|
64137
63974
|
shouldExclude = minimatch_1$1(fileChanged, excludeHmr);
|
|
64138
63975
|
}
|
|
64139
63976
|
else {
|
|
64140
|
-
shouldExclude = normalizePath$
|
|
63977
|
+
shouldExclude = normalizePath$1(excludeHmr) === normalizePath$1(fileChanged);
|
|
64141
63978
|
}
|
|
64142
63979
|
if (shouldExclude) {
|
|
64143
63980
|
config.logger.debug(`excludeHmr: ${fileChanged}`);
|
|
@@ -64634,9 +64471,9 @@ const validateDistCollectionPkgJson = async (config, compilerCtx, buildCtx, outp
|
|
|
64634
64471
|
*/
|
|
64635
64472
|
const validatePackageFiles = async (config, compilerCtx, buildCtx, outputTarget) => {
|
|
64636
64473
|
if (!config.devMode && Array.isArray(buildCtx.packageJson.files)) {
|
|
64637
|
-
const actualDistDir = normalizePath$
|
|
64474
|
+
const actualDistDir = normalizePath$1(relative$1(config.rootDir, outputTarget.dir));
|
|
64638
64475
|
const validPaths = [`${actualDistDir}`, `${actualDistDir}/`, `./${actualDistDir}`, `./${actualDistDir}/`];
|
|
64639
|
-
const containsDistDir = buildCtx.packageJson.files.some((userPath) => validPaths.some((validPath) => normalizePath$
|
|
64476
|
+
const containsDistDir = buildCtx.packageJson.files.some((userPath) => validPaths.some((validPath) => normalizePath$1(userPath) === validPath));
|
|
64640
64477
|
if (!containsDistDir) {
|
|
64641
64478
|
const msg = `package.json "files" array must contain the distribution directory "${actualDistDir}/" when generating a distribution.`;
|
|
64642
64479
|
packageJsonWarn(config, compilerCtx, buildCtx, msg, `"files"`);
|
|
@@ -64671,7 +64508,7 @@ const validateMain = (config, compilerCtx, buildCtx, outputTarget) => {
|
|
|
64671
64508
|
const msg = `package.json "main" property is required when generating a distribution. It's recommended to set the "main" property to: ${mainRel}`;
|
|
64672
64509
|
packageJsonWarn(config, compilerCtx, buildCtx, msg, `"main"`);
|
|
64673
64510
|
}
|
|
64674
|
-
else if (normalizePath$
|
|
64511
|
+
else if (normalizePath$1(buildCtx.packageJson.main) !== normalizePath$1(mainRel)) {
|
|
64675
64512
|
const msg = `package.json "main" property is set to "${buildCtx.packageJson.main}". It's recommended to set the "main" property to: ${mainRel}`;
|
|
64676
64513
|
packageJsonWarn(config, compilerCtx, buildCtx, msg, `"main"`);
|
|
64677
64514
|
}
|
|
@@ -64694,13 +64531,13 @@ const validateModule = async (config, compilerCtx, buildCtx) => {
|
|
|
64694
64531
|
if (!isString$1(currentModule)) {
|
|
64695
64532
|
let msg = 'package.json "module" property is required when generating a distribution.';
|
|
64696
64533
|
if (recommendedRelPath !== null) {
|
|
64697
|
-
msg += ` It's recommended to set the "module" property to: ${normalizePath$
|
|
64534
|
+
msg += ` It's recommended to set the "module" property to: ${normalizePath$1(recommendedRelPath)}`;
|
|
64698
64535
|
}
|
|
64699
64536
|
packageJsonWarn(config, compilerCtx, buildCtx, msg, `"module"`);
|
|
64700
64537
|
return;
|
|
64701
64538
|
}
|
|
64702
|
-
if (recommendedRelPath !== null && normalizePath$
|
|
64703
|
-
const msg = `package.json "module" property is set to "${currentModule}". It's recommended to set the "module" property to: ${normalizePath$
|
|
64539
|
+
if (recommendedRelPath !== null && normalizePath$1(recommendedRelPath) !== normalizePath$1(currentModule)) {
|
|
64540
|
+
const msg = `package.json "module" property is set to "${currentModule}". It's recommended to set the "module" property to: ${normalizePath$1(recommendedRelPath)}`;
|
|
64704
64541
|
packageJsonWarn(config, compilerCtx, buildCtx, msg, `"module"`);
|
|
64705
64542
|
}
|
|
64706
64543
|
};
|
|
@@ -64757,7 +64594,7 @@ const validateTypes = async (config, compilerCtx, buildCtx, outputTarget) => {
|
|
|
64757
64594
|
const typesFileExists = await compilerCtx.fs.access(typesFile);
|
|
64758
64595
|
if (!typesFileExists) {
|
|
64759
64596
|
let msg = `package.json "types" property is set to "${buildCtx.packageJson.types}" but cannot be found.`;
|
|
64760
|
-
if (normalizePath$
|
|
64597
|
+
if (normalizePath$1(buildCtx.packageJson.types) !== normalizePath$1(recommendedPath)) {
|
|
64761
64598
|
msg += ` It's recommended to set the "types" property to: ${recommendedPath}`;
|
|
64762
64599
|
}
|
|
64763
64600
|
packageJsonError(config, compilerCtx, buildCtx, msg, `"types"`);
|
|
@@ -64776,7 +64613,7 @@ const validateTypes = async (config, compilerCtx, buildCtx, outputTarget) => {
|
|
|
64776
64613
|
const validateCollection$1 = (config, compilerCtx, buildCtx, outputTarget) => {
|
|
64777
64614
|
if (outputTarget.collectionDir) {
|
|
64778
64615
|
const collectionRel = join(relative$1(config.rootDir, outputTarget.collectionDir), COLLECTION_MANIFEST_FILE_NAME);
|
|
64779
|
-
if (!buildCtx.packageJson.collection || normalizePath$
|
|
64616
|
+
if (!buildCtx.packageJson.collection || normalizePath$1(buildCtx.packageJson.collection) !== collectionRel) {
|
|
64780
64617
|
const msg = `package.json "collection" property is required when generating a distribution and must be set to: ${collectionRel}`;
|
|
64781
64618
|
packageJsonWarn(config, compilerCtx, buildCtx, msg, `"collection"`);
|
|
64782
64619
|
}
|
|
@@ -65736,7 +65573,7 @@ const createInMemoryFs = (sys) => {
|
|
|
65736
65573
|
const emptyDirs = async (dirs) => {
|
|
65737
65574
|
dirs = dirs
|
|
65738
65575
|
.filter(isString$1)
|
|
65739
|
-
.map(normalizePath$
|
|
65576
|
+
.map(normalizePath$1)
|
|
65740
65577
|
.reduce((dirs, dir) => {
|
|
65741
65578
|
if (!dirs.includes(dir)) {
|
|
65742
65579
|
dirs.push(dir);
|
|
@@ -65778,7 +65615,7 @@ const createInMemoryFs = (sys) => {
|
|
|
65778
65615
|
* @returns a Promise wrapping a list of directory contents
|
|
65779
65616
|
*/
|
|
65780
65617
|
const readdir = async (dirPath, opts = {}) => {
|
|
65781
|
-
dirPath = normalizePath$
|
|
65618
|
+
dirPath = normalizePath$1(dirPath);
|
|
65782
65619
|
const collectedPaths = [];
|
|
65783
65620
|
if (opts.inMemoryOnly === true) {
|
|
65784
65621
|
let inMemoryDir = dirPath;
|
|
@@ -65842,8 +65679,8 @@ const createInMemoryFs = (sys) => {
|
|
|
65842
65679
|
await Promise.all(dirItems.map(async (dirItem) => {
|
|
65843
65680
|
// let's loop through each of the files we've found so far
|
|
65844
65681
|
// create an absolute path of the item inside of this directory
|
|
65845
|
-
const absPath = normalizePath$
|
|
65846
|
-
const relPath = normalizePath$
|
|
65682
|
+
const absPath = normalizePath$1(dirItem);
|
|
65683
|
+
const relPath = normalizePath$1(relative$1(initPath, absPath));
|
|
65847
65684
|
// get the fs stats for the item, could be either a file or directory
|
|
65848
65685
|
const stats = await stat(absPath);
|
|
65849
65686
|
const childItem = {
|
|
@@ -66414,7 +66251,7 @@ const createInMemoryFs = (sys) => {
|
|
|
66414
66251
|
* @param dirPath the path for the item to remove
|
|
66415
66252
|
*/
|
|
66416
66253
|
const clearDirCache = (dirPath) => {
|
|
66417
|
-
dirPath = normalizePath$
|
|
66254
|
+
dirPath = normalizePath$1(dirPath);
|
|
66418
66255
|
items.forEach((_, f) => {
|
|
66419
66256
|
const filePath = relative$1(dirPath, f).split('/')[0];
|
|
66420
66257
|
if (!filePath.startsWith('.') && !filePath.startsWith('/')) {
|
|
@@ -66429,7 +66266,7 @@ const createInMemoryFs = (sys) => {
|
|
|
66429
66266
|
* @param filePath the path for the item to remove
|
|
66430
66267
|
*/
|
|
66431
66268
|
const clearFileCache = (filePath) => {
|
|
66432
|
-
filePath = normalizePath$
|
|
66269
|
+
filePath = normalizePath$1(filePath);
|
|
66433
66270
|
const item = items.get(filePath);
|
|
66434
66271
|
if (item != null && !item.queueWriteToDisk) {
|
|
66435
66272
|
items.delete(filePath);
|
|
@@ -66479,7 +66316,7 @@ const createInMemoryFs = (sys) => {
|
|
|
66479
66316
|
* @returns an object with information about the item in question
|
|
66480
66317
|
*/
|
|
66481
66318
|
const getItem = (itemPath) => {
|
|
66482
|
-
itemPath = normalizePath$
|
|
66319
|
+
itemPath = normalizePath$1(itemPath);
|
|
66483
66320
|
let item = items.get(itemPath);
|
|
66484
66321
|
if (item != null) {
|
|
66485
66322
|
return item;
|
|
@@ -66589,7 +66426,7 @@ const getCommitInstructions = (items) => {
|
|
|
66589
66426
|
if (item.queueWriteToDisk === true) {
|
|
66590
66427
|
if (item.isFile === true) {
|
|
66591
66428
|
instructions.filesToWrite.push(itemPath);
|
|
66592
|
-
const dir = normalizePath$
|
|
66429
|
+
const dir = normalizePath$1(dirname(itemPath));
|
|
66593
66430
|
if (!instructions.dirsToEnsure.includes(dir)) {
|
|
66594
66431
|
instructions.dirsToEnsure.push(dir);
|
|
66595
66432
|
}
|
|
@@ -66624,7 +66461,7 @@ const getCommitInstructions = (items) => {
|
|
|
66624
66461
|
const src = itemPath;
|
|
66625
66462
|
const dest = item.queueCopyFileToDest;
|
|
66626
66463
|
instructions.filesToCopy.push([src, dest]);
|
|
66627
|
-
const dir = normalizePath$
|
|
66464
|
+
const dir = normalizePath$1(dirname(dest));
|
|
66628
66465
|
if (!instructions.dirsToEnsure.includes(dir)) {
|
|
66629
66466
|
instructions.dirsToEnsure.push(dir);
|
|
66630
66467
|
}
|
|
@@ -66905,7 +66742,7 @@ const getTsConfigPath = async (config, sys, init) => {
|
|
|
66905
66742
|
tsconfig.content = createDefaultTsConfig(config);
|
|
66906
66743
|
await sys.writeFile(tsconfig.path, tsconfig.content);
|
|
66907
66744
|
}
|
|
66908
|
-
tsconfig.path = normalizePath$
|
|
66745
|
+
tsconfig.path = normalizePath$1(tsconfig.path);
|
|
66909
66746
|
return tsconfig;
|
|
66910
66747
|
};
|
|
66911
66748
|
const createDefaultTsConfig = (config) => JSON.stringify({
|
|
@@ -67444,7 +67281,7 @@ const validatePrerender = (config, diagnostics, outputTarget) => {
|
|
|
67444
67281
|
if (!config.flags.ssr && !config.flags.prerender && config.flags.task !== 'prerender') {
|
|
67445
67282
|
return;
|
|
67446
67283
|
}
|
|
67447
|
-
outputTarget.baseUrl = normalizePath$
|
|
67284
|
+
outputTarget.baseUrl = normalizePath$1(outputTarget.baseUrl);
|
|
67448
67285
|
if (!outputTarget.baseUrl.startsWith('http://') && !outputTarget.baseUrl.startsWith('https://')) {
|
|
67449
67286
|
const err = buildError(diagnostics);
|
|
67450
67287
|
err.messageText = `When prerendering, the "baseUrl" output target config must be a full URL and start with either "http://" or "https://". The config can be updated in the "www" output target within the stencil config.`;
|
|
@@ -67718,7 +67555,7 @@ const validateDevServer = (config, diagnostics) => {
|
|
|
67718
67555
|
devServer.prerenderConfig = wwwOutput === null || wwwOutput === void 0 ? void 0 : wwwOutput.prerenderConfig;
|
|
67719
67556
|
}
|
|
67720
67557
|
if (isString$1(config.srcIndexHtml)) {
|
|
67721
|
-
devServer.srcIndexHtml = normalizePath$
|
|
67558
|
+
devServer.srcIndexHtml = normalizePath$1(config.srcIndexHtml);
|
|
67722
67559
|
}
|
|
67723
67560
|
if (devServer.protocol !== 'http' && devServer.protocol !== 'https') {
|
|
67724
67561
|
devServer.protocol = devServer.https ? 'https' : addressProtocol ? addressProtocol : 'http';
|
|
@@ -67753,7 +67590,7 @@ const validateDevServer = (config, diagnostics) => {
|
|
|
67753
67590
|
if (!isString$1(basePath) || basePath.trim() === '') {
|
|
67754
67591
|
basePath = `/`;
|
|
67755
67592
|
}
|
|
67756
|
-
basePath = normalizePath$
|
|
67593
|
+
basePath = normalizePath$1(basePath);
|
|
67757
67594
|
if (!basePath.startsWith('/')) {
|
|
67758
67595
|
basePath = '/' + basePath;
|
|
67759
67596
|
}
|
|
@@ -67776,7 +67613,7 @@ const validateDevServer = (config, diagnostics) => {
|
|
|
67776
67613
|
if (!isAbsolute$1(devServer.root)) {
|
|
67777
67614
|
devServer.root = join(config.rootDir, devServer.root);
|
|
67778
67615
|
}
|
|
67779
|
-
devServer.root = normalizePath$
|
|
67616
|
+
devServer.root = normalizePath$1(devServer.root);
|
|
67780
67617
|
if (devServer.excludeHmr) {
|
|
67781
67618
|
if (!Array.isArray(devServer.excludeHmr)) {
|
|
67782
67619
|
const err = buildError(diagnostics);
|
|
@@ -68350,13 +68187,13 @@ const loadConfig = async (init = {}) => {
|
|
|
68350
68187
|
configPath = loadedConfigFile.configPath;
|
|
68351
68188
|
unknownConfig.config = { ...loadedConfigFile, ...config };
|
|
68352
68189
|
unknownConfig.config.configPath = configPath;
|
|
68353
|
-
unknownConfig.config.rootDir = normalizePath$
|
|
68190
|
+
unknownConfig.config.rootDir = normalizePath$1(dirname(configPath));
|
|
68354
68191
|
}
|
|
68355
68192
|
else {
|
|
68356
68193
|
// no stencil.config.ts or .js file, which is fine
|
|
68357
68194
|
unknownConfig.config = { ...config };
|
|
68358
68195
|
unknownConfig.config.configPath = null;
|
|
68359
|
-
unknownConfig.config.rootDir = normalizePath$
|
|
68196
|
+
unknownConfig.config.rootDir = normalizePath$1(sys.getCurrentDirectory());
|
|
68360
68197
|
}
|
|
68361
68198
|
unknownConfig.config.sys = sys;
|
|
68362
68199
|
const validated = validateConfig(unknownConfig.config, init);
|
|
@@ -68417,7 +68254,7 @@ const loadConfigFile = async (sys, diagnostics, configPath) => {
|
|
|
68417
68254
|
return config;
|
|
68418
68255
|
}
|
|
68419
68256
|
config = configFileData.config;
|
|
68420
|
-
config.configPath = normalizePath$
|
|
68257
|
+
config.configPath = normalizePath$1(configPath);
|
|
68421
68258
|
}
|
|
68422
68259
|
return config;
|
|
68423
68260
|
};
|
|
@@ -69126,7 +68963,7 @@ const getComponentPathContent = (componentGraph, outputTarget) => {
|
|
|
69126
68963
|
const dependencies = [
|
|
69127
68964
|
{
|
|
69128
68965
|
name: "@stencil/core",
|
|
69129
|
-
version: "2.19.
|
|
68966
|
+
version: "2.19.3",
|
|
69130
68967
|
main: "compiler/stencil.js",
|
|
69131
68968
|
resources: [
|
|
69132
68969
|
"package.json",
|
|
@@ -69442,7 +69279,7 @@ const transpileModule = (config, input, transformOpts) => {
|
|
|
69442
69279
|
};
|
|
69443
69280
|
let sourceFilePath = transformOpts.file;
|
|
69444
69281
|
if (isString$1(sourceFilePath)) {
|
|
69445
|
-
sourceFilePath = normalizePath$
|
|
69282
|
+
sourceFilePath = normalizePath$1(sourceFilePath);
|
|
69446
69283
|
}
|
|
69447
69284
|
else {
|
|
69448
69285
|
sourceFilePath = tsCompilerOptions.jsx ? `module.tsx` : `module.ts`;
|
|
@@ -69478,7 +69315,7 @@ const transpileModule = (config, input, transformOpts) => {
|
|
|
69478
69315
|
// Create a compilerHost object to allow the compiler to read and write files
|
|
69479
69316
|
const compilerHost = {
|
|
69480
69317
|
getSourceFile: (fileName) => {
|
|
69481
|
-
return normalizePath$
|
|
69318
|
+
return normalizePath$1(fileName) === normalizePath$1(sourceFilePath) ? sourceFile : undefined;
|
|
69482
69319
|
},
|
|
69483
69320
|
writeFile: (name, text) => {
|
|
69484
69321
|
if (name.endsWith('.js.map')) {
|
|
@@ -69493,7 +69330,7 @@ const transpileModule = (config, input, transformOpts) => {
|
|
|
69493
69330
|
getCanonicalFileName: (fileName) => fileName,
|
|
69494
69331
|
getCurrentDirectory: () => transformOpts.currentDirectory || getCurrentDirectory(),
|
|
69495
69332
|
getNewLine: () => t.sys.newLine || '\n',
|
|
69496
|
-
fileExists: (fileName) => normalizePath$
|
|
69333
|
+
fileExists: (fileName) => normalizePath$1(fileName) === normalizePath$1(sourceFilePath),
|
|
69497
69334
|
readFile: () => '',
|
|
69498
69335
|
directoryExists: () => true,
|
|
69499
69336
|
getDirectories: () => [],
|