Skip to content

Commit

Permalink
feat(showcase): added showcase, cleaned up start and got rid of old t…
Browse files Browse the repository at this point in the history
  • Loading branch information
dsebastien committed Jun 2, 2018
1 parent 248374d commit b0ec6da
Show file tree
Hide file tree
Showing 218 changed files with 2,522 additions and 1,213 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cache:
directories:
- $HOME/.npm

# Not needed since we use Puppeteer in karma.conf.typescript.ci.js
# Not needed since we use Puppeteer in karma.conf.ci.js
# It downloads Chrome itself and works with or without Travis
#addons:
# chrome: stable
Expand Down
27 changes: 26 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ If you want to build Stark from source, you need to...
### Executing Stark's main build script
Anytime you make modifications to a Stark package (e.g., stark-build, stark-core, ...), you'll need to
* execute `npm run build` from the root directory of Stark
* execute `npm install` again on the showcase to get those changes
* execute `npm install` again on the starter to get those changes

Stark's main build script is a fun Bash shell script heavily inspired by Angular's that
Expand All @@ -214,9 +215,23 @@ Stark's main build script is a fun Bash shell script heavily inspired by Angular
* generates releasable versions of each package
* adds license banners to the generated code
* generates temporary tar.gz files for local testing
* adapts the showcase's dependencies to point to the local tar.gz files
* adapts the starter's dependencies to point to the local tar.gz files
* ...

### Hacking the showcase
If you want to modify the showcase:
* go to the showcase's folder: `cd showcase`
* install dependencies: `npm install`
* run it: `npm start`
* open up your browser at http://localhost:3000
* make your changes

If you make modifications, they'll be applied automatically after a Webpack rebuild.

By default the showcase depends on published Stark packages over at npm.
But once the main build script at Stark's root (cfr previous section) is executed (e.g., using `npm install` or `npm run build` at the root), then the showcase will depend on the contents of the dist folder.

### Hacking the starter
If you want to modify the starter:
* go to the starter's folder: `cd starter`
Expand All @@ -236,7 +251,7 @@ If you want to modify Stark packages (e.g., stark-build, stark-core, ...):
* install its dependencies: `npm install`
* make your changes
* execute `npm run build` at Stark's root
* update the Starter and test in it
* update the Showcase and add examples to it / adapt existing code if needed

Start hacking :)

Expand All @@ -245,11 +260,20 @@ If you want to test/validate your changes against the starter, then you can use
* update the starter: `npm run update-starter`
* run the starter: `npm run starter`

If you want to integrate examples or update code in the showcase and validate your changes, then you can use the following scripts from the root:
* rebuild: `npm run build`
* update the showcase: `npm run update-showcase`
* run the showcase: `npm run showcase`

If you only want to build a subset of stark then you can
* execute one of the `build:stark-<name>` npm scripts; for example: `npm run build:stark-core` or `npm run build:stark-build`
* execute the `build` script through npm with the list of packages to build: `npm run build -- --packages=stark-core`
* execute the build script from the command line: `bash ./build.sh --packages=stark-core`

## Executing test suites
Anytime you integrate or modify features, you need to make sure the relevant test suites still pass.
You can execute the tests for all Stark parts using the following command at the root: `npm test`

## Cleaning up the project / packages
### Cleaning up dist folders
If you want to clean up the generated dist folders, you can
Expand Down Expand Up @@ -321,6 +345,7 @@ Must be one of the following:
* **stark-build**
* **stark-core**
* **stark-demo**
* **stark-showcase**
* **stark-starter**
* **stark-rbac**
* **stark-ui**
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
Stark provides main building blocks for accelerating front-end development:
* a solid reusable build based on Webpack
* a starter inspired by [Angular Starter](https://github.com/gdi2290/angular-starter) by [AngularClass](https://angularclass.com) and Google's [Web Starterk Kit](https://github.com/google/web-starter-kit)
* a starter project inspired by [Angular Starter](https://github.com/gdi2290/angular-starter) by [AngularClass](https://angularclass.com) and Google's [Web Starterk Kit](https://github.com/google/web-starter-kit)
* core modules providing reusable APIs (e.g., reactive client for RESTful APIs based on [NBB's RESTful API Design Guide](https://github.com/NationalBankBelgium/REST-API-Design-Guide/wiki), routing, logging, log shipping, ...)
* UI modules providing reusable UI components (e.g., data table, message pane, ...) and themes
* a demo application containing
* a showcase application containing
* our [living style guide](https://www.smashingmagazine.com/2016/05/creating-a-living-style-guide-case-study/)
* a showcase of all components/services along with their API
* our developer guide
* a showcase of all components/services along with their API
* our developer guide

Stark modules are like LEGO blocks: add what you need, no less, no more. If you don't like our defaults then you may replace/override/ignore anything you fancy.

Expand Down
5 changes: 5 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,14 @@ do
logInfo "Generate npm package (tgz file)"
generateNpmPackage ${NPM_DIR}

logInfo "Adapt showcase dependencies"
adaptNpmPackageDependencies $PACKAGE $VERSION "./showcase/package.json" 1
adaptNpmPackageLockDependencies $PACKAGE $VERSION "./showcase/package-lock.json" 1

logInfo "Adapt starter dependencies"
adaptNpmPackageDependencies $PACKAGE $VERSION "./starter/package.json" 1
adaptNpmPackageLockDependencies $PACKAGE $VERSION "./starter/package-lock.json" 1

fi
travisFoldEnd "general tasks: ${PACKAGE}"

Expand Down
2 changes: 1 addition & 1 deletion docs/PRETTIER.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $ npm run prettier-check
```
## Prettier configuration
The main Prettier configuration file is located in `stark-build`.
The one located in `starter` and the other one located in the root just reference the `stark-build` configuration file
The ones located in `starter`, `showcase` and the other one located in the root just reference the `stark-build` configuration file
## Conflicts with TSLint and Stylelint
The configurations of `TSLint` and `Stylelint` can conflict with `Prettier`.
It's why we use [tslint-config-prettier](https://github.com/alexjoverm/tslint-config-prettier) and
Expand Down
32 changes: 23 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,73 +66,87 @@
"build:stark-testing": "npm run build -- --packages=stark-testing",
"build:stark-ui": "npm run build -- --packages=stark-ui",
"clean": "npx rimraf ./dist",
"clean:all": "npm run clean && npm run clean:stark-build && npm run clean:stark-core && npm run clean:stark-ui && npm run clean:stark-testing && npm run clean:starter",
"clean:all": "npm run clean && npm run clean:stark-build && npm run clean:stark-core && npm run clean:stark-ui && npm run clean:stark-testing && npm run clean:starter && npm run clean:showcase",
"clean:stark-build": "cd packages/stark-build && npm run clean && cd ../..",
"clean:stark-core": "cd packages/stark-core && npm run clean && cd ../..",
"clean:stark-testing": "cd packages/stark-testing && npm run clean && cd ../..",
"clean:stark-ui": "cd packages/stark-ui && npm run clean && cd ../..",
"clean:showcase": "cd showcase && npx rimraf ./dist && npx rimraf ./node_modules/@nationalbankbelgium && cd ..",
"clean:slate": "npm run clean:all && npm run clean:modules:all && npm install && npm run install:all",
"clean:starter": "cd starter && npx rimraf ./dist && npx rimraf ./node_modules/@nationalbankbelgium && cd ..",
"clean:modules": "npx rimraf ./node_modules package-lock.json",
"clean:modules:all": "npm run clean:modules && npm run clean:modules:stark-build && npm run clean:modules:stark-core && npm run clean:modules:stark-testing && npm run clean:modules:stark-ui && npm run clean:modules:starter",
"clean:modules:all": "npm run clean:modules && npm run clean:modules:stark-build && npm run clean:modules:stark-core && npm run clean:modules:stark-testing && npm run clean:modules:stark-ui && npm run clean:modules:starter && npm run clean:modules:showcase",
"clean:modules:stark-build": "cd packages/stark-build && npm run clean:modules && cd ../..",
"clean:modules:stark-core": "cd packages/stark-core && npm run clean:modules && cd ../..",
"clean:modules:stark-testing": "cd packages/stark-testing && npm run clean:modules && cd ../..",
"clean:modules:stark-ui": "cd packages/stark-ui && npm run clean:modules dist && cd ../..",
"clean:modules:showcase": "cd showcase && npm run clean:modules && cd ..",
"clean:modules:starter": "cd starter && npm run clean:modules && cd ..",
"commit": "./node_modules/.bin/git-cz",
"commitmsg": "commitlint -e $GIT_PARAMS",
"docs": "npm run docs:clean && npm run docs:all",
"docs:all": "npm run docs:stark-core && npm run docs:stark-ui",
"docs:clean": "npx rimraf reports/api-docs",
"docs:coverage": "npm run docs:stark-core:coverage && npm run docs:stark-ui:coverage && npm run docs:starter:coverage",
"docs:coverage": "npm run docs:stark-core:coverage && npm run docs:stark-ui:coverage && npm run docs:starter:coverage && npm run docs:showcase:coverage",
"docs:stark-core:coverage": "cd packages/stark-core && npm run docs:coverage && cd ../..",
"docs:stark-core:generate": "cd packages/stark-core && npm run docs && cd ../..",
"docs:stark-core:serve": "cd packages/stark-core && npm run docs:serve && cd ../..",
"docs:stark-ui:coverage": "cd packages/stark-ui && npm run docs:coverage && cd ../..",
"docs:stark-ui:generate": "cd packages/stark-ui && npm run docs && cd ../..",
"docs:stark-ui:serve": "cd packages/stark-ui && npm run docs:serve && cd ../..",
"docs:showcase:coverage": "cd showcase && npm run docs:coverage && cd ..",
"docs:starter:coverage": "cd starter && npm run docs:coverage && cd ..",
"docs:showcase:generate": "cd showcase && npm run docs && cd ..",
"docs:starter:generate": "cd starter && npm run docs && cd ..",
"docs:showcase:serve": "cd showcase && npm run docs:serve && cd ..",
"docs:starter:serve": "cd starter && npm run docs:serve && cd ..",
"generate:changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"generate:changelog-recent": "conventional-changelog -p angular | tail -n +3",
"lint": "tslint --config tslint.json --project ./packages/tsconfig.json --format codeFrame",
"lint:stark-core": "cd packages/stark-core && npm run lint && cd ../..",
"lint:stark-ui": "cd packages/stark-ui && npm run lint && cd ../..",
"lint:showcase": "cd showcase && npm run lint && cd ..",
"lint:starter": "cd starter && npm run lint && cd ..",
"lint:all": "npm run lint && npm run lint:stark-core && npm run lint:stark-ui && npm run lint:starter",
"install:all": "npm run install:stark-build && npm run install:stark-testing && npm run install:stark-core && npm run install:stark-ui && npm run build && npm run update:starter",
"lint:all": "npm run lint && npm run lint:stark-core && npm run lint:stark-ui && npm run lint:starter && npm run lint:showcase",
"install:all": "npm run install:stark-build && npm run install:stark-testing && npm run install:stark-core && npm run install:stark-ui && npm run build && npm run update:starter && npm run update:showcase",
"install:stark-build": "cd packages/stark-build && npm install && cd ../..",
"install:stark-core": "cd packages/stark-core && npm install && cd ../..",
"install:stark-testing": "cd packages/stark-testing && npm install && cd ../..",
"install:stark-ui": "cd packages/stark-ui && npm install && cd ../..",
"install:ci:all": "npm run install:ci:stark-build && npm run install:ci:stark-testing && npm run install:ci:stark-core && npm run install:ci:stark-ui && npm run build:trace && npm run install:ci:starter",
"install:ci:all": "npm run install:ci:stark-build && npm run install:ci:stark-testing && npm run install:ci:stark-core && npm run install:ci:stark-ui && npm run build:trace && npm run install:ci:starter && npm run install:ci:showcase",
"install:ci:stark-build": "cd packages/stark-build && npm ci && cd ../..",
"install:ci:stark-core": "cd packages/stark-core && npm ci && cd ../..",
"install:ci:stark-testing": "cd packages/stark-testing && npm ci && cd ../..",
"install:ci:stark-ui": "cd packages/stark-ui && npm ci && cd ../..",
"install:ci:showcase": "cd showcase && npm ci && cd ..",
"install:ci:starter": "cd starter && npm ci && cd ..",
"install:travis:all": "npm run install:stark-build && npm run install:stark-testing && npm run install:stark-core && npm run install:stark-ui && npm run build:trace && npm run update:starter",
"install:travis:all": "npm run install:stark-build && npm run install:stark-testing && npm run install:stark-core && npm run install:stark-ui && npm run build:trace && npm run update:starter && npm run update:showcase",
"ngc": "ngc",
"precommit": "lint-staged",
"prettier-check": "prettier **/*.{css,js,json,pcss,scss,ts} --write",
"preupdate:showcase": "npm run clean:showcase",
"preupdate:starter": "npm run clean:starter",
"release": "release-it",
"release:publish": "bash ./release-publish.sh --trace",
"showcase": "cd showcase && npm start && cd ..",
"starter": "cd starter && npm start && cd ..",
"stylelint-check": "stylelint-config-prettier-check",
"test": "npm run test:ci:all",
"test:all": "npm run test:stark-core && npm run test:stark-ui && npm run test:starter && npm run test:showcase",
"test:stark-core": "cd packages/stark-core && npm run test-fast && cd ../..",
"test:stark-ui": "cd packages/stark-ui && npm run test-fast && cd ../..",
"test:showcase": "cd showcase && npm run test-fast && cd ../..",
"test:starter": "cd starter && npm run test-fast && cd ../..",
"test:all": "npm run test:stark-core && npm run test:stark-ui && npm run test:starter",
"test:ci:all": "npm run test:ci:stark-core && npm run test:ci:stark-ui && npm run test:ci:starter && npm run test:ci:showcase",
"test:ci:stark-core": "cd packages/stark-core && npm run test-fast:ci && cd ../..",
"test:ci:stark-ui": "cd packages/stark-ui && npm run test-fast:ci && cd ../..",
"test:ci:showcase": "cd showcase && npm run test-fast:ci && cd ../..",
"test:ci:starter": "cd starter && npm run test-fast:ci && cd ../..",
"test:ci:all": "npm run test:ci:stark-core && npm run test:ci:stark-ui && npm run test:ci:starter",
"test:ci:coveralls:combined": "node combine-packages-coverage.js | packages/stark-testing/node_modules/coveralls/bin/coveralls.js",
"tsc": "tsc",
"tslint": "tslint",
"tslint-check": "tslint-config-prettier-check ./tslint.json",
"update:showcase": "cd showcase && npm install && cd ..",
"update:starter": "cd starter && npm install && cd .."
},
"lint-staged": {
Expand Down
133 changes: 0 additions & 133 deletions packages/stark-build/config-stark/karma.conf.ci.js

This file was deleted.

Loading

0 comments on commit b0ec6da

Please sign in to comment.