Skip to content

Commit 87b4a2e

Browse files
author
Ryan A. Johnson
committed
refactor(pipeline): reorganize and add minification
* added @webcomponents/webcomponentsjs as production dependency * moved nunjucks libs to docs/_nunjucks * they only pertain to documentation * cleaned up/refactored _config.js to place relevant configs directly into the scripts that need them * reorganized assets in dist/ to match most open source projects * dist/scripts/* * dist/styles/* * removed sourcemap generation * It is impossible to generate correct sourceMapURL that will work for every application. * The only way to make it work is with inline sourcemaps, but the amount of content this strategy adds counteracts the benefits of minification (results in file sizes larger than unminified). * documentation only uses unminified assets * boilerplate layouts use minified assets (when possible) * modified the generated `docs.css` header * fixed active nav link bug with `<hx-menu>` (tl;dr - trailing space in data)
1 parent 671c052 commit 87b4a2e

31 files changed

+399
-396
lines changed

README.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,3 @@
66
0. [install test dependencies](https://github.com/rackerlabs/helix-ui/wiki/Testing#system-requirements)
77
0. `yarn install` to install project dependencies
88
0. `yarn start` to begin working
9-
10-
11-
### Key Files/Directories
12-
Path | Ship? | Notes
13-
----- | ----- | -----
14-
`source/bootstrap.helix.less` | Yes | Helix theme of Bootstrap 3
15-
`source/components/` | No | Source files for components and their documentation
16-
`source/docs.js` | No | Documentation functionality
17-
`source/docs.less` | No | Documentation styles
18-
`source/helix-ui.js` | Yes | HelixUI behaviors (including web component definitions)
19-
`source/helix-ui.less` | Yes | HelixUI styles
20-
`public/` | No | Generated output
21-
`source/_templates` | No | Component explorer layout templates
22-
23-
Changes within `source/_templates` or `source/_data` will require
24-
restarting the development server.
25-
26-
27-
## Publish Documentation
28-
```
29-
yarn run publish
30-
```

_config.js

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ CONFIG.root = path.resolve(__dirname);// absolute path to project directory
99
CONFIG.publicDir = 'public';
1010
CONFIG.sourceDir = 'src';
1111
CONFIG.docsDir = 'docs';
12-
CONFIG.templateDir = `${CONFIG.docsDir}/_templates`;
1312
CONFIG.testDir = 'test';
13+
CONFIG.distDir = 'dist';
1414

1515
// Component Explorer configuration
1616
// Used directly for "site" rendering context
@@ -30,43 +30,6 @@ CONFIG.less = {
3030
`${CONFIG.docsDir}/styles`,
3131
`${CONFIG.sourceDir}/helix-ui/styles`
3232
],
33-
// [src, dest]
34-
files: [
35-
[ `${CONFIG.sourceDir}/helix-ui.less`, 'dist/helix-ui.css' ],
36-
[ `${CONFIG.docsDir}/docs.less`, 'public/docs.css' ],
37-
],
38-
};
39-
40-
// TODO: move to lib/webpack.js
41-
// Configuration for the webpack build tool
42-
CONFIG.webpack = {
43-
entry: `${CONFIG.root}/${CONFIG.docsDir}/docs.js`,
44-
output: {
45-
path: path.resolve(__dirname, 'public'),
46-
filename: 'docs.js',
47-
}
48-
};
49-
50-
// Configuration for generating static documentation
51-
CONFIG.docs = {
52-
files: [
53-
'*.html',
54-
'**/*.html',
55-
],
56-
// settings for deployment to github pages
57-
ghPages: {
58-
type: 'git',
59-
repo: '[email protected]:rackerlabs/helix-ui.git',
60-
branch: 'gh-pages',
61-
message: `Docs Updated: {{ now('YYYY-MM-DD HH:mm:ss') }}`,
62-
url: 'https://rackerlabs.github.io/helix-ui'
63-
}
64-
};
65-
66-
// Files and directories to copy to publicDir
67-
// All paths are relative to {CONFIG.sourceDir}
68-
CONFIG.copy = {
69-
dirs: [ 'images' ]
7033
};
7134

7235
/* Define Exports */

bin/build.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

bin/clean.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

bin/cleanPublic.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
const CONFIG = require('../_config');
5+
const { remove } = require('fs-extra');
6+
7+
(async function () {
8+
await remove(CONFIG.publicDir);
9+
})();

bin/compile.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
const { compileAll } = require('../lib/compile');
5+
6+
(function () {
7+
compileAll();
8+
})();

bin/copy.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

bin/generate.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
const { generateAll } = require('../lib/generate');
5+
const { copyDocs, copyDist } = require('../lib/copy');
6+
7+
(function () {
8+
copyDist();
9+
copyDocs();
10+
generateAll();
11+
})();

bin/ghpages.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
const { publishDocs } = require('../lib/publish');
5+
6+
(async function () {
7+
await publishDocs();
8+
})();

bin/publish.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)