Skip to content

Commit

Permalink
Added build script and initial stark-core module. Closes #13 #45
Browse files Browse the repository at this point in the history
Changed .prettierignore to avoid conflicts with npm
Please read the following post for more info: https://medium.com/@martin_hotell/stop-re-formatting-package-json-with-prettier-and-vscode-once-and-for-all-52d283067f9a
  • Loading branch information
dsebastien committed Feb 28, 2018
1 parent fb515eb commit 71c44bd
Show file tree
Hide file tree
Showing 72 changed files with 955 additions and 2,186 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Expand Up @@ -20,7 +20,7 @@ end_of_line = crlf
indent_style = space
indent_size = 2

[**.{css, pcss, scss,json}]
[**.{css, pcss, scss,json,sh}]
indent_style = space
indent_size = 2

Expand Down
7 changes: 6 additions & 1 deletion .gitignore
@@ -1,6 +1,5 @@
# Build
/dist/
!dist/

# Reports directory
reports/
Expand All @@ -12,6 +11,9 @@ package-lock.json
./logs/
*.log

# Bak
*.bak

# Node
node_modules/

Expand All @@ -35,3 +37,6 @@ Icon?
pids
*.pid
*.seed

# Patch files
*.patch
1 change: 1 addition & 0 deletions .prettierignore
Expand Up @@ -3,3 +3,4 @@
.vscode/
dist/
node_modules/
package.json
54 changes: 39 additions & 15 deletions CONTRIBUTING.md
Expand Up @@ -75,26 +75,50 @@ Once done, you may submit a new Pull Request (PR): https://github.com/NationalBa
TODO add project structure details

## Building from source
If you want to build Stark from source, you need to jump through some hoops (for now).

In all cases:
If you want to build Stark from source, you need to...
* install NodeJS (6.0.0+) and npm (5.3.0+)
* clone this git repository
* install dependencies at root level: `npm install`

* clone this git repository: `git clone https://github.com/NationalBankBelgium/stark.git`
* run `npm install` from the root directory of Stark

Executing `npm install` at the root will also install and build all Stark packages.

### 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 starter to get those changes

Stark's main build script is a fun Bash shell script heavily inspired by Angular's that
* typechecks all Stark packages
* transpiles all Stark packages
* generates umd, esm5, ... bundles
* minifies the bundles
* generates sourcemaps
* generates releasable versions of each package
* adds license banners to the generated code
* generates temporary tar.gz files for local testing
* adapts the starter's dependencies to point to the local tar.gz files
* ...

### Hacking the starter
If you want to modify the starter:
* go to the starter's folder: `cd starter`
* install dependencies for the starter: `npm install`
* 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 starter 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 starter will depend on the contents of the dist folder.

If you want to modify the build:
* go to the build package folder: `cd packages/build`
* install dependencies for the build: `npm install`
### Hacking the Stark packages
If you want to modify Stark packages (e.g., stark-build, stark-core, ...):
* go to the package folder. `cd packages/<name>`
* install its dependencies: `npm install`
* make your changes
* run the build to generate the contents in the dist folder: `npm run build`
* pack the newly built build
* go to the dist/packages/stark-build folder: `cd dist/packages/stark-build`
* pack the contents: `npm pack ./`
* now you can test with the starter
* execute `npm run build` at Stark's root
* update the Starter and test in it

Start hacking :)

Expand Down

0 comments on commit 71c44bd

Please sign in to comment.