Skip to content

Commit

Permalink
Fix packaging.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrstegeman committed Feb 11, 2021
1 parent 8f6362b commit d843d69
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ jobs:
- name: Build project
run: |
npm ci
npm run lint
npm run build
env:
CI: true
CI: 'true'

- name: Publish to npm
run: npm publish
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ npm-debug.log
src/message-type.ts
src/plugin-register-response.d.ts
src/schema.ts
src/version.ts
4 changes: 4 additions & 0 deletions generate-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const fs = require('fs');
const pkg = require('./package.json');

fs.writeFileSync('./src/version.ts', `export default '${pkg.version}';\n`);
2 changes: 1 addition & 1 deletion package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "gateway-addon",
"version": "1.1.0-alpha.1",
"version": "1.1.0-alpha.2",
"description": "Bindings for WebThings Gateway add-ons",
"scripts": {
"build": "if [ ! -d schema/messages ]; then git submodule init; fi; git submodule update && node generate-types.js && tsc -p .",
"build": "if [ ! -d schema/messages ]; then git submodule init; fi; git submodule update && node generate-version.js && node generate-types.js && tsc -p .",
"lint": "eslint src --ext .ts",
"prettier": "npx prettier -w '*.js' 'src/*.ts'"
},
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { Outlet } from './outlet';
import { PluginClient } from './plugin-client';
import { Property } from './property';
import * as Utils from './utils';
import pkg from './package.json';
import version from './version';

export {
Action,
Expand All @@ -45,5 +45,5 @@ export {
};

export function getVersion(): string {
return pkg.version;
return version;
}
1 change: 0 additions & 1 deletion src/package.json

This file was deleted.

0 comments on commit d843d69

Please sign in to comment.