Skip to content
This repository was archived by the owner on Dec 22, 2024. It is now read-only.

Commit db958d6

Browse files
committed
Initial import
1 parent aab13cb commit db958d6

40 files changed

+46834
-1
lines changed

.devcontainer/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.145.1/containers/typescript-node/.devcontainer/base.Dockerfile
2+
3+
ARG VARIANT="16-bullseye"
4+
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}
5+
6+
# [Optional] Uncomment this section to install additional OS packages.
7+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
8+
# && apt-get -y install --no-install-recommends <your-package-list-here>
9+
10+
# [Optional] Uncomment if you want to install an additional version of node using nvm
11+
# ARG EXTRA_NODE_VERSION=10
12+
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
13+
14+
# [Optional] Uncomment if you want to install more global node packages
15+
# RUN sudo -u node npm install -g <your-package-list -here>

.devcontainer/devcontainer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "react-vite-storybook-typescript-starter",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": { "VARIANT": "16" }
6+
},
7+
8+
// Add the IDs of extensions you want installed when the container is created.
9+
"extensions": [
10+
"streetsidesoftware.code-spell-checker",
11+
"esbenp.prettier-vscode",
12+
"mikestead.dotenv",
13+
"eamodio.gitlens",
14+
"vscode-icons-team.vscode-icons",
15+
"mgmcdermott.vscode-language-babel",
16+
"dbaeumer.vscode-eslint",
17+
"styled-components.vscode-styled-components",
18+
"silvenon.mdx"
19+
],
20+
21+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
22+
// "forwardPorts": [],
23+
24+
// Use 'postCreateCommand' to run commands after the container is created.
25+
"postCreateCommand": "npm install"
26+
27+
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
28+
// "remoteUser": "node"
29+
}

.editorconfig

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

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
dist/
3+
storybook-static/

.eslintrc.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
},
6+
extends: ['plugin:react/recommended', 'airbnb', 'airbnb-typescript', 'plugin:react/jsx-runtime', 'plugin:prettier/recommended'],
7+
parser: '@typescript-eslint/parser',
8+
parserOptions: {
9+
ecmaFeatures: {
10+
jsx: true,
11+
},
12+
ecmaVersion: 13,
13+
sourceType: 'module',
14+
project: './tsconfig.json',
15+
},
16+
plugins: ['react', '@typescript-eslint'],
17+
rules: {
18+
'import/prefer-default-export': 'off',
19+
'import/no-relative-packages': 'off',
20+
'import/no-extraneous-dependencies': 'off',
21+
'react/require-default-props': 'off',
22+
'react/jsx-fragments': ['error', 'element'],
23+
},
24+
};

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text eol=lf

.github/workflows/cd-npm.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Continuous deployment (NPM)
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
build-and-deploy:
10+
name: Build and deploy NPM package
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: '0'
17+
18+
- name: Configure node for npmjs.org as registry
19+
uses: actions/setup-node@v2
20+
with:
21+
node-version: '16.x'
22+
registry-url: 'https://registry.npmjs.org'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Build
28+
run: npm run build
29+
30+
- name: Create Github release
31+
run: npm run release:create-github-release
32+
env:
33+
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}}
34+
35+
- name: Publish package on npmjs.org
36+
run: npm publish ./dist --access public
37+
env:
38+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/cd-storybook.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Continuous deployment (Storybook)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-deploy:
10+
name: Build and deploy Storybook to Github Pages
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v2
16+
17+
- name: Use nodejs
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: '16.x'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Build storybook
26+
run: npm run build:storybook
27+
28+
- name: Deploy to Github Pages
29+
uses: JamesIves/github-pages-deploy-action@v4.2.2
30+
with:
31+
branch: gh-pages
32+
folder: storybook-static
33+
clean: true

.github/workflows/check-size.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Check size
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
size:
10+
name: Check sizes
11+
runs-on: ubuntu-latest
12+
env:
13+
CI_JOB_NUMBER: 1
14+
steps:
15+
- name: Checkout repo
16+
uses: actions/checkout@v2
17+
- uses: andresz1/size-limit-action@v1
18+
with:
19+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Continuous integration
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
node: ['14.x', '16.x']
12+
os: [ubuntu-latest, windows-latest, macOS-latest]
13+
14+
steps:
15+
- name: Checkout repo
16+
uses: actions/checkout@v2
17+
18+
- name: Use Node ${{ matrix.node }}
19+
uses: actions/setup-node@v2
20+
with:
21+
node-version: ${{ matrix.node }}
22+
cache: npm
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Check format
28+
run: npm run check:format
29+
30+
- name: Check types
31+
run: npm run check:types
32+
33+
- name: Run tests
34+
run: npm run test
35+
36+
- name: Build
37+
run: npm run build

0 commit comments

Comments
 (0)