@stencil/core 2.18.0 → 2.18.1
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/index.cjs +261 -206
- package/cli/index.d.ts +1 -0
- package/cli/index.js +261 -206
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.d.ts +2 -2
- package/compiler/stencil.js +48945 -47701
- package/compiler/stencil.min.js +2 -2
- package/dependencies.json +1 -1
- package/dev-server/client/index.d.ts +2 -2
- package/dev-server/client/index.js +241 -241
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +3 -3
- package/dev-server/index.d.ts +1 -1
- package/dev-server/index.js +2 -2
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +1230 -1199
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +2 -2
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +619 -601
- 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/polyfills/css-shim.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/index.js +119 -119
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +100 -100
- package/internal/package.json +1 -1
- package/internal/stencil-core/index.d.ts +8 -10
- package/internal/stencil-private.d.ts +77 -34
- package/internal/stencil-public-compiler.d.ts +2 -2
- package/internal/stencil-public-runtime.d.ts +15 -4
- package/internal/testing/index.js +148 -148
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +898 -898
- package/mock-doc/index.js +898 -898
- package/mock-doc/package.json +1 -1
- package/package.json +19 -26
- package/readme.md +27 -33
- package/screenshot/index.d.ts +1 -1
- package/screenshot/index.js +3 -3
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +983 -849
- package/sys/node/glob.js +1 -1
- package/sys/node/index.d.ts +2 -0
- package/sys/node/index.js +374 -373
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.d.ts +6 -6
- package/testing/index.js +345 -345
- package/testing/jest/jest-config.d.ts +1 -1
- package/testing/matchers/index.d.ts +3 -3
- package/testing/mock-fetch.d.ts +1 -1
- package/testing/mocks.d.ts +2 -2
- package/testing/package.json +1 -1
- package/testing/puppeteer/puppeteer-element.d.ts +2 -2
- package/testing/puppeteer/puppeteer-events.d.ts +1 -1
- package/testing/testing-logger.d.ts +1 -1
- package/testing/testing.d.ts +1 -1
package/mock-doc/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core",
|
|
3
|
-
"version": "2.18.
|
|
3
|
+
"version": "2.18.1",
|
|
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,8 +54,7 @@
|
|
|
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",
|
|
@@ -64,46 +63,40 @@
|
|
|
64
63
|
"@rollup/plugin-node-resolve": "9.0.0",
|
|
65
64
|
"@rollup/plugin-replace": "2.3.4",
|
|
66
65
|
"@rollup/pluginutils": "4.1.0",
|
|
67
|
-
"@types/
|
|
68
|
-
"@types/eslint": "^8.4.2",
|
|
66
|
+
"@types/eslint": "^8.4.6",
|
|
69
67
|
"@types/exit": "^0.1.31",
|
|
70
68
|
"@types/fs-extra": "^9.0.8",
|
|
71
|
-
"@types/glob": "^
|
|
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.
|
|
76
|
-
"@types/mime-types": "^2.1.0",
|
|
73
|
+
"@types/listr": "^0.14.4",
|
|
77
74
|
"@types/node": "^14.14.35",
|
|
78
|
-
"@types/node-fetch": "^2.5.8",
|
|
79
75
|
"@types/parse5": "^6.0.0",
|
|
80
|
-
"@types/pixelmatch": "^
|
|
76
|
+
"@types/pixelmatch": "^5.2.4",
|
|
81
77
|
"@types/pngjs": "^3.4.2",
|
|
82
78
|
"@types/prompts": "^2.0.9",
|
|
83
|
-
"@types/semver": "^7.3.
|
|
79
|
+
"@types/semver": "^7.3.12",
|
|
84
80
|
"@types/sizzle": "^2.3.2",
|
|
85
81
|
"@types/webpack": "^4.41.26",
|
|
86
82
|
"@types/ws": "^7.4.0",
|
|
87
83
|
"@types/yarnpkg__lockfile": "^1.1.5",
|
|
88
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
89
|
-
"@typescript-eslint/parser": "^5.
|
|
84
|
+
"@typescript-eslint/eslint-plugin": "^5.38.0",
|
|
85
|
+
"@typescript-eslint/parser": "^5.38.0",
|
|
90
86
|
"@yarnpkg/lockfile": "^1.1.0",
|
|
91
87
|
"ansi-colors": "4.1.1",
|
|
92
88
|
"autoprefixer": "10.2.5",
|
|
93
|
-
"
|
|
94
|
-
"conventional-changelog-cli": "^2.1.1",
|
|
95
|
-
"core-js-builder": "~3.6.5",
|
|
96
|
-
"css": "^3.0.0",
|
|
89
|
+
"conventional-changelog-cli": "^2.2.2",
|
|
97
90
|
"dts-bundle-generator": "~6.12.0",
|
|
98
|
-
"eslint": "^8.
|
|
91
|
+
"eslint": "^8.23.1",
|
|
99
92
|
"eslint-config-prettier": "^8.5.0",
|
|
100
|
-
"eslint-plugin-jest": "^
|
|
93
|
+
"eslint-plugin-jest": "^27.0.4",
|
|
101
94
|
"eslint-plugin-jsdoc": "^39.3.1",
|
|
95
|
+
"eslint-plugin-simple-import-sort": "^8.0.0",
|
|
102
96
|
"execa": "4.1.0",
|
|
103
97
|
"exit": "^0.1.2",
|
|
104
|
-
"fast-deep-equal": "3.1.3",
|
|
105
98
|
"fs-extra": "^10.1.0",
|
|
106
|
-
"glob": "
|
|
99
|
+
"glob": "8.0.3",
|
|
107
100
|
"graceful-fs": "~4.2.6",
|
|
108
101
|
"hash.js": "^1.1.7",
|
|
109
102
|
"inquirer": "^7.3.3",
|
|
@@ -111,23 +104,23 @@
|
|
|
111
104
|
"jest-cli": "^27.4.5",
|
|
112
105
|
"jest-environment-node": "^27.4.4",
|
|
113
106
|
"listr": "^0.14.3",
|
|
114
|
-
"magic-string": "^0.
|
|
107
|
+
"magic-string": "^0.26.3",
|
|
115
108
|
"merge-source-map": "^1.1.0",
|
|
116
109
|
"mime-db": "^1.46.0",
|
|
117
110
|
"minimatch": "3.0.4",
|
|
118
111
|
"node-fetch": "2.6.7",
|
|
119
|
-
"open": "8.
|
|
112
|
+
"open": "^8.4.0",
|
|
120
113
|
"open-in-editor": "2.2.0",
|
|
121
114
|
"parse5": "6.0.1",
|
|
122
115
|
"path-browserify": "^1.0.1",
|
|
123
|
-
"pixelmatch": "
|
|
116
|
+
"pixelmatch": "5.3.0",
|
|
124
117
|
"postcss": "^8.2.8",
|
|
125
118
|
"prettier": "2.7.1",
|
|
126
119
|
"prompts": "2.4.0",
|
|
127
120
|
"puppeteer": "~10.0.0",
|
|
128
121
|
"rollup": "2.42.3",
|
|
129
122
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
130
|
-
"semver": "7.3.
|
|
123
|
+
"semver": "^7.3.7",
|
|
131
124
|
"sizzle": "^2.3.6",
|
|
132
125
|
"terser": "5.6.1",
|
|
133
126
|
"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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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>
|
package/screenshot/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { ScreenshotConnector } from './connector-base';
|
|
2
2
|
export { ScreenshotLocalConnector } from './connector-local';
|
|
3
|
-
export {
|
|
3
|
+
export { Screenshot, ScreenshotBuild, ScreenshotCompareResults, ScreenshotDiff } from '@stencil/core/internal';
|
package/screenshot/index.js
CHANGED
|
@@ -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) => {
|