@stencil/core 4.20.0 → 4.21.0-dev.1724780308.9f407a8

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal",
3
- "version": "4.20.0",
3
+ "version": "4.21.0-dev.1724780308.9f407a8",
4
4
  "description": "Stencil internals only to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -2,6 +2,7 @@ import type { ConfigFlags } from '../cli/config-flags';
2
2
  import type { PrerenderUrlResults, PrintLine } from '../internal';
3
3
  import type { BuildCtx, CompilerCtx } from './stencil-private';
4
4
  import type { JsonDocs } from './stencil-public-docs';
5
+ import type { ResolutionHandler } from './stencil-public-runtime';
5
6
  export * from './stencil-public-docs';
6
7
  /**
7
8
  * https://stenciljs.com/docs/config/
@@ -847,10 +848,10 @@ export interface SerializeDocumentOptions extends HydrateDocumentOptions {
847
848
  */
848
849
  removeHtmlComments?: boolean;
849
850
  /**
850
- * If set to `false` Stencil will ignore the fact that a component has a `shadow: true`
851
- * flag and serializes it as a scoped component. If set to `true` the component will
852
- * be rendered within a Declarative Shadow DOM.
853
- * @default false
851
+ * If set to `true` the component will be rendered within a Declarative Shadow DOM.
852
+ * If set to `false` Stencil will ignore the contents of the shadow root and render the
853
+ * element as given in provided template.
854
+ * @default true
854
855
  */
855
856
  serializeShadowRoot?: boolean;
856
857
  /**
@@ -859,6 +860,11 @@ export interface SerializeDocumentOptions extends HydrateDocumentOptions {
859
860
  * @default true
860
861
  */
861
862
  fullDocument?: boolean;
863
+ /**
864
+ * Style mode to render the component in.
865
+ * @see https://stenciljs.com/docs/styling#style-modes
866
+ */
867
+ mode?: ResolutionHandler;
862
868
  }
863
869
  export interface HydrateFactoryOptions extends SerializeDocumentOptions {
864
870
  serializeToHtml: boolean;
@@ -1504,6 +1510,11 @@ export interface CopyTask {
1504
1510
  * the output target for which this copy operation is configured.
1505
1511
  */
1506
1512
  dest?: string;
1513
+ /**
1514
+ * An optional array of glob patterns to exclude from the copy operation.
1515
+ * @default ['**\/__mocks__/**', '**\/__fixtures__/**', '**\/dist/**', '**\/.{idea,git,cache,output,temp}/**', '**\/.ds_store', '**\/.gitignore', '**\/desktop.ini', '**\/thumbs.db']
1516
+ */
1517
+ ignore?: string[];
1507
1518
  /**
1508
1519
  * Whether or not Stencil should issue warnings if it cannot find the
1509
1520
  * specified source files or directories. Defaults to `false`.
@@ -1014,17 +1014,19 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
1014
1014
  if ((import_app_data7.BUILD.hydrateServerSide || import_app_data7.BUILD.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1015
1015
  styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
1016
1016
  }
1017
- const injectStyle = (
1018
- /**
1019
- * we render a scoped component
1020
- */
1021
- !(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) || /**
1022
- * we are using shadow dom and render the style tag within the shadowRoot
1023
- */
1024
- cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD"
1025
- );
1026
- if (injectStyle) {
1027
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link"));
1017
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
1018
+ if (styleContainerNode.nodeName === "HEAD") {
1019
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
1020
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : document.querySelector("style");
1021
+ styleContainerNode.insertBefore(styleElm, referenceNode2);
1022
+ } else if ("host" in styleContainerNode) {
1023
+ styleContainerNode.prepend(styleElm);
1024
+ } else {
1025
+ styleContainerNode.append(styleElm);
1026
+ }
1027
+ }
1028
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
1029
+ styleContainerNode.insertBefore(styleElm, null);
1028
1030
  }
1029
1031
  }
1030
1032
  if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
@@ -1132,7 +1134,11 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
1132
1134
  if (memberName === "list") {
1133
1135
  isProp = false;
1134
1136
  } else if (oldValue == null || elm[memberName] != n) {
1135
- elm[memberName] = n;
1137
+ if (typeof elm.__lookupSetter__(memberName) === "function") {
1138
+ elm[memberName] = n;
1139
+ } else {
1140
+ elm.setAttribute(memberName, n);
1141
+ }
1136
1142
  }
1137
1143
  } else {
1138
1144
  elm[memberName] = newValue;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/testing",
3
- "version": "4.20.0",
3
+ "version": "4.21.0-dev.1724780308.9f407a8",
4
4
  "description": "Stencil internal testing platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "private": true
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc (CommonJS) v4.20.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc (CommonJS) v4.21.0-dev.1724780308.9f407a8 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __defProp = Object.defineProperty;
@@ -7853,6 +7853,11 @@ patchPropAttributes(
7853
7853
  type: "submit"
7854
7854
  }
7855
7855
  );
7856
+ Object.defineProperty(MockButtonElement.prototype, "form", {
7857
+ get() {
7858
+ return this.hasAttribute("form") ? this.getAttribute("form") : null;
7859
+ }
7860
+ });
7856
7861
  var MockImageElement = class extends MockHTMLElement {
7857
7862
  constructor(ownerDocument) {
7858
7863
  super(ownerDocument, "img");
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc v4.20.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc v4.21.0-dev.1724780308.9f407a8 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
 
5
5
  // src/runtime/runtime-constants.ts
@@ -7800,6 +7800,11 @@ patchPropAttributes(
7800
7800
  type: "submit"
7801
7801
  }
7802
7802
  );
7803
+ Object.defineProperty(MockButtonElement.prototype, "form", {
7804
+ get() {
7805
+ return this.hasAttribute("form") ? this.getAttribute("form") : null;
7806
+ }
7807
+ });
7803
7808
  var MockImageElement = class extends MockHTMLElement {
7804
7809
  constructor(ownerDocument) {
7805
7810
  super(ownerDocument, "img");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/mock-doc",
3
- "version": "4.20.0",
3
+ "version": "4.21.0-dev.1724780308.9f407a8",
4
4
  "description": "Mock window, document and DOM outside of a browser environment.",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core",
3
- "version": "4.20.0",
3
+ "version": "4.21.0-dev.1724780308.9f407a8",
4
4
  "license": "MIT",
5
5
  "main": "./internal/stencil-core/index.cjs",
6
6
  "module": "./internal/stencil-core/index.js",
@@ -96,11 +96,11 @@
96
96
  "build": "npm run clean && npm run tsc.prod && npm run ts scripts/index.ts -- --prod --ci",
97
97
  "build.watch": "npm run build -- --watch",
98
98
  "build.updateSelectorEngine": "npm run ts scripts/updateSelectorEngine.ts",
99
- "clean": "rm -rf build/ cli/ compiler/ dev-server/ internal/ mock-doc/ sys/ testing/ && npm run clean:scripts && npm run clean.screenshots",
100
- "clean.screenshots": "rm -rf test/end-to-end/screenshot/builds test/end-to-end/screenshot/images",
101
- "clean:scripts": "rm -rf scripts/build",
99
+ "clean": "rimraf build/ cli/ compiler/ dev-server/ internal/ mock-doc/ sys/ testing/ && npm run clean:scripts && npm run clean.screenshots",
100
+ "clean.screenshots": "rimraf test/end-to-end/screenshot/builds test/end-to-end/screenshot/images",
101
+ "clean:scripts": "rimraf scripts/build",
102
102
  "lint": "eslint 'bin/*' 'scripts/*.ts' 'scripts/**/*.ts' 'src/*.ts' 'src/**/*.ts' 'src/**/*.tsx' 'test/wdio/**/*.tsx'",
103
- "install.jest": "bash ./src/testing/jest/install-dependencies.sh",
103
+ "install.jest": "npx tsx ./src/testing/jest/install-dependencies.mts",
104
104
  "prettier": "npm run prettier.base -- --write",
105
105
  "prettier.base": "prettier --cache \"./({bin,scripts,src,test}/**/*.{ts,tsx,js,jsx})|bin/stencil|.github/(**/)?*.(yml|yaml)|*.js\"",
106
106
  "prettier.dry-run": "npm run prettier.base -- --list-different",
@@ -112,6 +112,7 @@
112
112
  "test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --coverage",
113
113
  "test.analysis": "cd test && npm run analysis.build-and-analyze",
114
114
  "test.bundlers": "cd test && npm run bundlers",
115
+ "test.copytask": "cd test/copy-task && npm ci && npm run test",
115
116
  "test.dist": "npm run ts scripts/index.ts -- --validate-build",
116
117
  "test.end-to-end": "cd test/end-to-end && npm ci && npm test && npm run test.dist",
117
118
  "test.jest": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js",
@@ -158,7 +159,7 @@
158
159
  "eslint": "^8.23.1",
159
160
  "eslint-config-prettier": "^9.0.0",
160
161
  "eslint-plugin-jest": "^28.0.0",
161
- "eslint-plugin-jsdoc": "^48.0.0",
162
+ "eslint-plugin-jsdoc": "^50.0.0",
162
163
  "eslint-plugin-simple-import-sort": "^12.0.0",
163
164
  "eslint-plugin-wdio": "^8.24.12",
164
165
  "execa": "9.3.0",
@@ -184,6 +185,7 @@
184
185
  "prettier": "3.3.1",
185
186
  "prompts": "2.4.2",
186
187
  "puppeteer": "^21.0.0",
188
+ "rimraf": "^6.0.1",
187
189
  "rollup": "2.56.3",
188
190
  "semver": "^7.3.7",
189
191
  "terser": "5.31.1",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Screenshot v4.20.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Screenshot v4.21.0-dev.1724780308.9f407a8 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/screenshot",
3
- "version": "4.20.0",
3
+ "version": "4.21.0-dev.1724780308.9f407a8",
4
4
  "description": "Stencil Screenshot.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Screenshot Pixel Match v4.20.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Screenshot Pixel Match v4.21.0-dev.1724780308.9f407a8 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;