@stencil/core 2.18.0 → 2.19.0

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.
Files changed (66) hide show
  1. package/cli/index.cjs +275 -218
  2. package/cli/index.d.ts +3 -0
  3. package/cli/index.js +275 -218
  4. package/cli/package.json +1 -1
  5. package/compiler/package.json +1 -1
  6. package/compiler/stencil.d.ts +2 -2
  7. package/compiler/stencil.js +49510 -47947
  8. package/compiler/stencil.min.js +2 -2
  9. package/dependencies.json +1 -1
  10. package/dev-server/client/index.d.ts +2 -2
  11. package/dev-server/client/index.js +241 -241
  12. package/dev-server/client/package.json +1 -1
  13. package/dev-server/connector.html +3 -3
  14. package/dev-server/index.d.ts +1 -1
  15. package/dev-server/index.js +2 -2
  16. package/dev-server/package.json +1 -1
  17. package/dev-server/server-process.js +1230 -1199
  18. package/internal/app-data/package.json +1 -1
  19. package/internal/client/css-shim.js +2 -2
  20. package/internal/client/dom.js +1 -1
  21. package/internal/client/index.js +619 -601
  22. package/internal/client/package.json +1 -1
  23. package/internal/client/patch-browser.js +1 -1
  24. package/internal/client/patch-esm.js +1 -1
  25. package/internal/client/polyfills/css-shim.js +1 -1
  26. package/internal/client/shadow-css.js +1 -1
  27. package/internal/hydrate/index.js +119 -119
  28. package/internal/hydrate/package.json +1 -1
  29. package/internal/hydrate/runner.d.ts +1 -1
  30. package/internal/hydrate/runner.js +100 -100
  31. package/internal/package.json +1 -1
  32. package/internal/stencil-core/index.d.ts +8 -10
  33. package/internal/stencil-private.d.ts +104 -42
  34. package/internal/stencil-public-compiler.d.ts +12 -2
  35. package/internal/stencil-public-docs.d.ts +20 -0
  36. package/internal/stencil-public-runtime.d.ts +20 -4
  37. package/internal/testing/index.js +148 -148
  38. package/internal/testing/package.json +1 -1
  39. package/mock-doc/index.cjs +655 -645
  40. package/mock-doc/index.js +655 -645
  41. package/mock-doc/package.json +1 -1
  42. package/package.json +29 -37
  43. package/readme.md +27 -33
  44. package/screenshot/index.d.ts +1 -1
  45. package/screenshot/index.js +3 -3
  46. package/screenshot/package.json +1 -1
  47. package/screenshot/pixel-match.js +983 -849
  48. package/sys/node/autoprefixer.js +5 -5
  49. package/sys/node/glob.js +1 -1
  50. package/sys/node/graceful-fs.js +1 -1
  51. package/sys/node/index.d.ts +4 -0
  52. package/sys/node/index.js +373 -374
  53. package/sys/node/package.json +1 -1
  54. package/sys/node/prompts.js +1 -1
  55. package/sys/node/worker.js +1 -1
  56. package/testing/index.d.ts +6 -6
  57. package/testing/index.js +468 -467
  58. package/testing/jest/jest-config.d.ts +1 -1
  59. package/testing/matchers/index.d.ts +3 -3
  60. package/testing/mock-fetch.d.ts +1 -1
  61. package/testing/mocks.d.ts +2 -2
  62. package/testing/package.json +1 -1
  63. package/testing/puppeteer/puppeteer-element.d.ts +2 -2
  64. package/testing/puppeteer/puppeteer-events.d.ts +1 -1
  65. package/testing/testing-logger.d.ts +1 -1
  66. package/testing/testing.d.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/mock-doc",
3
- "version": "2.18.0",
3
+ "version": "2.19.0",
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": "2.18.0",
3
+ "version": "2.19.0",
4
4
  "license": "MIT",
5
5
  "main": "./internal/stencil-core/index.cjs",
6
6
  "module": "./internal/stencil-core/index.js",
@@ -30,7 +30,7 @@
30
30
  "license": "node scripts --license",
31
31
  "lint": "eslint \"src/*.ts\" \"src/**/*.ts\" \"src/**/*.tsx\"",
32
32
  "prettier": "npm run prettier.base -- --write",
33
- "prettier.base": "prettier \"./({bin,scripts,src,test}/**/*.{ts,tsx,js,jsx})|bin/stencil\"",
33
+ "prettier.base": "prettier \"./({bin,scripts,src,test}/**/*.{ts,tsx,js,jsx})|bin/stencil|.github/(**/)?*.(yml|yaml)|*.js\"",
34
34
  "prettier.dry-run": "npm run prettier.base -- --list-different",
35
35
  "release": "node scripts --release --publish",
36
36
  "release.prepare": "node scripts --release --prepare",
@@ -54,56 +54,48 @@
54
54
  "tsc": "tsc --incremental",
55
55
  "tsc.prod": "tsc",
56
56
  "tsc.scripts": "tsc -p scripts/tsconfig.json",
57
- "tsc.watch": "tsc --incremental --watch",
58
- "watch": "node scripts && npm run tsc && concurrently \"npm run rollup.watch\" \"npm run tsc.watch\""
57
+ "tsc.watch": "tsc --incremental --watch"
59
58
  },
60
59
  "devDependencies": {
61
60
  "@ionic/prettier-config": "^2.0.0",
62
61
  "@rollup/plugin-commonjs": "15.1.0",
63
- "@rollup/plugin-json": "4.1.0",
62
+ "@rollup/plugin-json": "5.0.0",
64
63
  "@rollup/plugin-node-resolve": "9.0.0",
65
64
  "@rollup/plugin-replace": "2.3.4",
66
- "@rollup/pluginutils": "4.1.0",
67
- "@types/autoprefixer": "^10.2.0",
68
- "@types/eslint": "^8.4.2",
65
+ "@rollup/pluginutils": "5.0.1",
66
+ "@types/eslint": "^8.4.6",
69
67
  "@types/exit": "^0.1.31",
70
68
  "@types/fs-extra": "^9.0.8",
71
- "@types/glob": "^7.1.2",
69
+ "@types/glob": "^8.0.0",
72
70
  "@types/graceful-fs": "^4.1.5",
73
71
  "@types/inquirer": "^7.3.1",
74
72
  "@types/jest": "^27.0.3",
75
- "@types/listr": "^0.14.2",
76
- "@types/mime-types": "^2.1.0",
77
- "@types/node": "^14.14.35",
78
- "@types/node-fetch": "^2.5.8",
79
- "@types/parse5": "^6.0.0",
80
- "@types/pixelmatch": "^4.0.0",
81
- "@types/pngjs": "^3.4.2",
73
+ "@types/listr": "^0.14.4",
74
+ "@types/node": "^16.11.62",
75
+ "@types/pixelmatch": "^5.2.4",
76
+ "@types/pngjs": "^6.0.1",
82
77
  "@types/prompts": "^2.0.9",
83
- "@types/semver": "^7.3.4",
78
+ "@types/semver": "^7.3.12",
84
79
  "@types/sizzle": "^2.3.2",
85
80
  "@types/webpack": "^4.41.26",
86
81
  "@types/ws": "^7.4.0",
87
82
  "@types/yarnpkg__lockfile": "^1.1.5",
88
- "@typescript-eslint/eslint-plugin": "^5.20.0",
89
- "@typescript-eslint/parser": "^5.20.0",
83
+ "@typescript-eslint/eslint-plugin": "^5.38.0",
84
+ "@typescript-eslint/parser": "^5.38.0",
90
85
  "@yarnpkg/lockfile": "^1.1.0",
91
- "ansi-colors": "4.1.1",
92
- "autoprefixer": "10.2.5",
93
- "concurrently": "^6.0.0",
94
- "conventional-changelog-cli": "^2.1.1",
95
- "core-js-builder": "~3.6.5",
96
- "css": "^3.0.0",
97
- "dts-bundle-generator": "~6.12.0",
98
- "eslint": "^8.13.0",
86
+ "ansi-colors": "4.1.3",
87
+ "autoprefixer": "10.4.12",
88
+ "conventional-changelog-cli": "^2.2.2",
89
+ "dts-bundle-generator": "~7.0.0",
90
+ "eslint": "^8.23.1",
99
91
  "eslint-config-prettier": "^8.5.0",
100
- "eslint-plugin-jest": "^26.5.3",
92
+ "eslint-plugin-jest": "^27.0.4",
101
93
  "eslint-plugin-jsdoc": "^39.3.1",
94
+ "eslint-plugin-simple-import-sort": "^8.0.0",
102
95
  "execa": "4.1.0",
103
96
  "exit": "^0.1.2",
104
- "fast-deep-equal": "3.1.3",
105
97
  "fs-extra": "^10.1.0",
106
- "glob": "7.1.6",
98
+ "glob": "8.0.3",
107
99
  "graceful-fs": "~4.2.6",
108
100
  "hash.js": "^1.1.7",
109
101
  "inquirer": "^7.3.3",
@@ -111,23 +103,23 @@
111
103
  "jest-cli": "^27.4.5",
112
104
  "jest-environment-node": "^27.4.4",
113
105
  "listr": "^0.14.3",
114
- "magic-string": "^0.25.7",
106
+ "magic-string": "^0.26.3",
115
107
  "merge-source-map": "^1.1.0",
116
108
  "mime-db": "^1.46.0",
117
- "minimatch": "3.0.4",
109
+ "minimatch": "5.1.0",
118
110
  "node-fetch": "2.6.7",
119
- "open": "8.2.1",
111
+ "open": "^8.4.0",
120
112
  "open-in-editor": "2.2.0",
121
- "parse5": "6.0.1",
113
+ "parse5": "7.1.1",
122
114
  "path-browserify": "^1.0.1",
123
- "pixelmatch": "4.0.2",
115
+ "pixelmatch": "5.3.0",
124
116
  "postcss": "^8.2.8",
125
117
  "prettier": "2.7.1",
126
- "prompts": "2.4.0",
118
+ "prompts": "2.4.2",
127
119
  "puppeteer": "~10.0.0",
128
120
  "rollup": "2.42.3",
129
121
  "rollup-plugin-sourcemaps": "^0.6.3",
130
- "semver": "7.3.4",
122
+ "semver": "^7.3.7",
131
123
  "sizzle": "^2.3.6",
132
124
  "terser": "5.6.1",
133
125
  "typescript": "4.7.4",
package/readme.md CHANGED
@@ -9,7 +9,10 @@
9
9
  </h1>
10
10
 
11
11
  <p align="center">
12
- A compiler for generating <a href="https://www.webcomponents.org/introduction">Web Components</a>
12
+ A compiler for generating <a href="https://www.webcomponents.org/introduction" target="_blank" rel="noopener noref">Web Components</a>, built by the <a href="https://ionic.io/">Ionic team</a>.
13
+ </p>
14
+ <p align="center">
15
+ Stencil allows developers to use technologies like TypeScript and JSX to define components, then generate 100% standards-based Web Components that run on both <a href="https://stenciljs.com/docs/browser-support" target="_blank" rel="noopener noref">modern browsers and legacy browsers</a>
13
16
  </p>
14
17
 
15
18
  <p align="center">
@@ -43,46 +46,28 @@
43
46
  <a href="https://twitter.com/stenciljs">Twitter</a>
44
47
  </h2>
45
48
 
46
- [Stencil](https://stenciljs.com/) is a simple compiler for generating Web Components and static site generated progressive web apps (PWA). Stencil was built by the [Ionic](https://ionic.io/) team for its next generation of performant mobile and desktop Web Components.
47
-
48
- Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. It combines TypeScript, JSX, an asynchronous rendering pipeline to ensure smooth running animations and lazy-loading, to generate 100% standards-based Web Components that run on both [modern browsers and legacy browsers](https://stenciljs.com/docs/browser-support).
49
-
50
- Stencil components are just Web Components, so they work in any major framework or with no framework at all. In many cases, Stencil can be used as a drop in replacement for traditional frontend frameworks given the capabilities now available in the browser, though using it as such is certainly not required.
51
-
52
- Stencil also enables a number of key capabilities on top of Web Components, in particular Server Side Rendering (SSR) without the need to run a headless browser, pre-rendering, and objects-as-properties (instead of just strings).
53
-
54
- ## Getting Started
55
-
56
- To create a new project using an interactive cli, run:
57
-
58
- ```bash
59
- npm init stencil
60
- ```
61
-
62
- To start developing your new Stencil project, run:
63
-
64
- ```bash
65
- npm start
66
- ```
67
-
68
- ## Creating components
69
-
70
- Stencil components are TypeScript classes with decorator metadata. The decorators themselves are purely build-time annotations so the compiler can read metadata about each component, and removed entirely for smaller efficient components.
49
+ ### Getting Started
71
50
 
72
- Create new components by creating files with a `.tsx` extension, such as `my-component.tsx`, and place them in `src/components`.
51
+ Start a new project by following our quick [Getting Started guide](https://stenciljs.com/docs/getting-started).
52
+ We would love to hear from you!
53
+ If you have any feedback or run into issues using Stencil, please file an [issue](https://github.com/ionic-team/stencil/issues/new) on this repository.
73
54
 
55
+ ### Examples
56
+ A Stencil component looks a lot like a class-based React component, with the addition of TypeScript decorators:
74
57
  ```tsx
75
58
  import { Component, Prop, h } from '@stencil/core';
76
59
 
77
60
  @Component({
78
- tag: 'my-component',
79
- styleUrl: 'my-component.css'
61
+ tag: 'my-component', // the name of the component's custom HTML tag
62
+ styleUrl: 'my-component.css', // css styles to apply to the component
63
+ shadow: true, // this component uses the ShadowDOM
80
64
  })
81
65
  export class MyComponent {
82
-
66
+ // The component accepts two arguments:
83
67
  @Prop() first: string;
84
68
  @Prop() last: string;
85
69
 
70
+ //The following HTML is rendered when our component is used
86
71
  render() {
87
72
  return (
88
73
  <div>
@@ -93,13 +78,22 @@ export class MyComponent {
93
78
  }
94
79
  ```
95
80
 
96
- To use this component, just use it like any other HTML element:
81
+ The component above can be used like any other HTML element:
97
82
 
98
83
  ```html
99
84
  <my-component first="Stencil" last="JS"></my-component>
100
85
  ```
101
86
 
102
- ## Thanks
87
+ Since Stencil generates web components, they work in any major framework or with no framework at all.
88
+ In many cases, Stencil can be used as a drop in replacement for traditional frontend framework, though using it as such is certainly not required.
89
+
90
+ ### Contributing
91
+
92
+ Thanks for your interest in contributing!
93
+ Please take a moment to read up on our guidelines for [contributing](https://github.com/ionic-team/stencil/blob/main/.github/CONTRIBUTING.md).
94
+ Please note that this project is released with a [Contributor Code of Conduct](https://github.com/ionic-team/stencil/blob/main/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
95
+
96
+ ### Thanks
103
97
  Stencil's internal testing suite is supported by the [BrowserStack Open-Source Program](https://www.browserstack.com/open-source)
104
98
  <br>
105
- <a target="_blank" href="https://www.browserstack.com/"><img width="200" src="https://www.browserstack.com/images/layout/browserstack-logo-600x315.png"></a>
99
+ <a href="https://www.browserstack.com/" target="_blank" rel="noopener noref"><img width="200" src="https://www.browserstack.com/images/layout/browserstack-logo-600x315.png"></a>
@@ -1,3 +1,3 @@
1
1
  export { ScreenshotConnector } from './connector-base';
2
2
  export { ScreenshotLocalConnector } from './connector-local';
3
- export { ScreenshotBuild, Screenshot, ScreenshotCompareResults, ScreenshotDiff } from '@stencil/core/internal';
3
+ export { Screenshot, ScreenshotBuild, ScreenshotCompareResults, ScreenshotDiff } from '@stencil/core/internal';
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- const fs = require('fs');
4
- const path = require('path');
5
3
  const os = require('os');
4
+ const path = require('path');
5
+ const fs = require('fs');
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
9
- const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
10
9
  const path__default = /*#__PURE__*/_interopDefaultLegacy(path);
10
+ const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
11
11
 
12
12
  function fileExists(filePath) {
13
13
  return new Promise((resolve) => {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/screenshot",
3
- "version": "2.18.0",
3
+ "version": "2.19.0",
4
4
  "description": "Stencil Screenshot.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",