Skip to content

Commit 09810c7

Browse files
committed
complete organisation refactor v0.2.4
1 parent 14189c5 commit 09810c7

Some content is hidden

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

55 files changed

+6863
-1237
lines changed

.gitignore

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,8 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
6-
# Runtime data
7-
pids
8-
*.pid
9-
*.seed
10-
11-
# Directory for instrumented libs generated by jscoverage/JSCover
12-
lib-cov
13-
14-
# Coverage directory used by tools like istanbul
15-
coverage
16-
17-
# nyc test coverage
18-
.nyc_output
19-
20-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21-
.grunt
1+
$ cat .gitignore
2+
/node_modules
3+
/dist
4+
/documentation
5+
/coverage
226

23-
# node-waf configuration
24-
.lock-wscript
25-
26-
# Compiled binary addons (http://nodejs.org/api/addons.html)
27-
build/Release
28-
29-
# Dependency directories
30-
node_modules
31-
jspm_packages
32-
33-
# Optional npm cache directory
34-
.npm
35-
36-
# Optional REPL history
37-
.node_repl_history
38-
39-
.vscode
7+
*.log
8+
*.tgz

.travis.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
sudo: required
2+
dist: trusty
3+
addons:
4+
apt:
5+
sources:
6+
- google-chrome
7+
packages:
8+
- google-chrome-stable
9+
language: node_js
10+
node_js:
11+
- "8"
12+
before_install:
13+
- npm i npm@^4 -g
14+
install:
15+
- npm install
16+
script:
17+
- npm test
18+
- npm run build
19+
before_script:
20+
- export DISPLAY=:99.0
21+
- sh -e /etc/init.d/xvfb start
22+
- sleep 3
23+
notifications:
24+
email: false

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11

2+
<a name="0.2.4"></a>
3+
# 0.2.4 (2017-11-06)
4+
5+
### Angular 5.0.0 minimum in peerDependencies.
6+
7+
* **New files organisation:** Complete reorganisation of the github repository and files published on npm forked from this [library starter](https://github.com/robisim74/angular-library-starter).
8+
* **New bundles generation:** Now you have umd bundles, flat ES module, and ES2015 flat ESM format.
9+
* **Add tests:** This is what motivated me to change organisation, I will add others one soon `npm test`.
10+
11+
212
<a name="0.2.3"></a>
313
# 0.2.3 (2017-11-02)
414

LICENSE.txt renamed to LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,4 @@
198198
distributed under the License is distributed on an "AS IS" BASIS,
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201-
limitations under the License.
201+
limitations under the License.

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# angular-split
2-
Angular (2+) UI library to split views using CSS flexbox layout.
3-
4-
[![npm version](https://badge.fury.io/js/angular-split.svg)](https://badge.fury.io/js/angular-split)
5-
6-
Documentation and examples:
7-
[https://bertrandg.github.io/angular-split/](https://bertrandg.github.io/angular-split/)
1+
# angular-split
2+
Angular (2+) UI library to split views using CSS flexbox layout.
3+
4+
[![npm version](https://badge.fury.io/js/angular-split.svg)](https://badge.fury.io/js/angular-split)
5+
6+
Documentation and examples:
7+
[https://bertrandg.github.io/angular-split/](https://bertrandg.github.io/angular-split/)

angular-split.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './public_api';

build.js

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
"use strict";
2+
3+
const shell = require('shelljs');
4+
const chalk = require('chalk');
5+
6+
const PACKAGE = `angular-split`;
7+
const NPM_DIR = `dist`;
8+
const ESM2015_DIR = `${NPM_DIR}/esm2015`;
9+
const ESM5_DIR = `${NPM_DIR}/esm5`;
10+
const BUNDLES_DIR = `${NPM_DIR}/bundles`;
11+
const OUT_DIR_ESM5 = `${NPM_DIR}/package/esm5`;
12+
13+
shell.echo(`Start building...`);
14+
15+
shell.rm(`-Rf`, `${NPM_DIR}/*`);
16+
shell.mkdir(`-p`, `./${ESM2015_DIR}`);
17+
shell.mkdir(`-p`, `./${ESM5_DIR}`);
18+
shell.mkdir(`-p`, `./${BUNDLES_DIR}`);
19+
20+
/* TSLint with Codelyzer */
21+
// https://github.com/palantir/tslint/blob/master/src/configs/recommended.ts
22+
// https://github.com/mgechev/codelyzer
23+
shell.echo(`Start TSLint`);
24+
shell.exec(`tslint -c tslint.json -t stylish src/**/*.ts`);
25+
shell.echo(chalk.green(`TSLint completed`));
26+
27+
/* AoT compilation */
28+
shell.echo(`Start AoT compilation`);
29+
if (shell.exec(`ngc -p tsconfig-build.json`).code !== 0) {
30+
shell.echo(chalk.red(`Error: AoT compilation failed`));
31+
shell.exit(1);
32+
}
33+
shell.echo(chalk.green(`AoT compilation completed`));
34+
35+
/* BUNDLING PACKAGE */
36+
shell.echo(`Start bundling`);
37+
shell.echo(`Rollup package`);
38+
if (shell.exec(`rollup -c rollup.es.config.js -i ${NPM_DIR}/${PACKAGE}.js -o ${ESM2015_DIR}/${PACKAGE}.js`).code !== 0) {
39+
shell.echo(chalk.red(`Error: Rollup package failed`));
40+
shell.exit(1);
41+
}
42+
43+
shell.echo(`Produce ESM5 version`);
44+
shell.exec(`ngc -p tsconfig-build.json --target es5 -d false --outDir ${OUT_DIR_ESM5} --importHelpers true --sourceMap`);
45+
if (shell.exec(`rollup -c rollup.es.config.js -i ${OUT_DIR_ESM5}/${PACKAGE}.js -o ${ESM5_DIR}/${PACKAGE}.js`).code !== 0) {
46+
shell.echo(chalk.red(`Error: ESM5 version failed`));
47+
shell.exit(1);
48+
}
49+
50+
shell.echo(`Run Rollup conversion on package`);
51+
if (shell.exec(`rollup -c rollup.config.js -i ${ESM5_DIR}/${PACKAGE}.js -o ${BUNDLES_DIR}/${PACKAGE}.umd.js`).code !== 0) {
52+
shell.echo(chalk.red(`Error: Rollup conversion failed`));
53+
shell.exit(1);
54+
}
55+
56+
shell.echo(`Minifying`);
57+
shell.cd(`${BUNDLES_DIR}`);
58+
shell.exec(`uglifyjs ${PACKAGE}.umd.js -c --comments -o ${PACKAGE}.umd.min.js --source-map "filename='${PACKAGE}.umd.min.js.map', includeSources"`);
59+
shell.cd(`..`);
60+
shell.cd(`..`);
61+
62+
shell.echo(chalk.green(`Bundling completed`));
63+
64+
shell.rm(`-Rf`, `${NPM_DIR}/package`);
65+
shell.rm(`-Rf`, `${NPM_DIR}/node_modules`);
66+
shell.rm(`-Rf`, `${NPM_DIR}/*.js`);
67+
shell.rm(`-Rf`, `${NPM_DIR}/*.js.map`);
68+
shell.rm(`-Rf`, `${NPM_DIR}/src/**/*.js`);
69+
shell.rm(`-Rf`, `${NPM_DIR}/src/**/*.js.map`);
70+
71+
shell.cp(`-Rf`, [`package.json`, `LICENSE`, `README.md`], `${NPM_DIR}`);
72+
73+
shell.echo(chalk.green(`End building`));

dist/angularSplit.module.d.ts

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

dist/angularSplit.module.js

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

dist/angularSplit.module.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)