-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: setup github actions workflow, sematic release config, husky c…
…onfig, and test js file
- Loading branch information
Showing
13 changed files
with
3,566 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
run_install: false | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "pnpm" | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Authenticate with npm | ||
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | ||
|
||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
npx commitlint --edit "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
pnpm build | ||
node generate-exports.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"branches": ["main"], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/changelog", | ||
"@semantic-release/github", | ||
"@semantic-release/npm", | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": ["package.json", "CHANGELOG.md"], | ||
"message": "chore(release): ${nextRelease.version} [skip ci]" | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: ["@commitlint/config-conventional"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import fs from "fs"; | ||
import path from "path"; | ||
|
||
const distPath = "./dist"; | ||
|
||
const components = fs.readdirSync(distPath).filter((file) => { | ||
return fs.statSync(path.join(distPath, file)).isDirectory(); | ||
}); | ||
|
||
const exportsObject = { | ||
".": { | ||
import: "./dist/index.js", | ||
types: "./dist/types/index.d.ts", | ||
}, | ||
}; | ||
|
||
components.forEach((component) => { | ||
exportsObject[`./${component}`] = { | ||
import: `./dist/${component}/index.js`, | ||
types: `./dist/types/${component}/index.d.ts`, | ||
}; | ||
}); | ||
|
||
const packageJson = JSON.parse(fs.readFileSync("./package.json", "utf-8")); | ||
packageJson.exports = exportsObject; | ||
|
||
fs.writeFileSync("./package.json", JSON.stringify(packageJson, null, 2)); | ||
|
||
console.log("exports field generated and saved to package.json"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,45 @@ | ||
{ | ||
"name": "chingu-modules", | ||
"private": true, | ||
"name": "@chingu-x/modules", | ||
"description": "Module with all of the business logic in Chingu dashboard projects", | ||
"version": "0.0.0", | ||
"type": "module", | ||
"module": "dist/index.js", | ||
"types": "dist/types/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"license": "GPL-3.0", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"preview": "vite preview" | ||
"build": "vite build && tsc", | ||
"preview": "vite preview", | ||
"prepublishOnly": "pnpm build", | ||
"prepare": "husky install" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^19.6.1", | ||
"@commitlint/config-conventional": "^19.6.0", | ||
"@semantic-release/changelog": "^6.0.3", | ||
"@semantic-release/git": "^10.0.1", | ||
"@semantic-release/github": "^11.0.1", | ||
"@semantic-release/npm": "^12.0.1", | ||
"husky": "^9.1.7", | ||
"semantic-release": "^24.2.1", | ||
"typescript": "~5.6.2", | ||
"vite": "^6.0.5" | ||
}, | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.js", | ||
"types": "./dist/types/index.d.ts" | ||
}, | ||
"./test": { | ||
"import": "./dist/test/index.js", | ||
"types": "./dist/types/test/index.d.ts" | ||
}, | ||
"./types": { | ||
"import": "./dist/types/index.js", | ||
"types": "./dist/types/types/index.d.ts" | ||
} | ||
} | ||
} |
Oops, something went wrong.