Skip to content

Commit dff9174

Browse files
committed
support generating a release using "npm pack"
1 parent cf500dc commit dff9174

3 files changed

Lines changed: 31 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ lerna-debug.log*
88

99
**/.idea
1010
.idea
11+
**.lke
1112

1213
# Diagnostic reports (https://nodejs.org/api/report.html)
1314
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

data-table/package.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
{
22
"name": "data-table",
33
"version": "0.2.1",
4-
"description": "Data Table Plugin for Linkurious Enterprise",
4+
"description": "Data-table plugin for Linkurious Enterprise",
5+
56
"main": "index.js",
67
"scripts": {
7-
"build": "mkdir -p ../builds && npm install && tar -c . > ../builds/data-table.lke"
8+
"postpack": "scripts/bundle.js"
89
},
910
"author": "Linkurious",
10-
"license": "ISC",
11+
"license": "Apache 2",
12+
"files": [
13+
"manifest.json",
14+
"public",
15+
"backend",
16+
],
17+
"bundledDependencies": [
18+
"body-parser"
19+
],
1120
"dependencies": {
12-
"body-parser": "^1.19.0"
21+
"body-parser": "1.19.0"
1322
}
1423
}

data-table/scripts/bundle.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env node
2+
3+
'use strict';
4+
5+
const { spawnSync } = require( 'child_process' );
6+
7+
const pack = require(__dirname + '/../package.json');
8+
9+
const name = pack.name + '-' + pack.version;
10+
11+
const gunzip = spawnSync('gunzip', [name + '.tgz']);
12+
console.log('gunzip:' + gunzip.stdout.toString() + ' / ' + gunzip.stderr.toString());
13+
14+
const mv = spawnSync( 'mv', [name + '.tar', name + '.lke']);
15+
console.log('mv:' + mv.stdout.toString() + ' / ' + mv.stderr.toString());
16+
17+

0 commit comments

Comments
 (0)