Skip to content

Commit fb512cb

Browse files
authoredMar 26, 2019
fix(build): refactor deploy and update package.jsons (#223)
* fix(build): refactor deploy and update package.jsons * add build-demos to try and stay within netlifys time limit * have netlify build-all-demos instead of build-all
1 parent 55e8a4d commit fb512cb

File tree

11 files changed

+64
-84
lines changed

11 files changed

+64
-84
lines changed
 

‎.travis.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@ dist: trusty
22
language: node_js
33
node_js:
44
- '8'
5-
# addons:
6-
# chrome: stable
7-
# before_install:
8-
# - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
95
before_install: .travis/before_install.sh
106
install:
117
- npm install
12-
after_success: .travis/after_success.sh
13-
# script: lerna run lint && lerna run test
8+
after_success: "npm run build-all"
149
script: lerna run lint
1510
sudo: false
1611
deploy:
12+
-
13+
provider: script
14+
script: "bash ./scripts/deploy.sh"
15+
skip_cleanup: true
16+
true:
17+
branch: master
1718
-
1819
allow-empty-commit: true
1920
email: carbon@us.ibm.com

‎.travis/after_success.sh

-37
This file was deleted.

‎.travis/before_install.sh

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
#!/bin/bash
2-
set -e
3-
#!/bin/bash
1+
#!/usr/bin/env bash
42

5-
# Note: do not do set -x or the passwords will leak!
3+
set -e
64

7-
# @angular/cli should be removed when the angular dmeo project has been removed
8-
npm install -g lerna@3.2.1 @storybook/cli @angular/cli rollup@0.67.3
5+
npm install -g lerna@3.2.1

‎package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
"license": "Apache-2.0",
1313
"scripts": {
1414
"postinstall": "lerna bootstrap --hoist --no-ci",
15-
"clean": "lerna clean",
15+
"clean": "lerna clean && lerna run clean && rm -rf node_modules",
1616
"commit": "git-cz",
1717
"test": "lerna run test",
1818
"lint": "lerna run lint",
1919
"contributors:add": "all-contributors add",
2020
"contributors:generate": "all-contributors generate",
21-
"build-all": "bash scripts/build-packages-and-demos.sh"
21+
"build-all": "bash scripts/build-packages-and-demos.sh",
22+
"build-all-demos": "bash scripts/build-demos.sh"
2223
},
2324
"husky": {
2425
"hooks": {

‎packages/angular/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"scripts": {
88
"build": "ng-packagr -p package.json",
99
"storybook": "start-storybook -p 9005 -c .storybook -s ./.storybook/assets",
10-
"demo:build": "build-storybook -o demo/bundle/angular"
10+
"demo:build": "build-storybook -o demo/bundle/angular",
11+
"clean": "rm -rf dist demo/bundle"
1112
},
1213
"repository": {
1314
"type": "git",
@@ -36,7 +37,7 @@
3637
"@angular/platform-browser": "6.1.0",
3738
"@angular/platform-browser-dynamic": "6.1.0",
3839
"@babel/core": "7.3.4",
39-
"@storybook/angular": "5.0.3",
40+
"@storybook/angular": "5.0.5",
4041
"@types/node": "8.5.2",
4142
"babel-loader": "8.0.5",
4243
"core-js": "2.6.5",

‎packages/core/package.json

+2-7
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
"name": "@carbon/charts",
33
"version": "0.11.4",
44
"description": "Carbon charting components",
5-
"files": [
6-
"dist",
7-
"index.js",
8-
"CHANGELOG.md",
9-
"README.md"
10-
],
115
"scripts": {
126
"demo:server": "webpack-dev-server --config webpack.config.js --watch",
137
"demo:build": "webpack --config webpack.config.js && typedoc --out ./demo/bundle/documentation ./src/index.ts",
@@ -16,7 +10,8 @@
1610
"bundle:analyzer": "rm -rf dist && webpack --config webpack.build.js --env.bundleAnalyzer",
1711
"lint": "tslint -p tsconfig.json -c tslint.json",
1812
"test": "karma start --single-run",
19-
"test:watch": "karma start --no-single-run"
13+
"test:watch": "karma start --no-single-run",
14+
"clean": "rm -rf dist demo/bundle"
2015
},
2116
"repository": {
2217
"type": "git",

‎packages/react/package.json

+5-10
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@
33
"version": "0.11.4",
44
"description": "Carbon charting components for React",
55
"main": "index.js",
6-
"files": [
7-
"bundle",
8-
"index.js",
9-
"CHANGELOG.md",
10-
"README.md"
11-
],
126
"scripts": {
137
"test": "echo \"Error: no test specified\" && exit 1",
148
"start": "npm run storybook",
159
"build": "bash build.sh",
1610
"storybook": "start-storybook -p 9006 -c .storybook -s ./assets",
17-
"demo:build": "build-storybook -o demo/bundle/react"
11+
"demo:build": "build-storybook -o demo/bundle/react",
12+
"clean": "rm -rf dist demo/bundle"
1813
},
1914
"repository": {
2015
"type": "git",
@@ -34,9 +29,9 @@
3429
"react-dom": "^16.6.3"
3530
},
3631
"devDependencies": {
37-
"@storybook/addon-options": "4.0.7",
38-
"@storybook/react": "4.0.7",
39-
"@storybook/storybook-deployer": "2.3.0",
32+
"@storybook/addon-options": "5.0.5",
33+
"@storybook/react": "5.0.5",
34+
"@storybook/storybook-deployer": "2.8.1",
4035
"babel-cli": "6.26.0",
4136
"babel-core": "6.26.0",
4237
"babel-loader": "7.1.2",

‎packages/vue/package.json

+6-12
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,26 @@
33
"version": "0.11.4",
44
"description": "Carbon charting components for Vue",
55
"main": "index.js",
6-
"files": [
7-
"charts-vue.common.js",
8-
"charts-vue.umd.js",
9-
"charts-vue.umd.min.js",
10-
"CHANGELOG.md",
11-
"README.md"
12-
],
136
"scripts": {
147
"build": "bash build.sh",
158
"lint": "vue-cli-service lint ./src/index.js",
169
"storybook": "start-storybook -p 6006",
1710
"demo:build": "build-storybook -o demo/bundle/vue",
1811
"ci-check": "yarn format:diff",
1912
"format": "prettier --write \"**/*.{scss,css,js,md,vue}\"",
20-
"format:diff": "prettier --list-different \"**/*.{scss,css,js,md,vue}\""
13+
"format:diff": "prettier --list-different \"**/*.{scss,css,js,md,vue}\"",
14+
"clean": "rm -rf dist demo/bundle"
2115
},
2216
"dependencies": {
2317
"@carbon/charts": "^0.11.4",
2418
"vue": "2.5.21"
2519
},
2620
"devDependencies": {
2721
"@babel/core": "7.3.4",
28-
"@storybook/addon-actions": "4.0.7",
29-
"@storybook/addon-links": "4.0.7",
30-
"@storybook/addons": "4.0.7",
31-
"@storybook/vue": "4.0.7",
22+
"@storybook/addon-actions": "5.0.5",
23+
"@storybook/addon-links": "5.0.5",
24+
"@storybook/addons": "5.0.5",
25+
"@storybook/vue": "5.0.5",
3226
"@vue/cli-plugin-babel": "3.4.0",
3327
"@vue/cli-plugin-eslint": "3.4.0",
3428
"@vue/cli-service": "3.4.0",

‎scripts/build-demos.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
# README:
6+
# each package should build a dist folder that contains everything needed to publish that package
7+
# including:
8+
# - package.json
9+
# - .js files and .d.ts files (no raw .ts files!)
10+
# - README.md
11+
# - and any specialty files
12+
13+
# Generate all assets needed for push to gh-pages
14+
mkdir -p pages
15+
touch pages/.nojekyll
16+
# echo "charts.carbondesignsystem.com" > pages/CNAME
17+
18+
19+
# run the demo:build script in all packages
20+
lerna run --parallel demo:build
21+
# copy all the demos/{package name here} folders to the pages deploy directory
22+
lerna exec -- cp -a demo/bundle/. \$LERNA_ROOT_PATH/pages

‎scripts/deploy.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
set -e # exit with nonzero exit code if anything fails
4+
5+
npm run build-all
6+
7+
# Should remove once lerna stops mistakenly
8+
# adding package-lock.json to every package after npm install
9+
rm -rf **/package-lock.json
10+
11+
lerna publish --conventional-commits --yes --github-release --contents dist

‎scripts/netlify.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ npm i
33

44
./.travis/before_install.sh
55

6-
# This script builds all package bundles (for NPM) & demos (for gh-pages)
7-
npm run build-all
6+
# This script builds all demos for netlify
7+
npm run build-all-demos

0 commit comments

Comments
 (0)
Please sign in to comment.