Skip to content

Commit 8ffe08e

Browse files
Work in progress
0 parents  commit 8ffe08e

31 files changed

+14020
-0
lines changed

.eslintrc.cjs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: true, es2020: true },
4+
extends: [
5+
'eslint:recommended',
6+
'plugin:@typescript-eslint/recommended',
7+
'plugin:react-hooks/recommended',
8+
'plugin:storybook/recommended',
9+
],
10+
ignorePatterns: ['dist', '.eslintrc.cjs'],
11+
parser: '@typescript-eslint/parser',
12+
plugins: ['react-refresh'],
13+
rules: {
14+
// Should be "warn". Two to fix.
15+
'react-refresh/only-export-components': [
16+
'off',
17+
{ allowConstantExport: true },
18+
],
19+
},
20+
};

.github/workflows/build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: build
2+
on:
3+
release:
4+
types: [created]
5+
push:
6+
branches:
7+
- '**'
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: '20.x'
19+
registry-url: 'https://registry.npmjs.org'
20+
cache: npm
21+
- uses: microbit-foundation/npm-package-versioner-action@v1
22+
- run: npm ci
23+
env:
24+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
- run: npm run ci
26+
- name: Upload GitHub packages artifact
27+
uses: actions/upload-pages-artifact@v3
28+
with:
29+
path: ./storybook-static
30+
- run: npm publish
31+
if: github.event_name == 'release' && github.event.action == 'created'
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
34+
deploy:
35+
# https://github.com/actions/deploy-pages
36+
runs-on: ubuntu-latest
37+
permissions:
38+
pages: write
39+
id-token: write
40+
needs: build
41+
# Deploy to the github-pages environment
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
if: github.ref == 'refs/heads/main'
46+
steps:
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
25+
26+
*storybook.log
27+
*.tgz
28+
storybook-static/

.npmignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.*
2+
*.log
3+
4+
# tools configs
5+
**/tsconfig.json
6+
tsconfig.*.json
7+
tslint.json
8+
**/webpack.config.js
9+
**/jest.config.js
10+
**/prettier.config.js
11+
12+
# build scripts
13+
config/
14+
scripts/
15+
16+
# Test files
17+
**/*.spec.js
18+
**/*.test.js
19+
**/*.test.d.ts
20+
**/*.spec.d.ts
21+
__tests__
22+
coverage
23+
24+
**/stories/*
25+
26+
# Sources
27+
node_modules
28+
src
29+
docs
30+
examples
31+
32+
## this is generated by `npm pack`
33+
*.tgz
34+
package

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@microbit-foundation:registry=https://npm.pkg.github.com/microbit-foundation

.prettierignore

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

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": true,
3+
"arrowParens": "always",
4+
"bracketSpacing": true,
5+
"trailingComma": "es5",
6+
"printWidth": 80
7+
}

.storybook/main.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { StorybookConfig } from '@storybook/react-vite';
2+
3+
const config: StorybookConfig = {
4+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5+
addons: [
6+
'@storybook/addon-links',
7+
'@storybook/addon-essentials',
8+
'@chromatic-com/storybook',
9+
'@storybook/addon-interactions',
10+
],
11+
framework: {
12+
name: '@storybook/react-vite',
13+
options: {},
14+
},
15+
};
16+
export default config;

.storybook/preview.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { Preview } from "@storybook/react";
2+
3+
const preview: Preview = {
4+
parameters: {
5+
controls: {
6+
matchers: {
7+
color: /(background|color)$/i,
8+
date: /Date$/i,
9+
},
10+
},
11+
},
12+
};
13+
14+
export default preview;

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) YEAR AUTHOR
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)