Skip to content

Commit

Permalink
chore(ci): update GitHub Actions workflow to use npm install instead …
Browse files Browse the repository at this point in the history
…of npm ci for better compatibility

chore(ci): remove clean dependencies step to streamline the installation process
feat(package.json): enhance build script to include source files and generate type definitions
fix(package.json): update prepublishOnly script to run tests before publishing
feat(package.json): add postinstall script to build the package after installation
chore(package.json): include additional files in the package for better distribution
  • Loading branch information
alisaitteke committed Nov 23, 2024
1 parent dc78524 commit 966443e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
# Clean install to fix rollup issue
- name: Clean dependencies
run: |
rm -rf node_modules package-lock.json

# Önce normal install yapılır
- name: Install dependencies
run: npm ci
run: npm install

- name: Generate package-lock.json
run: npm install --package-lock-only

- run: npm run typecheck
- run: npm run lint
- run: npm run build
Expand All @@ -32,18 +35,15 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://npm.pkg.github.com
cache: 'npm'

- name: Clean dependencies
run: |
rm -rf node_modules package-lock.json
- name: Install dependencies
run: npm ci
run: npm install

- name: Build package
run: npm run build
Expand Down Expand Up @@ -73,18 +73,15 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
cache: 'npm'

- name: Clean dependencies
run: |
rm -rf node_modules package-lock.json
- name: Install dependencies
run: npm ci
run: npm install

- name: Build package
run: npm run build
Expand Down
15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@
},
"scripts": {
"clean": "rimraf dist",
"build": "tsup",
"dev": "tsup --watch",
"prebuild": "npm run clean",
"build": "tsup src/index.ts --format cjs,esm --dts",
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
"test": "vitest",
"coverage": "vitest run --coverage",
"lint": "eslint src/**/*.ts",
"format": "prettier --write src/",
"typecheck": "tsc --noEmit",
"prepare": "npm run build",
"prepublishOnly": "npm run lint"
"prepublishOnly": "npm test && npm run lint",
"postinstall": "npm run build"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -63,7 +65,12 @@
"node": ">=18"
},
"files": [
"dist/**/*"
"dist/**/*",
"src/**/*",
"package.json",
"package-lock.json",
"README.md",
"LICENSE"
],
"publishConfig": {
"access": "public"
Expand Down

0 comments on commit 966443e

Please sign in to comment.