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
1 change: 1 addition & 0 deletions .github/workflows/node.install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ jobs:
- run: npm audit ----audit-level critical
- run: npm run all-checks
- run: npm run test
- run: npm run generate-version
- run: npm run rollup
1 change: 1 addition & 0 deletions .github/workflows/npm-publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ jobs:
node-version: 24
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm run generate-version
Comment thread
adedamola-sode marked this conversation as resolved.
- run: npm run rollup
- run: npm publish --access public
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
"description": "Control system web library",
"main": "./dist/index.cjs",
"scripts": {
"generate-version": "node scripts/generate-version.js",
"rollup": "rollup -c",
"test": "vitest",
"lint": "eslint 'src/**/*.{ts,tsx}' --max-warnings=0",
"lint:fix": "eslint 'src/**/*.{ts,tsx}' --max-warnings=0 --fix",
"prettier-check": "prettier --check 'src/**/*.{ts,tsx}'",
"prettier-write": "prettier --write 'src/**/*.{ts,tsx}'",
"check-types": "tsc",
"all-checks": "npm run lint && npm run prettier-check && npm run check-types"
"all-checks": "npm run generate-version && npm run lint && npm run prettier-check && npm run check-types"
},
"author": "Will Rogers, Rebecca Williams, Abigail Alexander, Tom Kane, Gregory Harris",
"license": "ISC",
Expand Down
10 changes: 10 additions & 0 deletions scripts/generate-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import fs from "fs";
import path from "path";
import pkg from "../package.json" with { type: "json" };

const content = `export const CS_WEB_LIB_VERSION = "${pkg.version}";
`;

fs.writeFileSync(path.resolve("src/version.ts"), content);

console.log(`Generated src/version.ts (${pkg.version})`);
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export * from "./ui/widgets";
export * from "./ui/hooks";
export * from "./types";
export { contextRender } from "./testResources";
export * from "./version";
Loading