diff --git a/.codesandbox/tasks.json b/.codesandbox/tasks.json new file mode 100644 index 00000000..9f609a6f --- /dev/null +++ b/.codesandbox/tasks.json @@ -0,0 +1,78 @@ +{ + // These tasks will run in order when initializing your CodeSandbox project. + "setupTasks": [ + { + "name": "Install Dependencies", + "command": "pnpm install" + } + ], + + // These tasks can be run from CodeSandbox. Running one will open a log in the app. + "tasks": { + "dev": { + "name": "dev", + "command": "pnpm run dev", + "runAtStart": true + }, + "build": { + "name": "build", + "command": "pnpm run build", + "runAtStart": false + }, + "build:docs": { + "name": "build:docs", + "command": "pnpm run build:docs", + "runAtStart": false + }, + "test": { + "name": "test", + "command": "pnpm run test", + "runAtStart": false + }, + "test:unit": { + "name": "test:unit", + "command": "pnpm run test:unit", + "runAtStart": false + }, + "test:unit:web": { + "name": "test:unit:web", + "command": "pnpm run test:unit:web", + "runAtStart": false + }, + "test:unit:native": { + "name": "test:unit:native", + "command": "pnpm run test:unit:native", + "runAtStart": false + }, + "test:watch": { + "name": "test:watch", + "command": "pnpm run test:watch", + "runAtStart": false + }, + "test:tsc": { + "name": "test:tsc", + "command": "pnpm run test:tsc", + "runAtStart": false + }, + "test:tsc:watch": { + "name": "test:tsc:watch", + "command": "pnpm run test:tsc:watch", + "runAtStart": false + }, + "commit": { + "name": "commit", + "command": "pnpm run commit", + "runAtStart": false + }, + "format": { + "name": "format", + "command": "pnpm run format", + "runAtStart": false + }, + "release": { + "name": "release", + "command": "pnpm run release", + "runAtStart": false + } + } +} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..19f7f683 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,22 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node +{ + "name": "Node.js & TypeScript", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye" + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "yarn install", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 4163597f..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "@significa/eslint-config", - "plugins": ["jest"], - "rules": { - "@typescript-eslint/interface-name-prefix": "off", - "@typescript-eslint/ban-ts-ignore": "off", - "sort-exports/sort-exports": "off" - }, - "env": { - "jest": true - } -} diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..f33a02cd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for more information: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +# https://containers.dev/guide/dependabot + +version: 2 +updates: + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 042f61a1..a7a80fa6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,42 +9,27 @@ on: jobs: check: runs-on: ubuntu-latest - strategy: - matrix: - node-version: ['10', '12', '14'] - name: '[v${{ matrix.node-version }}] lint and test' + name: Lint, typecheck and test steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2-beta + - uses: pnpm/action-setup@v3 with: - node-version: ${{ matrix.node-version }} + version: 8 - - name: Cache node_modules - id: cache-node_modules - uses: actions/cache@v2 + - name: Use Node.js 20 + uses: actions/setup-node@v3 with: - path: node_modules - key: ${{ runner.os }}-node-${{matrix.node-version}}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node-${{matrix.node-version}}- - ${{ runner.os }}-node- - ${{ runner.os }}- + node-version: 20 + cache: 'pnpm' - name: Install dependencies - if: steps.cache-node_modules.outputs.cache-hit != 'true' - run: npm ci --force - - - name: Lint - run: npm run lint + run: pnpm i - name: Run tests - run: npm run test + run: pnpm run test - name: Build - env: - BUNDLESIZE_GITHUB_TOKEN: ${{ secrets.BUNDLESIZE }} - run: npm run build + run: pnpm run build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3216b58c..56df1675 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,31 +12,23 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v2-beta + - uses: pnpm/action-setup@v3 + with: + version: 8 - - name: Cache node_modules - id: cache-node_modules - uses: actions/cache@v2 + - name: Use Node.js 20 + uses: actions/setup-node@v3 with: - path: node_modules - key: ${{ runner.os }}-node-${{matrix.node-version}}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node-${{matrix.node-version}}- - ${{ runner.os }}-node- - ${{ runner.os }}- + node-version: 20 + cache: 'pnpm' - name: Install dependencies - if: steps.cache-node_modules.outputs.cache-hit != 'true' - run: npm ci --force - - - name: Lint - run: npm run lint + run: pnpm i - name: Run tests - run: npm run test + run: pnpm run test build-and-release: runs-on: ubuntu-latest @@ -45,72 +37,26 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v2-beta + - uses: pnpm/action-setup@v3 + with: + version: 8 - - name: Cache node_modules - id: cache-node_modules - uses: actions/cache@v2 + - name: Use Node.js 20 + uses: actions/setup-node@v3 with: - path: node_modules - key: ${{ runner.os }}-node-${{matrix.node-version}}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node-${{matrix.node-version}}- - ${{ runner.os }}-node- - ${{ runner.os }}- + node-version: 20 + cache: 'pnpm' - name: Install dependencies - if: steps.cache-node_modules.outputs.cache-hit != 'true' - run: npm ci --force + run: pnpm i - name: Build - env: - BUNDLESIZE_GITHUB_TOKEN: ${{ secrets.BUNDLESIZE }} - run: npm run build + run: pnpm run build - name: Release env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npm run release - - docs: - runs-on: ubuntu-latest - needs: prepare - name: Documentation - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Use Node.js - uses: actions/setup-node@v2-beta - - - name: Cache node_modules - id: cache-node_modules - uses: actions/cache@v2 - with: - path: node_modules - key: ${{ runner.os }}-node-${{matrix.node-version}}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node-${{matrix.node-version}}- - ${{ runner.os }}-node- - ${{ runner.os }}- - - - name: Install dependencies - if: steps.cache-node_modules.outputs.cache-hit != 'true' - run: npm ci --force - - - name: Build storybook - run: npm run build:docs - - - name: Deploy - uses: JamesIves/github-pages-deploy-action@3.6.2 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: docs - FOLDER: docs-build - CLEAN: true - TARGET_FOLDER: docs + run: pnpm run release diff --git a/.prettierrc.js b/.prettierrc.js index ab1c688a..0c0a4c48 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1 +1 @@ -module.exports = require("@significa/prettier-config"); \ No newline at end of file +module.exports = require("@significa/prettier-config"); diff --git a/.storybook/addons.js b/.storybook/addons.js deleted file mode 100644 index ea43e7ef..00000000 --- a/.storybook/addons.js +++ /dev/null @@ -1,2 +0,0 @@ -import '@storybook/addon-notes/register' -import '@storybook/addon-notes/register-panel' diff --git a/.storybook/config.js b/.storybook/config.js deleted file mode 100644 index 2bd843b9..00000000 --- a/.storybook/config.js +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react' -import { configure, addParameters, addDecorator } from '@storybook/react' -import { themes } from '@storybook/theming' - -addParameters({ options: { theme: themes.normal } }) - -addDecorator(storyFn => ( -