Skip to content

Commit

Permalink
feat: update to use auto compatibility of es-dev-server
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsDenBakker committed Nov 19, 2019
1 parent 7d5ea56 commit f6d085e
Show file tree
Hide file tree
Showing 17 changed files with 182 additions and 156 deletions.
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ packages/semantic-dom-diff/bundle/get-diffable-html.js
packages/**/test/**/snapshots
/packages/es-dev-server/test/fixtures/**/*
/packages/es-dev-server/demo/**/*
/packages/karma-esm/src/test-loader-browser-script.js
/packages/karma-esm/src/esm-debug.html
/packages/karma-esm/src/esm-context.html
CHANGELOG.md
Expand Down
8 changes: 7 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ module.exports = config => {
{
pattern: config.grep
? config.grep
: 'packages/!(webpack-import-meta-loader|create|building-utils|webpack-index-html-plugin|rollup-plugin-index-html|import-maps-generate|import-maps-resolve|es-dev-server)/test/**/*.test.js',
: 'packages/!(webpack-import-meta-loader|create|building-utils|webpack-index-html-plugin|rollup-plugin-index-html|import-maps-generate|import-maps-resolve|es-dev-server|karma-esm)/test/**/*.test.js',
type: 'module',
},
],

client: {
mocha: {
timeout: 20000,
},
},

esm: {
nodeResolve: true,
},
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@
"site:start": "npm run vuepress:start",
"test": "yarn test:browser && yarn test:node",
"test:browser": "karma start --coverage",
"test:browser:compatibility": "karma start --compatibility all --coverage",
"test:browser:compatibility:watch": "karma start --auto-watch=true --single-run=false --compatibility all --coverage",
"test:browser:prune-snapshots": "karma start --prune-snapshots",
"test:browser:update-snapshots": "karma start --update-snapshots",
"test:browser:watch": "karma start --auto-watch=true --single-run=false",
"test:bs": "karma start karma.bs.conf.js --compatibility all --coverage",
"test:bs": "karma start karma.bs.conf.js --coverage",
"test:node": "lerna run test:node",
"test:update-snapshots": "lerna run test:update-snapshots",
"vuepress:build": "vuepress build docs",
Expand Down
10 changes: 5 additions & 5 deletions packages/building-rollup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
"rollup"
],
"dependencies": {
"@babel/core": "^7.3.3",
"@babel/core": "^7.7.2",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-syntax-import-meta": "^7.2.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-env": "^7.7.1",
"@open-wc/building-utils": "^2.10.2",
"babel-plugin-bundled-import-meta": "^0.3.0",
"babel-plugin-template-html-minifier": "^3.0.0",
Expand All @@ -51,9 +51,9 @@
"rollup-plugin-workbox": "^4.0.0"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.3.4",
"@babel/plugin-proposal-decorators": "^7.4.4",
"@babel/preset-typescript": "^7.3.3",
"@babel/plugin-proposal-class-properties": "^7.7.0",
"@babel/plugin-proposal-decorators": "^7.7.0",
"@babel/preset-typescript": "^7.7.2",
"es-dev-server": "^1.23.1",
"lit-element": "^2.0.1",
"rimraf": "^2.6.3",
Expand Down
10 changes: 5 additions & 5 deletions packages/building-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
"config"
],
"dependencies": {
"@babel/core": "^7.3.3",
"@babel/core": "^7.7.2",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-syntax-import-meta": "^7.2.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-env": "^7.7.1",
"@open-wc/building-utils": "^2.10.2",
"@open-wc/webpack-index-html-plugin": "^1.5.4",
"babel-loader": "^8.0.0",
Expand All @@ -54,9 +54,9 @@
"workbox-webpack-plugin": "^4.3.1"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.3.4",
"@babel/preset-typescript": "^7.3.3",
"@babel/register": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.7.0",
"@babel/preset-typescript": "^7.7.2",
"@babel/register": "^7.7.0",
"http-server": "^0.11.1",
"lit-element": "^2.0.1",
"ts-loader": "^5.3.3",
Expand Down
8 changes: 4 additions & 4 deletions packages/create/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
"semver": "^6.1.0"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.3",
"@babel/preset-env": "^7.0.0",
"@babel/register": "^7.0.0",
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"@babel/register": "^7.7.0",
"babel-plugin-transform-dynamic-import": "^2.1.0",
"chai": "^4.2.0",
"chai-fs": "^2.0.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/create/src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,10 @@ export async function writeFilesToDisk() {
type: 'select',
name: 'writeToDisk',
message: 'Do you want to write this file structure to disk?',
choices: [{ title: 'Yes', value: 'true' }, { title: 'No', value: 'false' }],
choices: [
{ title: 'Yes', value: 'true' },
{ title: 'No', value: 'false' },
],
},
],
{
Expand Down
5 changes: 1 addition & 4 deletions packages/create/src/generators/wc-lit-element/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import { processTemplate, readFileFromPath } from '../../core.js';
const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args)));
const safeReduce = (f, initial) => xs => (Array.isArray(xs) ? xs.reduce(f, initial) : xs);

const getTemplatePart = compose(
processTemplate,
readFileFromPath,
);
const getTemplatePart = compose(processTemplate, readFileFromPath);

function featureReadmeBlurb(feature) {
const path = join(__dirname, `./templates/partials/README.${feature}.md`);
Expand Down
8 changes: 4 additions & 4 deletions packages/import-maps-generate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
"semver": "^6.1.0"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.3",
"@babel/preset-env": "^7.0.0",
"@babel/register": "^7.0.0",
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"@babel/register": "^7.7.0",
"babel-plugin-transform-dynamic-import": "^2.1.0",
"chai": "^4.2.0",
"mocha": "^6.0.0",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/import-maps-resolve/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"import-maps"
],
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.3",
"@babel/preset-env": "^7.0.0",
"@babel/register": "^7.0.0",
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"@babel/register": "^7.7.0",
"babel-plugin-transform-dynamic-import": "^2.1.0",
"chai": "^4.2.0",
"mocha": "^6.0.0",
Expand Down
9 changes: 5 additions & 4 deletions packages/rollup-plugin-index-html/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ Rollup plugin to make rollup understand your index.html.
</head>
<body>
<h1><span>Hello world!</span></h1>
<my-app></my-app
><script>
console.log('hello inline script');</script
><script src="app.202933f045cc9f6cdf51.js"></script>
<my-app></my-app>
<script>
console.log('hello inline script');
</script>
<script src="app.202933f045cc9f6cdf51.js"></script>
</body>
</html>
```
Expand Down
1 change: 1 addition & 0 deletions packages/rollup-plugin-index-html/test/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ async function testSnapshot(name, configFilePath) {

output.forEach(file => {
const filePath = path.join(config.output.dir, file.fileName);
// @ts-ignore
outputFiles[filePath] = file.code;
});
}
Expand Down
100 changes: 55 additions & 45 deletions packages/testing-helpers/test/stringLitFixture.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ describe('stringFixtureSync & litFixtureSync & fixture & litFixture', () => {
`,
),
].forEach(testElement);
(await Promise.all([
stringFixture('<test-component>Text content</test-component>'),
litFixture(
html`
<test-component>Text content</test-component>
`,
),
])).forEach(testElement);
(
await Promise.all([
stringFixture('<test-component>Text content</test-component>'),
litFixture(
html`
<test-component>Text content</test-component>
`,
),
])
).forEach(testElement);
});

it('wraps element into a div attached to the body', async () => {
Expand All @@ -50,14 +52,16 @@ describe('stringFixtureSync & litFixtureSync & fixture & litFixture', () => {
`,
),
].forEach(testElement);
(await Promise.all([
stringFixture('<test-component></test-component>'),
litFixture(
html`
<test-component></test-component>
`,
),
])).forEach(testElement);
(
await Promise.all([
stringFixture('<test-component></test-component>'),
litFixture(
html`
<test-component></test-component>
`,
),
])
).forEach(testElement);
});

it('allows to create several fixtures in one test', async () => {
Expand All @@ -83,20 +87,22 @@ describe('stringFixtureSync & litFixtureSync & fixture & litFixture', () => {
`,
),
].forEach(testElement);
(await Promise.all([
stringFixture('<test-component></test-component>'),
stringFixture('<test-component></test-component>'),
litFixture(
html`
<test-component></test-component>
`,
),
litFixture(
html`
<test-component></test-component>
`,
),
])).forEach(testElement);
(
await Promise.all([
stringFixture('<test-component></test-component>'),
stringFixture('<test-component></test-component>'),
litFixture(
html`
<test-component></test-component>
`,
),
litFixture(
html`
<test-component></test-component>
`,
),
])
).forEach(testElement);
});

it('handles self closing tags', async () => {
Expand All @@ -114,14 +120,16 @@ describe('stringFixtureSync & litFixtureSync & fixture & litFixture', () => {
`,
),
].forEach(testElement);
(await Promise.all([
stringFixture('<test-component/>'),
litFixture(
html`
<test-component />
`,
),
])).forEach(testElement);
(
await Promise.all([
stringFixture('<test-component/>'),
litFixture(
html`
<test-component />
`,
),
])
).forEach(testElement);
});

it('always returns first child element ignoring whitespace and other elements', async () => {
Expand All @@ -141,16 +149,18 @@ describe('stringFixtureSync & litFixtureSync & fixture & litFixture', () => {
<div></div>
`),
].forEach(testElement);
(await Promise.all([
stringFixture(`
<test-component></test-component>
<div></div>
`),
litFixture(html`
(
await Promise.all([
stringFixture(`
<test-component></test-component>
<div></div>
`),
])).forEach(testElement);
litFixture(html`
<test-component></test-component>
<div></div>
`),
])
).forEach(testElement);
});

it('will wait for one frame', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-import-meta-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"import-meta"
],
"devDependencies": {
"@babel/register": "^7.0.0",
"@babel/register": "^7.7.0",
"babel-preset-env": "^1.7.0",
"chai": "^4.2.0",
"memory-fs": "^0.4.1",
Expand Down
Loading

0 comments on commit f6d085e

Please sign in to comment.