Skip to content

Commit 3b6ff1e

Browse files
committed
init
0 parents  commit 3b6ff1e

72 files changed

Lines changed: 13070 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.barrelsby.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"directory": "src",
3+
"delete": true,
4+
"flat": true,
5+
"noHeader": true,
6+
"include": ["components", "utils"],
7+
"singleQuotes": true
8+
}

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# https://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
indent_style = space
10+
indent_size = 2
11+
trim_trailing_whitespace = true

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/components/layout/legacy/**

.eslintrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": ["plugin:@typescript-eslint/recommended"],
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": ["@typescript-eslint/eslint-plugin", "eslint-plugin-tsdoc"],
5+
"root": true,
6+
"rules": {
7+
"tsdoc/syntax": "warn"
8+
}
9+
}

.github/workflows/workflow.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: lint | test | build
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
16+
with:
17+
cache: "npm"
18+
node-version: 18.14.2
19+
- name: install
20+
run: npm ci
21+
- name: lint
22+
run: npm run lint
23+
24+
test:
25+
name: Test
26+
needs: lint
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v3
30+
- uses: actions/setup-node@v3
31+
with:
32+
cache: "npm"
33+
node-version: 18.14.2
34+
- name: install
35+
run: npm ci
36+
- name: test
37+
run: npm run test:ci
38+
39+
build:
40+
name: Build
41+
needs: [lint, test]
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v3
45+
- uses: actions/setup-node@v3
46+
with:
47+
cache: "npm"
48+
node-version: 18.14.2
49+
- name: install
50+
run: npm ci
51+
- name: build
52+
run: npm run build
53+
- uses: actions/upload-artifact@v3
54+
if: success() && github.ref == 'refs/heads/main'
55+
with:
56+
name: package
57+
path: dist
58+
59+
publish:
60+
name: Publish
61+
if: success() && github.ref == 'refs/heads/main'
62+
needs: build
63+
permissions: write-all
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@v3
67+
- uses: actions/setup-node@v3
68+
with:
69+
cache: "npm"
70+
node-version: 18.14.2
71+
registry-url: https://registry.npmjs.org/
72+
- uses: actions/download-artifact@v3
73+
with:
74+
name: package
75+
path: dist
76+
- name: configure git
77+
run: |
78+
git config user.name "${GITHUB_ACTOR}"
79+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
80+
- name: configure npm
81+
run: npm config set //registry.npmjs.org/:_authToken ${{secrets.WCP_NPM_TOKEN}}
82+
- name: release
83+
run: npx release-it --ci --verbose
84+
env:
85+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
86+
NODE_AUTH_TOKEN: ${{secrets.WCP_NPM_TOKEN}}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.npmrc
2+
/dist
3+
/node_modules
4+
/reports
5+
/src/config.schema.json
6+
/*.tgz

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18.14.2

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# artifacts
2+
dist
3+
src/index.ts

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"jsxSingleQuote": false,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"useTabs": false,
6+
"printWidth": 120
7+
}

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<img align="right" src="https://github.com/webcomponents-preview/client/actions/workflows/workflow.yml/badge.svg" alt="Workflow status">
2+
<img align="left" src="https://github.com/webcomponents-preview/client/raw/main/src/assets/icons/logo.svg" alt="WCP Logo" width="55px" style="margin-right: 10px">
3+
4+
# Web Components Preview
5+
6+
A storybook alike preview application for web components. It processes a given custom element manifest and renders a preview for each element with its properties and events.
7+
8+
Configuration is done by providing a schema file of your custom elements. The schema is a JSON file that describes the custom elements and their properties and should comply to the draft [Custom element manifest](https://github.com/webcomponents/custom-elements-manifest) specification.
9+
10+
## Usage
11+
12+
### Generating a custom element manifest
13+
14+
We recommend to use the [`@custom-elements-manifest/analyzer` package](https://github.com/open-wc/custom-elements-manifest/tree/master/packages/analyzer) to generate a custom element manifest.
15+
16+
### Generating readmes
17+
18+
Once you documented your components with jsdoc, you can use e.g. the [`web-component-analyzer` package](https://github.com/runem/web-component-analyzer) to generate readme files for your components as well.
19+
20+
### Configuration
21+
22+
Just add the following script tag to your html file:
23+
24+
#### via JsDelivr
25+
26+
```html
27+
<script type="module" src="https://cdn.jsdelivr.net/npm/@webcomponents-preview/client"></script>
28+
```
29+
30+
#### via unpkg
31+
32+
```html
33+
<script type="module" src="https://unpkg.com/@webcomponents-preview/client"></script>
34+
```
35+
36+
Then add the following markup to your html and pass in the manifest url and a path to the configuration file:
37+
38+
```html
39+
<wcp-root config-url="/webcomponents-preview.config.json" manifest-url="/custom-elements.json"></wcp-root>
40+
```
41+
42+
## Extras
43+
44+
**tbd**
45+
46+
- [ ] How to add previews from jsdoc -> cem analyzer plugin
47+
- [ ] How to add existing readmes
48+
- [ ] Plugin infrastructure
49+
50+
## Development
51+
52+
**tbd**

0 commit comments

Comments
 (0)