diff --git a/.eslintignore b/.eslintignore deleted file mode 120000 index 3e4e48b..0000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -.gitignore \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index e3e89d2..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,48 +0,0 @@ -const copyrightTemplate = `/* - * Copyright (c) 2018-Present, Spotify AB. - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -`; - -module.exports = { - extends: [ - //"plugin:@typescript-eslint/recommended", - 'prettier', - 'prettier/@typescript-eslint' - ], - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint', 'notice'], - parserOptions: { - ecmaVersion: 2018, - sourceType: 'module', - ecmaFeatures: { - jsx: true - } - }, - rules: { - 'notice/notice': [ - 'error', - { - template: copyrightTemplate, - onNonMatchingHeader: 'replace' - } - ] - } -}; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9792a90 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: ci + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: 22 + cache: pnpm + - run: pnpm install --frozen-lockfile + - run: pnpm typecheck + - run: pnpm lint + - run: pnpm test + - run: pnpm build + - run: pnpm validate + - name: Build demo + working-directory: demo + run: pnpm build diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..17b295c --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,52 @@ +name: pages + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: 22 + cache: pnpm + - run: pnpm install --frozen-lockfile + - run: pnpm build + - name: Build demo + working-directory: demo + run: pnpm build + - name: Generate typedoc + run: pnpm gen:docs + - name: Stage typedoc under demo/dist/docs + run: cp -R docs demo/dist/docs + - uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0 + - uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 + with: + path: demo/dist + + deploy: + needs: build + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..fdbd76b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: release + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + publish: + runs-on: ubuntu-latest + environment: npm + permissions: + contents: read + id-token: write # npm provenance + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: 22 + cache: pnpm + registry-url: https://registry.npmjs.org + - run: pnpm install --frozen-lockfile + - run: pnpm typecheck + - run: pnpm test + - run: pnpm build + - run: pnpm validate + - run: pnpm publish --provenance --access public --no-git-checks diff --git a/.gitignore b/.gitignore index e6d416e..04fd153 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,11 @@ build release dist dist-debug +docs .cache-debug .cache-demo demo/.cache coverage +*.tgz +demo/monaco-declarations/*.d.ts +test-results diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..5ee7abd --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +pnpm exec lint-staged diff --git a/.pinact.yaml b/.pinact.yaml new file mode 100644 index 0000000..a57366d --- /dev/null +++ b/.pinact.yaml @@ -0,0 +1,5 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/suzuki-shunsuke/pinact/refs/heads/main/json-schema/pinact.json +# pinact - https://github.com/suzuki-shunsuke/pinact +version: 3 +min_age: + value: 7 diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..544138b --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + "singleQuote": true +} diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index bdf6f9a..0000000 --- a/.prettierrc.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - singleQuote: true -}; \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f6b0877..0000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: node_js -before_install: -- npm i -g npm@6.8 -cache: npm -node_js: -- '10' -script: -- npm run setup:ci -- npm run build -- npm test -- --coverage -- npm run predeploy:demo -deploy: - - provider: npm - email: kibysayshi@gmail.com - skip_cleanup: true - api_key: - secure: LFF+TBDO2lguN5rpciP09qUKWIoVVWA2arapTtX+zGMZHBa7QmDV+iBDZSLkf+5iJAgrgXsehIazXyQ7HKDad59y5kjJBOtQOqcSkENn1RTx10FHGvH/lrsO6FxLa5JD0r2cd9KdUjz2EC+4AlgrJo8wr6SKA2/cNOZ2gMVV/6cZVS/sPWfDx9Y1EDQwWlT+74G/vj4FFI+cuHQ2t28aywguaYdMQXPlORo0hXOde4JysewvO2mXcP9viMLg2qckEOeNo0ONDoQtJc4ZDJo7AmOqKmbf14sUQU04ejaw4RLveTe+ebkLYFKC72ABR0RN/VJIlUR78MZXTpJ9tM9A3iLRz1J4ca++3HQMcHQKOG+4P6lSk3bjyUg2pqrYLeUVzAoDIBABJUy0rbhiDMluKiPizO+Y9MmBf57d68+Ks+7ptDuVdYu6J01oyep0D2Mx25IlpgVOORMY05K1CbbWKNAdL8zn54SifqbCDVfDRgrMD0+iQC2D8gKMtOhap3OwtZWOEysUf5wwDz4cEzaeDcL5iOPwxKc6CpjyhdchJDxWozZTA+2wtSAUoddQ4c/iQM1FFQYQ5IugdVOA4/f66aWGftT0CzImT4jC1EHFF6QqAC5R5NAmpt6WaHDt3T/kmSIwXpDxnVq80nzK4t6k1VYjjQhum+IYMq1bx3g6DOM= - on: - tags: true - repo: spotify/NFPlayerJS - branch: master - - provider: pages - github-token: $GITHUB_TOKEN - skip_cleanup: true - keep-history: true - local-dir: demo/dist/ - on: - branch: master diff --git a/README.md b/README.md index 2e1c5ef..a227d50 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,18 @@
-
+