@stencil/core 5.0.0-alpha.3 → 5.0.0-alpha.31
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/README.md +94 -0
- package/dist/app-data/index.d.ts +2 -0
- package/dist/{runtime/app-data → app-data}/index.js +17 -11
- package/dist/{client-CSm3x5ke.mjs → client-D1MsT-Rp.mjs} +2717 -2424
- package/dist/compiler/index.d.mts +170 -6
- package/dist/compiler/index.mjs +4 -3
- package/dist/compiler/utils/index.d.mts +272 -2
- package/dist/compiler/utils/index.mjs +4 -3
- package/dist/{compiler-D6iP7Bzb.mjs → compiler-Cddp97Pg.mjs} +14953 -12327
- package/dist/declarations/stencil-ext-modules.d.ts +5 -5
- package/dist/declarations/stencil-public-compiler.d.ts +728 -287
- package/dist/declarations/stencil-public-compiler.js +2 -3
- package/dist/declarations/stencil-public-docs.d.ts +19 -0
- package/dist/declarations/stencil-public-runtime.d.ts +131 -17
- package/dist/fragment-Di1hWOC8.mjs +4 -0
- package/dist/{index-tUR6pD3J.d.mts → index-BHj3EBl2.d.mts} +1052 -668
- package/dist/{index-CyrGY82h.d.ts → index-D2PAsXxx.d.ts} +215 -40
- package/dist/index-VK8okIiF.d.mts +108 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +91 -2
- package/dist/jsx-runtime.d.mts +18 -0
- package/dist/jsx-runtime.mjs +3 -0
- package/dist/{node-Bg-mO5dw.mjs → node-BQR4L-TG.mjs} +76 -73
- package/dist/reactive-controller-BdCpSAQP.d.mts +13 -0
- package/dist/{regular-expression-D5pGVpCu.mjs → regular-expression-XqU5zmPp.mjs} +141 -31
- package/dist/{chunk-CjcI7cDX.mjs → rolldown-runtime-BhDjJH2R.mjs} +1 -1
- package/dist/{runtime-BBCnuprF.js → runtime/client/lazy.js} +2987 -2443
- package/dist/runtime/client/{index.d.ts → runtime.d.ts} +228 -83
- package/dist/runtime/client/{index.js → runtime.js} +2852 -2432
- package/dist/runtime/index.d.ts +48 -29
- package/dist/runtime/index.js +5069 -2
- package/dist/runtime/server/index.d.mts +182 -75
- package/dist/runtime/server/index.mjs +2769 -2283
- package/dist/runtime/server/runner.d.mts +47 -32
- package/dist/runtime/server/runner.mjs +563 -687
- package/dist/signals/index.d.ts +49 -0
- package/dist/signals/index.js +199 -0
- package/dist/sys/node/index.d.mts +1 -2
- package/dist/sys/node/index.mjs +1 -1
- package/dist/sys/node/worker.d.mts +1 -1
- package/dist/sys/node/worker.mjs +6 -3
- package/dist/testing/index.d.mts +98 -9
- package/dist/testing/index.mjs +395 -70
- package/dist/util-BIa-iHnt.mjs +724 -0
- package/dist/validation-Dd3g77T5.mjs +778 -0
- package/package.json +49 -36
- package/dist/index-CXHCTQNt.d.mts +0 -190
- package/dist/index-hS-KBdAP.d.ts +0 -30
- package/dist/jsx-runtime-DlDkTqps.d.ts +0 -28
- package/dist/jsx-runtime.d.ts +0 -2
- package/dist/jsx-runtime.js +0 -2
- package/dist/runtime/app-data/index.d.ts +0 -2
- package/dist/validation-Byxie0Uk.mjs +0 -1445
- /package/{LICENSE.md → LICENSE} +0 -0
- /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
- /package/dist/{runtime/app-globals → app-globals}/index.js +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,91 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { C as setAssetPath, E as setPlatformHelpers, I as Build, N as setErrorHandler, S as getAssetPath, T as writeTask, a as transformTag, b as getElement, c as Mixin, d as setMode, g as getRenderingRef, h as forceUpdate, i as setTagTransformer, m as h, o as render, p as Host, s as ReactiveControllerHost, u as getMode, w as readTask, x as getShadowRoot } from "./client-D1MsT-Rp.mjs";
|
|
2
|
+
import { t as Fragment } from "./fragment-Di1hWOC8.mjs";
|
|
3
|
+
//#region src/client/client-decorators.ts
|
|
4
|
+
/**
|
|
5
|
+
* Runtime stubs for Stencil decorators.
|
|
6
|
+
*
|
|
7
|
+
* These decorators are compile-time metadata flags that Stencil's compiler parses
|
|
8
|
+
* and transforms. At runtime, they do nothing - the actual component behavior is
|
|
9
|
+
* wired up by the compiled output, not by these decorators.
|
|
10
|
+
*
|
|
11
|
+
* These stubs exist so that:
|
|
12
|
+
* 1. Component classes can be instantiated directly in tests without going through
|
|
13
|
+
* Stencil's full compilation pipeline
|
|
14
|
+
* 2. The decorators don't throw "X is not a function" errors when used outside
|
|
15
|
+
* of Stencil's build process
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* No-op class decorator stub for @Component()
|
|
19
|
+
* @param _opts - component options (ignored at runtime)
|
|
20
|
+
* @returns a class decorator that returns the target unchanged
|
|
21
|
+
*/
|
|
22
|
+
const Component = (_opts) => (target) => target;
|
|
23
|
+
/**
|
|
24
|
+
* No-op property decorator stub for @Element()
|
|
25
|
+
* @returns a property decorator that does nothing
|
|
26
|
+
*/
|
|
27
|
+
const Element = () => () => {};
|
|
28
|
+
/**
|
|
29
|
+
* No-op property decorator stub for @Event()
|
|
30
|
+
* @param _opts - event options (ignored at runtime)
|
|
31
|
+
* @returns a property decorator that does nothing
|
|
32
|
+
*/
|
|
33
|
+
const Event = (_opts) => () => {};
|
|
34
|
+
/**
|
|
35
|
+
* No-op property decorator stub for @AttachInternals()
|
|
36
|
+
* @param _opts - attach internals options (ignored at runtime)
|
|
37
|
+
* @returns a property decorator that does nothing
|
|
38
|
+
*/
|
|
39
|
+
const AttachInternals = (_opts) => () => {};
|
|
40
|
+
/**
|
|
41
|
+
* No-op method decorator stub for @Listen()
|
|
42
|
+
* @param _eventName - event name to listen for (ignored at runtime)
|
|
43
|
+
* @param _opts - listen options (ignored at runtime)
|
|
44
|
+
* @returns a method decorator that does nothing
|
|
45
|
+
*/
|
|
46
|
+
const Listen = (_eventName, _opts) => () => {};
|
|
47
|
+
/**
|
|
48
|
+
* No-op method decorator stub for @Method()
|
|
49
|
+
* @param _opts - method options (ignored at runtime)
|
|
50
|
+
* @returns a method decorator that does nothing
|
|
51
|
+
*/
|
|
52
|
+
const Method = (_opts) => () => {};
|
|
53
|
+
/**
|
|
54
|
+
* No-op property decorator stub for @Prop()
|
|
55
|
+
* @param _opts - prop options (ignored at runtime)
|
|
56
|
+
* @returns a property decorator that does nothing
|
|
57
|
+
*/
|
|
58
|
+
const Prop = (_opts) => () => {};
|
|
59
|
+
/**
|
|
60
|
+
* No-op property decorator stub for @State()
|
|
61
|
+
* @returns a property decorator that does nothing
|
|
62
|
+
*/
|
|
63
|
+
const State = () => () => {};
|
|
64
|
+
/**
|
|
65
|
+
* No-op method decorator stub for @Watch()
|
|
66
|
+
* @param _propName - property name to watch (ignored at runtime)
|
|
67
|
+
* @param _opts - watch options (ignored at runtime)
|
|
68
|
+
* @returns a method decorator that does nothing
|
|
69
|
+
*/
|
|
70
|
+
const Watch = (_propName, _opts) => () => {};
|
|
71
|
+
/**
|
|
72
|
+
* No-op method decorator stub for @PropSerialize()
|
|
73
|
+
* @param _propName - property name to serialize (ignored at runtime)
|
|
74
|
+
* @returns a method decorator that does nothing
|
|
75
|
+
*/
|
|
76
|
+
const PropSerialize = (_propName) => () => {};
|
|
77
|
+
/**
|
|
78
|
+
* No-op method decorator stub for @AttrDeserialize()
|
|
79
|
+
* @param _propName - property name to deserialize (ignored at runtime)
|
|
80
|
+
* @returns a method decorator that does nothing
|
|
81
|
+
*/
|
|
82
|
+
const AttrDeserialize = (_propName) => () => {};
|
|
83
|
+
/**
|
|
84
|
+
* No-op compile-time utility stub for resolveVar()
|
|
85
|
+
* At runtime, this just returns the string representation of whatever is passed in.
|
|
86
|
+
* @param variable - the variable to resolve
|
|
87
|
+
* @returns the string representation of the variable
|
|
88
|
+
*/
|
|
89
|
+
const resolveVar = (variable) => String(variable);
|
|
90
|
+
//#endregion
|
|
91
|
+
export { AttachInternals, AttrDeserialize, Build, Component, Element, Event, Fragment, Host, Listen, Method, Mixin, Prop, PropSerialize, ReactiveControllerHost, State, Watch, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, getShadowRoot, h, readTask, render, resolveVar, setAssetPath, setErrorHandler, setMode, setPlatformHelpers, setTagTransformer, transformTag, writeTask };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { VNode, JSXBase, JSX as LocalJSX } from './declarations/stencil-public-runtime';
|
|
2
|
+
|
|
3
|
+
export { Fragment } from './declarations/stencil-public-runtime';
|
|
4
|
+
export function jsx(type: any, props: any, key?: string): VNode;
|
|
5
|
+
export function jsxs(type: any, props: any, key?: string): VNode;
|
|
6
|
+
export function jsxDEV(type: any, props: any, key?: string): VNode;
|
|
7
|
+
|
|
8
|
+
export namespace JSX {
|
|
9
|
+
type BaseElements = LocalJSX.IntrinsicElements & JSXBase.IntrinsicElements;
|
|
10
|
+
|
|
11
|
+
export type IntrinsicElements = {
|
|
12
|
+
[K in keyof BaseElements]: BaseElements[K] & { children?: any };
|
|
13
|
+
} & {
|
|
14
|
+
[tagName: string]: any;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type Element = VNode;
|
|
18
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { n as __require } from "./
|
|
2
|
-
import "./client-
|
|
3
|
-
import { h as noop, i as flatOne, l as isFunction, p as isString } from "./regular-expression-
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import { n as __require } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
|
+
import "./client-D1MsT-Rp.mjs";
|
|
3
|
+
import { h as noop, i as flatOne, l as isFunction, p as isString } from "./regular-expression-XqU5zmPp.mjs";
|
|
4
|
+
import { $ as catchError, K as normalizePath, X as buildError, Y as TASK_CANCELED_MSG, nt as shouldIgnoreError, rt as isGlob } from "./util-BIa-iHnt.mjs";
|
|
5
|
+
import fs from "node:fs";
|
|
6
|
+
import nodePath from "node:path";
|
|
6
7
|
import { pathToFileURL } from "node:url";
|
|
7
|
-
import path
|
|
8
|
-
import
|
|
8
|
+
import path from "path";
|
|
9
|
+
import * as cp from "child_process";
|
|
9
10
|
import chalk from "chalk";
|
|
10
11
|
import { createHash } from "node:crypto";
|
|
11
12
|
import * as os from "node:os";
|
|
12
13
|
import { cpus, freemem, platform, release, tmpdir, totalmem } from "node:os";
|
|
13
14
|
import * as parcelWatcher from "@parcel/watcher";
|
|
14
|
-
import { glob } from "
|
|
15
|
-
import {
|
|
15
|
+
import { glob } from "tinyglobby";
|
|
16
|
+
import { copyFile, mkdir, readdir, stat } from "node:fs/promises";
|
|
16
17
|
import semverLte from "semver/functions/lte.js";
|
|
17
18
|
import major from "semver/functions/major.js";
|
|
18
19
|
import satisfies from "semver/functions/satisfies.js";
|
|
19
20
|
import { cpus as cpus$1, tmpdir as tmpdir$1 } from "os";
|
|
20
21
|
import semverLt from "semver/functions/lt.js";
|
|
21
22
|
import { EventEmitter } from "events";
|
|
22
|
-
import * as cp from "child_process";
|
|
23
23
|
//#region src/compiler/events.ts
|
|
24
24
|
const buildEvents = () => {
|
|
25
25
|
const evCallbacks = [];
|
|
@@ -106,7 +106,7 @@ const LOG_LEVELS = [
|
|
|
106
106
|
/**
|
|
107
107
|
* The collection of valid export behaviors.
|
|
108
108
|
* Used to generate a type for typed configs as well as output target validation
|
|
109
|
-
* for the `
|
|
109
|
+
* for the `standalone` output target.
|
|
110
110
|
*
|
|
111
111
|
* Adding a value to this const array will automatically add it as a valid option on the
|
|
112
112
|
* output target configuration for `customElementsExportBehavior`.
|
|
@@ -115,8 +115,7 @@ const LOG_LEVELS = [
|
|
|
115
115
|
* - `auto-define-custom-elements`: Enables the auto-definition of a component and its children (recursively) in the custom elements registry. This
|
|
116
116
|
* functionality allows consumers to bypass the explicit call to define a component, its children, its children's
|
|
117
117
|
* children, etc. Users of this flag should be aware that enabling this functionality may increase bundle size.
|
|
118
|
-
* - `bundle`: A `defineCustomElements` function will be exported from the distribution directory.
|
|
119
|
-
* from `dist-custom-elements-bundle` to `dist-custom-elements`.
|
|
118
|
+
* - `bundle`: A `defineCustomElements` function will be exported from the distribution directory.
|
|
120
119
|
* - `single-export-module`: All components will be re-exported from the specified directory's root `index.js` file.
|
|
121
120
|
*/
|
|
122
121
|
const CustomElementsExportBehaviorOptions = [
|
|
@@ -651,7 +650,8 @@ const INDENT$1 = " ";
|
|
|
651
650
|
* @returns the created logger
|
|
652
651
|
*/
|
|
653
652
|
const createNodeLogger = () => {
|
|
654
|
-
|
|
653
|
+
const loggerSys = createNodeLoggerSys();
|
|
654
|
+
return createTerminalLogger(loggerSys);
|
|
655
655
|
};
|
|
656
656
|
/**
|
|
657
657
|
* Create a logger sys object for use in a Node.js environment
|
|
@@ -676,7 +676,7 @@ function createNodeLoggerSys() {
|
|
|
676
676
|
return Math.max(Math.min(terminalWidth, max_columns), min_columns);
|
|
677
677
|
};
|
|
678
678
|
const memoryUsage = () => process.memoryUsage().rss;
|
|
679
|
-
const relativePath = (from, to) => path
|
|
679
|
+
const relativePath = (from, to) => path.relative(from, to);
|
|
680
680
|
const writeLogs = (logFilePath, log, append) => {
|
|
681
681
|
if (append) try {
|
|
682
682
|
fs.accessSync(logFilePath);
|
|
@@ -734,12 +734,6 @@ function setupNodeProcess(c) {
|
|
|
734
734
|
});
|
|
735
735
|
}
|
|
736
736
|
//#endregion
|
|
737
|
-
//#region src/sys/node/node-fs-promisify.ts
|
|
738
|
-
const copyFile = promisify(fs.copyFile);
|
|
739
|
-
const mkdir = promisify(fs.mkdir);
|
|
740
|
-
const readdir = promisify(fs.readdir);
|
|
741
|
-
const stat = promisify(fs.stat);
|
|
742
|
-
//#endregion
|
|
743
737
|
//#region src/sys/node/node-copy-tasks.ts
|
|
744
738
|
/**
|
|
745
739
|
* Copy a file with retry logic for transient Windows errors (EBUSY, EPERM, EACCES).
|
|
@@ -794,15 +788,15 @@ async function nodeCopyTasks(copyTasks, srcDir) {
|
|
|
794
788
|
async function processGlobs(copyTask, srcDir) {
|
|
795
789
|
return isGlob(copyTask.src) ? await processGlobTask(copyTask, srcDir) : [{
|
|
796
790
|
src: getSrcAbsPath(srcDir, copyTask.src),
|
|
797
|
-
dest: copyTask.keepDirStructure ? path
|
|
791
|
+
dest: copyTask.keepDirStructure ? path.join(copyTask.dest, copyTask.src) : copyTask.dest,
|
|
798
792
|
warn: copyTask.warn,
|
|
799
793
|
ignore: copyTask.ignore,
|
|
800
794
|
keepDirStructure: copyTask.keepDirStructure
|
|
801
795
|
}];
|
|
802
796
|
}
|
|
803
797
|
function getSrcAbsPath(srcDir, src) {
|
|
804
|
-
if (path
|
|
805
|
-
return path
|
|
798
|
+
if (path.isAbsolute(src)) return src;
|
|
799
|
+
return path.join(srcDir, src);
|
|
806
800
|
}
|
|
807
801
|
async function processGlobTask(copyTask, srcDir) {
|
|
808
802
|
return (await asyncGlob(copyTask.src, {
|
|
@@ -812,9 +806,9 @@ async function processGlobTask(copyTask, srcDir) {
|
|
|
812
806
|
})).map((globRelPath) => createGlobCopyTask(copyTask, srcDir, globRelPath));
|
|
813
807
|
}
|
|
814
808
|
function createGlobCopyTask(copyTask, srcDir, globRelPath) {
|
|
815
|
-
const dest = path
|
|
809
|
+
const dest = path.join(copyTask.dest, copyTask.keepDirStructure ? globRelPath : path.basename(globRelPath));
|
|
816
810
|
return {
|
|
817
|
-
src: path
|
|
811
|
+
src: path.join(srcDir, globRelPath),
|
|
818
812
|
dest,
|
|
819
813
|
ignore: copyTask.ignore,
|
|
820
814
|
warn: copyTask.warn,
|
|
@@ -844,8 +838,8 @@ async function processCopyTaskDirectory(results, allCopyTasks, copyTask) {
|
|
|
844
838
|
const dirItems = await readdir(copyTask.src);
|
|
845
839
|
await Promise.all(dirItems.map(async (dirItem) => {
|
|
846
840
|
await processCopyTask(results, allCopyTasks, {
|
|
847
|
-
src: path
|
|
848
|
-
dest: path
|
|
841
|
+
src: path.join(copyTask.src, dirItem),
|
|
842
|
+
dest: path.join(copyTask.dest, dirItem),
|
|
849
843
|
warn: copyTask.warn
|
|
850
844
|
});
|
|
851
845
|
}));
|
|
@@ -856,7 +850,7 @@ async function processCopyTaskDirectory(results, allCopyTasks, copyTask) {
|
|
|
856
850
|
function ensureDirs(copyTasks) {
|
|
857
851
|
const mkDirs = [];
|
|
858
852
|
copyTasks.forEach((copyTask) => {
|
|
859
|
-
addMkDir(mkDirs, path
|
|
853
|
+
addMkDir(mkDirs, path.dirname(copyTask.dest));
|
|
860
854
|
});
|
|
861
855
|
mkDirs.sort((a, b) => {
|
|
862
856
|
const partsA = a.split("/").length;
|
|
@@ -874,13 +868,17 @@ function addMkDir(mkDirs, destDir) {
|
|
|
874
868
|
if (destDir === ROOT_DIR || destDir + "/" === ROOT_DIR || destDir === "") return;
|
|
875
869
|
if (!mkDirs.includes(destDir)) mkDirs.push(destDir);
|
|
876
870
|
}
|
|
877
|
-
const ROOT_DIR = normalizePath(path
|
|
871
|
+
const ROOT_DIR = normalizePath(path.resolve("/"));
|
|
878
872
|
function shouldIgnore({ src, ignore = [] }) {
|
|
879
873
|
const filePath = src.trim().toLowerCase();
|
|
880
874
|
return ignore.some((ignoreFile) => filePath.endsWith(ignoreFile));
|
|
881
875
|
}
|
|
882
|
-
function asyncGlob(pattern, opts) {
|
|
883
|
-
|
|
876
|
+
function asyncGlob(pattern, opts = {}) {
|
|
877
|
+
const { nodir, ...rest } = opts;
|
|
878
|
+
return glob(pattern, {
|
|
879
|
+
...rest,
|
|
880
|
+
onlyFiles: nodir ?? true
|
|
881
|
+
});
|
|
884
882
|
}
|
|
885
883
|
//#endregion
|
|
886
884
|
//#region src/sys/node/node-lazy-require.ts
|
|
@@ -889,6 +887,8 @@ function asyncGlob(pattern, opts) {
|
|
|
889
887
|
* returning diagnostic errors if requirements aren't met.
|
|
890
888
|
*/
|
|
891
889
|
var NodeLazyRequire = class {
|
|
890
|
+
nodeResolveModule;
|
|
891
|
+
lazyDependencies;
|
|
892
892
|
ensured = /* @__PURE__ */ new Set();
|
|
893
893
|
/**
|
|
894
894
|
* Create a NodeLazyRequire instance
|
|
@@ -938,11 +938,12 @@ var NodeLazyRequire = class {
|
|
|
938
938
|
return diagnostics;
|
|
939
939
|
}
|
|
940
940
|
require(fromDir, moduleId) {
|
|
941
|
-
|
|
941
|
+
const modulePath = this.getModulePath(fromDir, moduleId);
|
|
942
|
+
return __require(modulePath);
|
|
942
943
|
}
|
|
943
944
|
getModulePath(fromDir, moduleId) {
|
|
944
945
|
const modulePath = this.nodeResolveModule.resolveModule(fromDir, moduleId);
|
|
945
|
-
return path
|
|
946
|
+
return path.dirname(modulePath);
|
|
946
947
|
}
|
|
947
948
|
};
|
|
948
949
|
//#endregion
|
|
@@ -956,18 +957,18 @@ var NodeResolveModule = class {
|
|
|
956
957
|
if (opts && opts.manuallyResolve) return this.resolveModuleManually(fromDir, moduleId, cacheKey);
|
|
957
958
|
if (moduleId.startsWith("@types/")) return this.resolveTypesModule(fromDir, moduleId, cacheKey);
|
|
958
959
|
const Module = __require("module");
|
|
959
|
-
fromDir = path
|
|
960
|
-
const fromFile = path
|
|
960
|
+
fromDir = path.resolve(fromDir);
|
|
961
|
+
const fromFile = path.join(fromDir, "noop.js");
|
|
961
962
|
let dir = normalizePath(Module._resolveFilename(moduleId, {
|
|
962
963
|
id: fromFile,
|
|
963
964
|
filename: fromFile,
|
|
964
965
|
paths: Module._nodeModulePaths(fromDir)
|
|
965
966
|
}));
|
|
966
|
-
const root = normalizePath(path
|
|
967
|
+
const root = normalizePath(path.parse(fromDir).root);
|
|
967
968
|
let packageJsonFilePath;
|
|
968
969
|
while (dir !== root) {
|
|
969
|
-
dir = normalizePath(path
|
|
970
|
-
packageJsonFilePath = path
|
|
970
|
+
dir = normalizePath(path.dirname(dir));
|
|
971
|
+
packageJsonFilePath = path.join(dir, "package.json");
|
|
971
972
|
if (!fs.existsSync(packageJsonFilePath)) continue;
|
|
972
973
|
this.resolveModuleCache.set(cacheKey, packageJsonFilePath);
|
|
973
974
|
return packageJsonFilePath;
|
|
@@ -976,12 +977,12 @@ var NodeResolveModule = class {
|
|
|
976
977
|
}
|
|
977
978
|
resolveTypesModule(fromDir, moduleId, cacheKey) {
|
|
978
979
|
const moduleSplt = moduleId.split("/");
|
|
979
|
-
const root = normalizePath(path
|
|
980
|
-
let dir = normalizePath(path
|
|
980
|
+
const root = normalizePath(path.parse(fromDir).root);
|
|
981
|
+
let dir = normalizePath(path.join(fromDir, "noop.js"));
|
|
981
982
|
let typesPackageJsonFilePath;
|
|
982
983
|
while (dir !== root) {
|
|
983
|
-
dir = normalizePath(path
|
|
984
|
-
typesPackageJsonFilePath = path
|
|
984
|
+
dir = normalizePath(path.dirname(dir));
|
|
985
|
+
typesPackageJsonFilePath = path.join(dir, "node_modules", moduleSplt[0], moduleSplt[1], "package.json");
|
|
985
986
|
if (!fs.existsSync(typesPackageJsonFilePath)) continue;
|
|
986
987
|
this.resolveModuleCache.set(cacheKey, typesPackageJsonFilePath);
|
|
987
988
|
return typesPackageJsonFilePath;
|
|
@@ -989,12 +990,12 @@ var NodeResolveModule = class {
|
|
|
989
990
|
throw new Error(`error loading "${moduleId}" from "${fromDir}"`);
|
|
990
991
|
}
|
|
991
992
|
resolveModuleManually(fromDir, moduleId, cacheKey) {
|
|
992
|
-
const root = normalizePath(path
|
|
993
|
-
let dir = normalizePath(path
|
|
993
|
+
const root = normalizePath(path.parse(fromDir).root);
|
|
994
|
+
let dir = normalizePath(path.join(fromDir, "noop.js"));
|
|
994
995
|
let packageJsonFilePath;
|
|
995
996
|
while (dir !== root) {
|
|
996
|
-
dir = normalizePath(path
|
|
997
|
-
packageJsonFilePath = path
|
|
997
|
+
dir = normalizePath(path.dirname(dir));
|
|
998
|
+
packageJsonFilePath = path.join(dir, "node_modules", moduleId, "package.json");
|
|
998
999
|
if (!fs.existsSync(packageJsonFilePath)) continue;
|
|
999
1000
|
this.resolveModuleCache.set(cacheKey, packageJsonFilePath);
|
|
1000
1001
|
return packageJsonFilePath;
|
|
@@ -1005,7 +1006,7 @@ var NodeResolveModule = class {
|
|
|
1005
1006
|
//#endregion
|
|
1006
1007
|
//#region src/sys/node/node-stencil-version-checker.ts
|
|
1007
1008
|
const REGISTRY_URL = `https://registry.npmjs.org/@stencil/core`;
|
|
1008
|
-
const CHECK_INTERVAL =
|
|
1009
|
+
const CHECK_INTERVAL = 6048e5;
|
|
1009
1010
|
const CHANGELOG = `https://github.com/stenciljs/core/blob/main/CHANGELOG.md`;
|
|
1010
1011
|
async function checkVersion(logger, currentVersion) {
|
|
1011
1012
|
try {
|
|
@@ -1080,7 +1081,7 @@ function setLastCheck() {
|
|
|
1080
1081
|
});
|
|
1081
1082
|
}
|
|
1082
1083
|
function getLastCheckStoragePath() {
|
|
1083
|
-
return path
|
|
1084
|
+
return path.join(tmpdir$1(), "stencil_last_version_node.json");
|
|
1084
1085
|
}
|
|
1085
1086
|
function printUpdateMessage(logger, currentVersion, latestVersion) {
|
|
1086
1087
|
const installMessage = `npm install @stencil/core`;
|
|
@@ -1131,6 +1132,7 @@ const INDENT = ` `;
|
|
|
1131
1132
|
* thread so that messages may be passed to it.
|
|
1132
1133
|
*/
|
|
1133
1134
|
var NodeWorkerMain = class extends EventEmitter {
|
|
1135
|
+
id;
|
|
1134
1136
|
/**
|
|
1135
1137
|
* A handle for the OS process that is running our worker code
|
|
1136
1138
|
*/
|
|
@@ -1237,6 +1239,7 @@ var NodeWorkerMain = class extends EventEmitter {
|
|
|
1237
1239
|
* node.js workers ({@link NodeWorkerMain} instances)
|
|
1238
1240
|
*/
|
|
1239
1241
|
var NodeWorkerController = class extends EventEmitter {
|
|
1242
|
+
forkModulePath;
|
|
1240
1243
|
workerIds = 0;
|
|
1241
1244
|
stencilId = 0;
|
|
1242
1245
|
isEnding = false;
|
|
@@ -1388,7 +1391,7 @@ function createNodeSys(c = {}) {
|
|
|
1388
1391
|
const sysCpus = cpus();
|
|
1389
1392
|
const hardwareConcurrency = sysCpus.length;
|
|
1390
1393
|
const osPlatform = platform();
|
|
1391
|
-
const compilerExecutingPath =
|
|
1394
|
+
const compilerExecutingPath = nodePath.join(__dirname, "compiler", "index.mjs");
|
|
1392
1395
|
const runInterruptsCallbacks = () => {
|
|
1393
1396
|
const returnValues = [];
|
|
1394
1397
|
let cb;
|
|
@@ -1439,8 +1442,8 @@ function createNodeSys(c = {}) {
|
|
|
1439
1442
|
return new Promise((resolve) => {
|
|
1440
1443
|
if (opts) fs.mkdir(p, opts, (err) => {
|
|
1441
1444
|
resolve({
|
|
1442
|
-
basename:
|
|
1443
|
-
dirname:
|
|
1445
|
+
basename: nodePath.basename(p),
|
|
1446
|
+
dirname: nodePath.dirname(p),
|
|
1444
1447
|
path: p,
|
|
1445
1448
|
newDirs: [],
|
|
1446
1449
|
error: err
|
|
@@ -1448,8 +1451,8 @@ function createNodeSys(c = {}) {
|
|
|
1448
1451
|
});
|
|
1449
1452
|
else fs.mkdir(p, (err) => {
|
|
1450
1453
|
resolve({
|
|
1451
|
-
basename:
|
|
1452
|
-
dirname:
|
|
1454
|
+
basename: nodePath.basename(p),
|
|
1455
|
+
dirname: nodePath.dirname(p),
|
|
1453
1456
|
path: p,
|
|
1454
1457
|
newDirs: [],
|
|
1455
1458
|
error: err
|
|
@@ -1459,8 +1462,8 @@ function createNodeSys(c = {}) {
|
|
|
1459
1462
|
},
|
|
1460
1463
|
createDirSync(p, opts) {
|
|
1461
1464
|
const results = {
|
|
1462
|
-
basename:
|
|
1463
|
-
dirname:
|
|
1465
|
+
basename: nodePath.basename(p),
|
|
1466
|
+
dirname: nodePath.dirname(p),
|
|
1464
1467
|
path: p,
|
|
1465
1468
|
newDirs: [],
|
|
1466
1469
|
error: null
|
|
@@ -1473,7 +1476,7 @@ function createNodeSys(c = {}) {
|
|
|
1473
1476
|
return results;
|
|
1474
1477
|
},
|
|
1475
1478
|
createWorkerController(maxConcurrentWorkers) {
|
|
1476
|
-
return new NodeWorkerController(
|
|
1479
|
+
return new NodeWorkerController(nodePath.join(__dirname, "sys", "node", "worker.mjs"), maxConcurrentWorkers);
|
|
1477
1480
|
},
|
|
1478
1481
|
async destroy() {
|
|
1479
1482
|
const waits = [];
|
|
@@ -1532,13 +1535,13 @@ function createNodeSys(c = {}) {
|
|
|
1532
1535
|
onProcessInterrupt: (cb) => {
|
|
1533
1536
|
if (!onInterruptsCallbacks.includes(cb)) onInterruptsCallbacks.push(cb);
|
|
1534
1537
|
},
|
|
1535
|
-
platformPath:
|
|
1538
|
+
platformPath: nodePath,
|
|
1536
1539
|
readDir(p) {
|
|
1537
1540
|
return new Promise((resolve) => {
|
|
1538
1541
|
fs.readdir(p, (err, files) => {
|
|
1539
1542
|
if (err) resolve([]);
|
|
1540
1543
|
else resolve(files.map((f) => {
|
|
1541
|
-
return normalizePath(
|
|
1544
|
+
return normalizePath(nodePath.join(p, f));
|
|
1542
1545
|
}));
|
|
1543
1546
|
});
|
|
1544
1547
|
});
|
|
@@ -1549,7 +1552,7 @@ function createNodeSys(c = {}) {
|
|
|
1549
1552
|
readDirSync(p) {
|
|
1550
1553
|
try {
|
|
1551
1554
|
return fs.readdirSync(p).map((f) => {
|
|
1552
|
-
return normalizePath(
|
|
1555
|
+
return normalizePath(nodePath.join(p, f));
|
|
1553
1556
|
});
|
|
1554
1557
|
} catch {}
|
|
1555
1558
|
return [];
|
|
@@ -1626,8 +1629,8 @@ function createNodeSys(c = {}) {
|
|
|
1626
1629
|
force: true
|
|
1627
1630
|
}, (err) => {
|
|
1628
1631
|
resolve({
|
|
1629
|
-
basename:
|
|
1630
|
-
dirname:
|
|
1632
|
+
basename: nodePath.basename(p),
|
|
1633
|
+
dirname: nodePath.dirname(p),
|
|
1631
1634
|
path: p,
|
|
1632
1635
|
removedDirs: [],
|
|
1633
1636
|
removedFiles: [],
|
|
@@ -1636,8 +1639,8 @@ function createNodeSys(c = {}) {
|
|
|
1636
1639
|
});
|
|
1637
1640
|
else fs.rmdir(p, (err) => {
|
|
1638
1641
|
resolve({
|
|
1639
|
-
basename:
|
|
1640
|
-
dirname:
|
|
1642
|
+
basename: nodePath.basename(p),
|
|
1643
|
+
dirname: nodePath.dirname(p),
|
|
1641
1644
|
path: p,
|
|
1642
1645
|
removedDirs: [],
|
|
1643
1646
|
removedFiles: [],
|
|
@@ -1654,8 +1657,8 @@ function createNodeSys(c = {}) {
|
|
|
1654
1657
|
});
|
|
1655
1658
|
else fs.rmdirSync(p);
|
|
1656
1659
|
return {
|
|
1657
|
-
basename:
|
|
1658
|
-
dirname:
|
|
1660
|
+
basename: nodePath.basename(p),
|
|
1661
|
+
dirname: nodePath.dirname(p),
|
|
1659
1662
|
path: p,
|
|
1660
1663
|
removedDirs: [],
|
|
1661
1664
|
removedFiles: [],
|
|
@@ -1663,8 +1666,8 @@ function createNodeSys(c = {}) {
|
|
|
1663
1666
|
};
|
|
1664
1667
|
} catch (e) {
|
|
1665
1668
|
return {
|
|
1666
|
-
basename:
|
|
1667
|
-
dirname:
|
|
1669
|
+
basename: nodePath.basename(p),
|
|
1670
|
+
dirname: nodePath.dirname(p),
|
|
1668
1671
|
path: p,
|
|
1669
1672
|
removedDirs: [],
|
|
1670
1673
|
removedFiles: [],
|
|
@@ -1676,8 +1679,8 @@ function createNodeSys(c = {}) {
|
|
|
1676
1679
|
return new Promise((resolve) => {
|
|
1677
1680
|
fs.unlink(p, (err) => {
|
|
1678
1681
|
resolve({
|
|
1679
|
-
basename:
|
|
1680
|
-
dirname:
|
|
1682
|
+
basename: nodePath.basename(p),
|
|
1683
|
+
dirname: nodePath.dirname(p),
|
|
1681
1684
|
path: p,
|
|
1682
1685
|
error: err
|
|
1683
1686
|
});
|
|
@@ -1686,8 +1689,8 @@ function createNodeSys(c = {}) {
|
|
|
1686
1689
|
},
|
|
1687
1690
|
removeFileSync(p) {
|
|
1688
1691
|
const results = {
|
|
1689
|
-
basename:
|
|
1690
|
-
dirname:
|
|
1692
|
+
basename: nodePath.basename(p),
|
|
1693
|
+
dirname: nodePath.dirname(p),
|
|
1691
1694
|
path: p,
|
|
1692
1695
|
error: null
|
|
1693
1696
|
};
|
|
@@ -1762,7 +1765,7 @@ function createNodeSys(c = {}) {
|
|
|
1762
1765
|
sys.watchFile = (filePath, callback) => {
|
|
1763
1766
|
logger?.debug(`NODE_SYS_DEBUG::watchFile ${filePath}`);
|
|
1764
1767
|
const normalizedPath = normalizePath(filePath);
|
|
1765
|
-
const dirPath =
|
|
1768
|
+
const dirPath = nodePath.dirname(filePath);
|
|
1766
1769
|
const subscriptionPromise = parcelWatcher.subscribe(dirPath, (err, events) => {
|
|
1767
1770
|
if (err) {
|
|
1768
1771
|
logger?.error(`Watch error for ${filePath}: ${err.message}`);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { _a as MixedInCtor, ma as ComponentInterface, ya as ReactiveControllerHostInterface } from "./index-BHj3EBl2.mjs";
|
|
2
|
+
//#region src/runtime/asset-path.d.ts
|
|
3
|
+
declare const getAssetPath: (path: string) => string;
|
|
4
|
+
declare const setAssetPath: (path: string) => string;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/runtime/mixin.d.ts
|
|
7
|
+
type Ctor<T = {}> = new (...args: any[]) => T;
|
|
8
|
+
declare function Mixin(...mixins: ((base: Ctor) => Ctor)[]): Ctor<{}>;
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/runtime/reactive-controller.d.ts
|
|
11
|
+
declare const ReactiveControllerHost: <B extends MixedInCtor<ComponentInterface & HTMLElement>>(Base: B) => B & MixedInCtor<ReactiveControllerHostInterface>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { setAssetPath as i, Mixin as n, getAssetPath as r, ReactiveControllerHost as t };
|