Skip to content

Commit

Permalink
Emit types on build
Browse files Browse the repository at this point in the history
  • Loading branch information
rphillips-cc committed Jun 24, 2024
1 parent 678e38f commit 42becf6
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 8 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release

on:
push:
paths:
- 'package.json'
branches:
- 'main'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 18
registry-url: https://npm.pkg.github.com/
- run: npm install
- run: npm run build
- run: npm test
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
registry: https://npm.pkg.github.com/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist/
node_modules/
coverage/
.eslintcache
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cloudcannon/gadget",
"type": "module",
"version": "0.0.0",
"version": "0.0.1",
"description": "Inpects a list of files to create configuration for the CloudCannon CMS.",
"keywords": [
"static site generator",
Expand All @@ -12,25 +12,29 @@
"type": "git",
"url": "https://github.com/CloudCannon/gadget.git"
},

"bugs": {
"url": "https://github.com/CloudCannon/gadget/issues",
"email": "[email protected]"
},
"main": "index.js",
"types": "src/types.d.ts",
"files": [
"src/**/*.js",
"src/**/*.d.ts"
"src/**/*.d.ts",
"dist/**/*.d.ts"
],
"bin": {
"cloudcannon-gadget": "src/cli.js"
},
"scripts": {
"build": "tsc --emitDeclarationOnly",
"test": "ava",
"test:watch": "ava --watch --verbose",
"test:coverage": "c8 --all --src src ava",
"lint": "npm run lint:eslint && npm run lint:tsc && npm run lint:format",
"lint:eslint": "eslint src",
"lint:tsc": "tsc",
"lint:tsc": "tsc --noEmit",
"lint:format": "npx prettier . -c",
"fix:format": "npx prettier . -w"
},
Expand Down
2 changes: 1 addition & 1 deletion test/icons.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { findIcon } from '../src/icons.js';

test('finds an icon', (t) => {
t.is(findIcon('motels'), 'hotel');
t.is(findIcon('authors'), 'anchor');
t.is(findIcon('dragons'), 'diamond');
});

test('finds an icon by override', (t) => {
Expand Down
10 changes: 6 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"compilerOptions": {
"target": "ES6",
"skipLibCheck": true,
"moduleResolution": "bundler",
"moduleResolution": "Bundler",
"lib": ["ES6", "DOM"],
"isolatedModules": true,
"noEmit": true,
"declaration": true,
"outDir": "dist",
"checkJs": true,
"allowJs": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"]
"include": ["src"],
"exclude": ["src/cli.js"]
}

0 comments on commit 42becf6

Please sign in to comment.