From a8810f07d893312ab5154f8bcdaa71c74c41c9a2 Mon Sep 17 00:00:00 2001 From: Kishan Jadav Date: Tue, 6 Feb 2024 13:05:40 +0000 Subject: [PATCH] NPM --- .github/workflows/ci.yml | 13 ++++++++++++ .github/workflows/publish.yml | 30 ++++++++++++++++++++++++++++ .github/workflows/release-please.yml | 13 ------------ .npmrc | 1 + package-lock.json | 6 +++--- package.json | 20 ++++++++----------- scss/texmo-react-components.scss | 2 +- 7 files changed, 56 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/release-please.yml create mode 100644 .npmrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..39a2154 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,13 @@ +name: CI +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20.x + - run: npm ci + - run: npm run build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..23b8eb1 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,30 @@ +name: Publish +on: + release: + types: [published] + workflow_run: + branches: [main] + types: [completed] + +jobs: + publish: + name: "Publish NPM package to GitHub Packages" + runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20.x + registry-url: 'https://npm.pkg.github.com' + scope: '@the-curve-consulting' + - run: npm ci + - run: npm build + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index 87018df..0000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,13 +0,0 @@ -on: - push: - branches: - - main -name: release-please -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - with: - release-type: node - package-name: texmo-react-components diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..e15cf1e --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +@the-curve-consulting:registry=https://npm.pkg.github.com diff --git a/package-lock.json b/package-lock.json index 1a5334d..7b5ee67 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "texmo-react-components", + "name": "@the-curve-consulting/texmo-react-components", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "texmo-react-components", + "name": "@the-curve-consulting/texmo-react-components", "version": "0.1.0", "license": "MIT", "dependencies": { @@ -62,7 +62,7 @@ "typescript": "^5.0.4" }, "engines": { - "node": ">=16" + "node": ">=18" }, "peerDependencies": { "react": ">=18", diff --git a/package.json b/package.json index 39f0fca..32f28db 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,10 @@ { - "name": "texmo-react-components", + "name": "@the-curve-consulting/texmo-react-components", + "repository": { + "type": "git", + "url": "https://github.com/the-curve-consulting/texmo-react-components.git" + }, "version": "0.1.0", - "keywords": [], "description": "", "main": "dist/index.min.js", "module": "dist/index.es.js", @@ -9,26 +12,19 @@ "files": [ "dist" ], - "repository": { - "url": "", - "type": "git" - }, - "homepage": "", + "homepage": "https://github.com/the-curve-consulting/texmo-react-components", "license": "MIT", - "private": true, + "private": false, "scripts": { "start": "rollup -c rollup.config.js -w", "build": "tsc && rollup -c rollup.config.js", - "coverage": "codecov -e TRAVIS_NODE_VERSION -f coverage/*.json", "test": "jest --coverage", "test:watch": "jest --coverage --watch", "test:ci": "cross-env CI=1 jest", - "predeploy": "cd example && npm install && npm run build", - "deploy": "gh-pages -d example/build", "prepare": "husky install" }, "engines": { - "node": ">=16" + "node": ">=18" }, "peerDependencies": { "react": ">=18", diff --git a/scss/texmo-react-components.scss b/scss/texmo-react-components.scss index 01e966a..ee69094 100644 --- a/scss/texmo-react-components.scss +++ b/scss/texmo-react-components.scss @@ -9,4 +9,4 @@ @import '../src/components/button/Button.scss'; @import '../src/components/title/Title.scss'; @import '../src/components/card/Card.scss'; -@import '../src/components/form/components/FormRichText.scss'; \ No newline at end of file +@import '../src/components/form/components/FormRichText.scss';