Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,8 @@ jobs:
if: github.event_name == 'push'
run: npx commitlint --last --verbose

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

lint:
needs: commitlint
runs-on: ubuntu-latest

steps:
Expand All @@ -70,6 +67,7 @@ jobs:
run: npm run lint

test:
needs: lint
runs-on: ubuntu-latest

steps:
Expand All @@ -92,3 +90,33 @@ jobs:

- name: Run test suites
run: npm run test

build:
needs: test
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4

- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: 22.12.0

- name: Cache npm dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build
path: dist
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
node_modules/
dist/
163 changes: 163 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"prepare": "husky",
"lint": "eslint .",
"format": "prettier --write .",
"commit": "commit"
"commit": "commit",
"build": "rollup -c"
},
"keywords": [
"workshop",
Expand All @@ -28,11 +29,13 @@
"@commitlint/config-conventional": "^19.6.0",
"@commitlint/prompt-cli": "^19.7.0",
"@eslint/js": "^9.18.0",
"@rollup/plugin-terser": "^0.4.4",
"eslint": "^9.18.0",
"globals": "^15.14.0",
"husky": "^9.1.7",
"lint-staged": "^15.3.0",
"prettier": "^3.4.2",
"rollup": "^4.30.1",
"vitest": "^2.1.8"
},
"lint-staged": {
Expand All @@ -41,4 +44,4 @@
"prettier --write"
]
}
}
}
11 changes: 11 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import terser from "@rollup/plugin-terser";

export default {
input: "src/mathy.js",
output: {
name: "mathy",
file: "dist/bundle.js",
format: "umd",
plugins: [terser()]
}
};
1 change: 1 addition & 0 deletions src/mathy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { add } from "./add.js";
Loading