-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3201df6
commit 6946f50
Showing
35 changed files
with
3,684 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ | |
|
||
- StoryBook | ||
- Lit | ||
- Midway Hooks | ||
- Midway Serverless | ||
|
||
## Hydration(Stage 4) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
|
||
[*] | ||
|
||
# Change these settings to your own preference | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# We recommend you to keep these unchanged | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.json] | ||
indent_size = 2 | ||
|
||
[*.{html,js,md}] | ||
block_comment_start = /** | ||
block_comment = * | ||
block_comment_end = */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## editors | ||
/.idea | ||
/.vscode | ||
|
||
## system files | ||
.DS_Store | ||
|
||
## npm | ||
/node_modules/ | ||
/npm-debug.log | ||
|
||
## testing | ||
/coverage/ | ||
|
||
## temp folders | ||
/.tmp/ | ||
|
||
# build | ||
/_site/ | ||
/dist/ | ||
/out-tsc/ | ||
|
||
storybook-static | ||
custom-elements.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
stories: ['../**/out-tsc/stories/*.stories.{js,md,mdx}'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { storybookPlugin } from '@web/dev-server-storybook'; | ||
import baseConfig from '../web-dev-server.config.mjs'; | ||
|
||
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({ | ||
...baseConfig, | ||
open: '/', | ||
plugins: [storybookPlugin({ type: 'web-components' }), ...baseConfig.plugins], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 lit-app | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<p align="center"> | ||
<img width="200" src="https://open-wc.org/hero.png"></img> | ||
</p> | ||
|
||
## Open-wc Starter App | ||
|
||
[![Built with open-wc recommendations](https://img.shields.io/badge/built%20with-open--wc-blue.svg)](https://github.com/open-wc) | ||
|
||
## Quickstart | ||
|
||
To get started: | ||
|
||
```sh | ||
npm init @open-wc | ||
# requires node 10 & npm 6 or higher | ||
``` | ||
|
||
## Scripts | ||
|
||
- `start` runs your app for development, reloading on file changes | ||
- `start:build` runs your app after it has been built using the build command | ||
- `build` builds your app and outputs it in your `dist` directory | ||
- `test` runs your test suite with Web Test Runner | ||
- `lint` runs the linter for your project | ||
|
||
## Tooling configs | ||
|
||
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project. | ||
|
||
If you customize the configuration a lot, you can consider moving them to individual files. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /> | ||
<meta name="Description" content="Put your description here."> | ||
<base href="/"> | ||
|
||
<style> | ||
html, | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
font-family: sans-serif; | ||
background-color: #ededed; | ||
} | ||
</style> | ||
<title>lit-app</title> | ||
</head> | ||
|
||
<body> | ||
<lit-app></lit-app> | ||
|
||
<script type="module" src="./out-tsc/src/lit-app.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"name": "lit-app", | ||
"description": "Webcomponent lit-app following open-wc recommendations", | ||
"license": "MIT", | ||
"author": "lit-app", | ||
"version": "0.0.0", | ||
"scripts": { | ||
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore", | ||
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore", | ||
"test": "tsc && wtr --coverage", | ||
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\"", | ||
"storybook": "tsc && npm run analyze -- --exclude dist && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds -c .storybook/server.mjs\"", | ||
"storybook:build": "tsc && npm run analyze -- --exclude dist && build-storybook", | ||
"build": "rimraf dist && tsc && rollup -c rollup.config.js && npm run analyze -- --exclude dist", | ||
"start:build": "web-dev-server --root-dir dist --app-index index.html --open", | ||
"analyze": "cem analyze --litelement", | ||
"start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"" | ||
}, | ||
"dependencies": { | ||
"lit": "^2.0.2" | ||
}, | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.16.4", | ||
"@custom-elements-manifest/analyzer": "^0.4.17", | ||
"@open-wc/building-rollup": "^2.0.1", | ||
"@open-wc/eslint-config": "^4.3.0", | ||
"@open-wc/testing": "next", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@rollup/plugin-node-resolve": "^13.0.6", | ||
"@typescript-eslint/eslint-plugin": "^4.33.0", | ||
"@typescript-eslint/parser": "^4.33.0", | ||
"@web/dev-server": "^0.1.28", | ||
"@web/dev-server-storybook": "next", | ||
"@web/rollup-plugin-html": "^1.10.1", | ||
"@web/rollup-plugin-import-meta-assets": "^1.0.7", | ||
"@web/test-runner": "next", | ||
"babel-plugin-template-html-minifier": "^4.1.0", | ||
"concurrently": "^5.3.0", | ||
"deepmerge": "^4.2.2", | ||
"eslint": "^7.32.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"husky": "^4.3.8", | ||
"lint-staged": "^10.5.4", | ||
"prettier": "^2.4.1", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.60.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-workbox": "^6.2.0", | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.5.2" | ||
}, | ||
"eslintConfig": { | ||
"parser": "@typescript-eslint/parser", | ||
"extends": [ | ||
"@open-wc", | ||
"prettier" | ||
], | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error" | ||
], | ||
"import/no-unresolved": "off", | ||
"import/extensions": [ | ||
"error", | ||
"always", | ||
{ | ||
"ignorePackages": true | ||
} | ||
] | ||
} | ||
}, | ||
"prettier": { | ||
"singleQuote": true, | ||
"arrowParens": "avoid" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
"*.ts": [ | ||
"eslint --fix", | ||
"prettier --write" | ||
] | ||
}, | ||
"customElements": "custom-elements.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import nodeResolve from '@rollup/plugin-node-resolve'; | ||
import babel from '@rollup/plugin-babel'; | ||
import html from '@web/rollup-plugin-html'; | ||
import { importMetaAssets } from '@web/rollup-plugin-import-meta-assets'; | ||
import { terser } from 'rollup-plugin-terser'; | ||
import { generateSW } from 'rollup-plugin-workbox'; | ||
import path from 'path'; | ||
|
||
export default { | ||
input: 'index.html', | ||
output: { | ||
entryFileNames: '[hash].js', | ||
chunkFileNames: '[hash].js', | ||
assetFileNames: '[hash][extname]', | ||
format: 'es', | ||
dir: 'dist', | ||
}, | ||
preserveEntrySignatures: false, | ||
|
||
plugins: [ | ||
/** Enable using HTML as rollup entrypoint */ | ||
html({ | ||
minify: true, | ||
injectServiceWorker: true, | ||
serviceWorkerPath: 'dist/sw.js', | ||
}), | ||
/** Resolve bare module imports */ | ||
nodeResolve(), | ||
/** Minify JS */ | ||
terser(), | ||
/** Bundle assets references via import.meta.url */ | ||
importMetaAssets(), | ||
/** Compile JS to a lower language target */ | ||
babel({ | ||
babelHelpers: 'bundled', | ||
presets: [ | ||
[ | ||
require.resolve('@babel/preset-env'), | ||
{ | ||
targets: [ | ||
'last 3 Chrome major versions', | ||
'last 3 Firefox major versions', | ||
'last 3 Edge major versions', | ||
'last 3 Safari major versions', | ||
], | ||
modules: false, | ||
bugfixes: true, | ||
}, | ||
], | ||
], | ||
plugins: [ | ||
[ | ||
require.resolve('babel-plugin-template-html-minifier'), | ||
{ | ||
modules: { lit: ['html', { name: 'css', encapsulation: 'style' }] }, | ||
failOnError: false, | ||
strictCSS: true, | ||
htmlMinifier: { | ||
collapseWhitespace: true, | ||
conservativeCollapse: true, | ||
removeComments: true, | ||
caseSensitive: true, | ||
minifyCSS: true, | ||
}, | ||
}, | ||
], | ||
], | ||
}), | ||
/** Create and inject a service worker */ | ||
generateSW({ | ||
globIgnores: ['polyfills/*.js', 'nomodule-*.js'], | ||
navigateFallback: '/index.html', | ||
// where to output the generated sw | ||
swDest: path.join('dist', 'sw.js'), | ||
// directory to match patterns against to be precached | ||
globDirectory: path.join('dist'), | ||
// cache any html js and css by default | ||
globPatterns: ['**/*.{html,js,css,webmanifest}'], | ||
skipWaiting: true, | ||
clientsClaim: true, | ||
runtimeCaching: [{ urlPattern: 'polyfills/*.js', handler: 'CacheFirst' }], | ||
}), | ||
], | ||
}; |
Oops, something went wrong.