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
20 changes: 20 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org/


- name: Ensure output folder exists
run: mkdir -p objects

Expand All @@ -32,6 +33,8 @@ jobs:
- name: Prepare npm package
run: |
cp package.template.json objects/package.json
cp tsconfig.template.json objects/tsconfig.json

cp README.md objects/ || true

node <<EOF
Expand Down Expand Up @@ -59,6 +62,23 @@ jobs:
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
EOF

- name: Install dependencies
working-directory: objects
run: npm install

- name: Check generated entry exists
run: test -f objects/index.ts

- name: Build package
working-directory: objects
run: npx tsup index.ts --format esm --dts --out-dir dist

- name: Verify build output
run: ls -R objects/dist

- name: Verify package.json exists
run: test -f objects/package.json

- name: Publish to npm
working-directory: objects
run: npm publish --access public --provenance
27 changes: 27 additions & 0 deletions package.template.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
{
"name": "@solid-data/models",
"version": "0.0.0",
"type": "module",

"repository": {
"type": "git",
"url": "https://github.com/solid/shapes"
},

"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.mts",

"exports": {
".": {
"import": "./dist/index.mjs",
"types": "./dist/index.d.mts"
}
},

"files": ["dist"],

"dependencies": {
"@rdfjs/wrapper": "0.34.0"
},

"devDependencies": {
"tsup": "^8",
"typescript": "^5"
},
"engines": {
"node": ">=24"
}
}
24 changes: 24 additions & 0 deletions tsconfig.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"target": "es2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"allowJs": true,
"sourceMap": true,
"outDir": "./dist",
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"declaration": true,
"declarationMap": true
}}