Skip to content

Commit 8f3efdc

Browse files
authored
Merge pull request #39 from eapearson/master
npm dep updates, new dist.tgz build
2 parents a059490 + 9db1bc3 commit 8f3efdc

File tree

271 files changed

+1029
-38986
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

271 files changed

+1029
-38986
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/nbproject/
21
.DS_Store
32
node_modules/
43
bower_components/
5-
4+
/dist/

build/Gruntfile.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ module.exports = function (grunt) {
55
grunt.initConfig({
66
pkg: grunt.file.readJSON('package.json'),
77
copy: {
8-
// 'pure-uuid': {
9-
// expand: true,
10-
// flatten: true,
11-
// src: 'node_modules/pure-uuid/uuid.js',
12-
// dest: '../src/plugin/iframe_root/modules/vendor/pure-uuid'
13-
// }
8+
'nunjucks': {
9+
expand: true,
10+
flatten: true,
11+
src: 'node_modules/nunjucks/browser/nunjucks.js',
12+
dest: '../src/plugin/iframe_root/modules/vendor/nunjucks'
13+
}
1414
},
1515
clean: {
1616
options: {

build/README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ By hand:
88

99
```
1010
cd build
11+
yarn install
1112
yarn clean
1213
yarn install
1314
yarn install-bower
@@ -16,10 +17,24 @@ yarn remove-source-maps
1617
yarn install-dist
1718
```
1819

20+
or
21+
22+
```zsh
23+
yarn install && yarn clean && yarn install && yarn install-bower && yarn install-npm &&yarn remove-source-maps && yarn install-dist
24+
```
25+
26+
or
27+
28+
```zsh
29+
bash scripts/build.sh
30+
```
31+
32+
(or your choice of shell - it is a very simple shell script without any special binding to a shell.)
33+
1934
> Only use yarn clean if you want to clean out the stuff installed in vendor, as well as the node and bower packages installed in build.
2035
2136
## Preparing for a new release
2237

23-
This plugin provides itself in the `dist` directory. In order to ensure that the dist directory is up-to-date with the source, run `yarn install-dist`.
38+
This plugin provides itself in the `dist.tgz` archive file, which is built via the temporary top level `dist` directory. In order to ensure that the dist directory is up-to-date with the source, run `yarn install-dist`.
2439

25-
You can iterate on the raw source locally with `kbase-ui` by removing the dist directory temporarily, and supplying the plugin via the `plugins` option to kbase-ui's `make dev-start` task. kbase-ui will detect the absence of a dist directory and use the src directory instead.
40+
You can iterate on the raw source locally with `kbase-ui` by removing the dist directory, if it exists, and supplying the plugin via the `plugins` option to kbase-ui's `make dev-start` task. kbase-ui will map the internal plugin directory to the `src/plugin` directory within this repo.

build/bower.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"requirejs-text": "2.0.16",
5252
"requirejs-yaml": "eapearson/requirejs-yaml#1.0.5",
5353
"kbase-service-clients-js": "3.3.6",
54-
"nunjucks": "3.1.2",
5554
"pure-uuid": "1.5.8",
5655
"spark-md5": "3.0.0",
5756
"font-awesome": "4.7.0",

build/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
"grunt-contrib-copy": "1.0.0",
2323
"js-yaml": "3.13.1",
2424
"numeral": "2.0.6",
25-
"terser": "4.4.3"
25+
"nunjucks": "3.2.0",
26+
"tar": "5.0.5",
27+
"terser": "4.6.2"
2628
}
27-
}
29+
}

build/scripts/build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
yarn install
2+
yarn clean
3+
yarn install
4+
yarn install-bower
5+
yarn install-npm
6+
yarn remove-source-maps
7+
yarn install-dist

build/scripts/install-dist.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
/*eslint-env node */
2+
/*eslint strict: ["error", "global"] */
3+
'use strict';
14
const bluebird = require('bluebird');
25
const glob = bluebird.promisify(require('glob').Glob);
36
const fs = bluebird.promisifyAll(require('fs-extra'));
47
const Terser = require('terser');
58
const path = require('path');
9+
const tar = require('tar');
610

711
async function copyFiles(rootDir) {
812
const root = rootDir.split('/');
@@ -61,6 +65,20 @@ async function minify(rootDir) {
6165
);
6266
}
6367

68+
async function taritup(rootDir) {
69+
const dir = 'dist';
70+
const dest = rootDir.concat(['dist.tgz']).join('/');
71+
console.log('tarring from ' + dir + ', to ' + dest);
72+
return tar.c({
73+
gzip: true,
74+
file: dest,
75+
portable: true,
76+
cwd: rootDir.join('/')
77+
}, [
78+
dir
79+
]);
80+
}
81+
6482
async function main() {
6583
const cwd = process.cwd().split('/');
6684
cwd.push('..');
@@ -70,6 +88,12 @@ async function main() {
7088
await copyFiles(projectPath);
7189
console.log('Minifying dist...');
7290
await minify(projectPath);
91+
console.log('tar-ing dist...');
92+
try {
93+
await taritup(projectPath.split('/'));
94+
} catch (ex) {
95+
console.error('Error tarring up dist! ' + ex.message);
96+
}
7397
console.log('done');
7498
}
7599

0 commit comments

Comments
 (0)