Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📦 Switch to Yarn workspaces; overhaul build system #1741

Merged
merged 26 commits into from
Nov 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1b33ffb
Switch to yarn workspaces, upgrade some dev dependencies
adidahiya Oct 19, 2017
738f313
[core] fix typescript compilation
adidahiya Oct 19, 2017
a73de92
Remove require-shim.d.ts files, we now use @types/node
adidahiya Oct 19, 2017
cc924a2
[table] fix typescript compilation
adidahiya Oct 19, 2017
9cf4847
update tsconfig.json files
adidahiya Oct 19, 2017
ea85b65
[docs] fix typescript compilation
adidahiya Oct 19, 2017
0d7765e
[labs] fix typescript compilation
adidahiya Oct 19, 2017
9e88abe
[core] fix some tests
adidahiya Oct 19, 2017
567f51f
bump to webpack 3!
Oct 24, 2017
2e6b4a4
fix ts-loader errors
Oct 24, 2017
80efeb3
clean yarn.lock
Oct 24, 2017
57a6ee0
massage package.json versions to hoist as much as possible
Oct 24, 2017
0670962
upgrade site-landing and table preview to webpack 3
Oct 24, 2017
2eaa4f4
get karma webpacking
Oct 24, 2017
ddc54b0
karma serves/includes correct files
Oct 25, 2017
a127b30
:star: test compile errors now fail the build!
Oct 25, 2017
acac406
fix core and datetime tests
Oct 25, 2017
dba77e7
fix webpack-watch
Oct 25, 2017
9efda93
quick ignore ContextMenu component cuz it's untestable (not exported)
Oct 25, 2017
057f1de
bump range slider test coverage
Oct 25, 2017
98bcc9c
Fix Table test typings
cmslewis Oct 26, 2017
285f318
Comment out broken tests :/
cmslewis Oct 26, 2017
33f5eba
Merge remote-tracking branch 'origin/master' into ad/workspaces
adidahiya Oct 31, 2017
ab3b459
Merge remote-tracking branch 'origin/master' into ad/workspaces
adidahiya Nov 14, 2017
83ffd5e
Refactor build system, remove Gulp (#1786)
adidahiya Nov 16, 2017
1a3d563
Remove Gulpfile.js
adidahiya Nov 16, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
workspace-experimental true
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ install dependencies:
```sh
git clone [email protected]:<username>/blueprint.git # using ssh
cd blueprint
npm install
npm run bootstrap
yarn
```

## Developing
Expand Down
136 changes: 0 additions & 136 deletions Gulpfile.js

This file was deleted.

81 changes: 61 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,83 @@ If you rely heavily on mobile interactions and are looking for a mobile-first UI

## Packages

This repository contains multiple projects in the `packages/` directory that are distributed as separate packages on NPM:
This repository contains multiple projects in the `packages/` directory that fall into 3 categories:

[![npm](https://img.shields.io/npm/v/@blueprintjs/core.svg?label=@blueprintjs/core)](https://www.npmjs.com/package/@blueprintjs/core) &ndash; Core styles & components.
### Libraries

[![npm](https://img.shields.io/npm/v/@blueprintjs/datetime.svg?label=@blueprintjs/datetime)](https://www.npmjs.com/package/@blueprintjs/datetime) &ndash; Components for interacting with dates and times.
These are the component libraries we publish to NPM.

[![npm](https://img.shields.io/npm/v/@blueprintjs/docs.svg?label=@blueprintjs/docs)](https://www.npmjs.com/package/@blueprintjs/docs) &ndash; Documentation theme for [Documentalist](https://github.com/palantir/documentalist) data.
- [![npm](https://img.shields.io/npm/v/@blueprintjs/core.svg?label=@blueprintjs/core)](https://www.npmjs.com/package/@blueprintjs/core) &ndash; Core styles & components.
- [![npm](https://img.shields.io/npm/v/@blueprintjs/datetime.svg?label=@blueprintjs/datetime)](https://www.npmjs.com/package/@blueprintjs/datetime) &ndash; Components for interacting with dates and times.
- [![npm](https://img.shields.io/npm/v/@blueprintjs/docs.svg?label=@blueprintjs/docs)](https://www.npmjs.com/package/@blueprintjs/docs) &ndash; Documentation theme for [Documentalist](https://github.com/palantir/documentalist) data.
- [![npm](https://img.shields.io/npm/v/@blueprintjs/table.svg?label=@blueprintjs/table)](https://www.npmjs.com/package/@blueprintjs/table) &ndash; Scalable interactive table component.
- [![npm](https://img.shields.io/npm/v/@blueprintjs/labs.svg?label=@blueprintjs/labs)](https://www.npmjs.com/package/@blueprintjs/labs) &ndash; Incubator and staging area for new components still under initial development.

[![npm](https://img.shields.io/npm/v/@blueprintjs/table.svg?label=@blueprintjs/table)](https://www.npmjs.com/package/@blueprintjs/table) &ndash; Scalable interactive table component.
### Applications

[![npm](https://img.shields.io/npm/v/@blueprintjs/labs.svg?label=@blueprintjs/labs)](https://www.npmjs.com/package/@blueprintjs/labs) &ndash; Incubator and staging area for new components still under initial development.
These are hosted on GitHub Pages as static web applications.

The other packages (`site-docs` and `site-landing`) are not published to NPM as they are used to build the documentation site.
- `docs-app`
- `landing-app`

### Build tooling

These private packages define development dependencies and contain build configuration. They adhere to standard NPM package layout&mdash;this allows us to keep clear API boundaries for build configuration and isolate groups of `devDependencies`. In the future, we might publish these packages to allow other Blueprint projects to use this infrastructure outside this monorepo.

- `karma-build-scripts`
- `node-build-scripts`
- `tslint-config`
- `webpack-build-scripts`

## Development

We use [Lerna](https://lernajs.io/) to manage inter-package dependencies in this monorepo.
Builds are orchestrated via [Gulp](http://gulpjs.com/) tasks.
[Lerna](https://lernajs.io/) manages inter-package dependencies in this monorepo.
Builds are orchestrated via `lerna run` and NPM scripts.

__Prerequisites__: Node.js v8+, Yarn v1.0+

### One-time setup

After cloning this repo, run:

1. `yarn` to install all dependencies.
1. `yarn verify` to ensure you have all the build tooling working properly.

### Incorporating upstream changes

__Prerequisites__: Node.js v6+, Yarn v0.28+
If you were previously in a working state and have just pulled new code from `develop`:

1. `git clone` this repository (or fork if you lack permissions).
1. `yarn` to install dependencies at the root of the repo.
1. `yarn bootstrap` to install package dependencies install and symlink them using [Lerna](https://lernajs.io/).
1. `yarn gulp` to compile and start the server and watcher.
1. Open your browser to [localhost:9000/packages/site-docs/dist/](http://localhost:9000/packages/site-docs/dist/).
- If there were package dependency changes, run `yarn` at the root.
- This command is very quick if there are no new things to install.
- Run `yarn compile-libs` to get the latest built versions of the library packages in this repo.
- This command is quicker than `yarn verify` since it doesn't build the application packages (`docs-app`, `landing-app`, etc.) or run tests

### Updating build dependencies
### Developing libraries

1. `yarn add <package-name>` or `yarn upgrade <package-name>`.
Each library has its own dev script which you can run to watch changes to that package and run the docs application with webpack-dev-server: `yarn dev:core`, `yarn dev:datetime`, etc.

- One exception is `table`&mdash;since it has its own playground application for development, the `dev:table` script doesn't run the docs site.
- You may also choose to watch changes across all packages by running `yarn dev:all` from the root directory.

### Updating dependencies

1. Edit the `package.json` where you wish to change dependencies.
1. Run `yarn` at the root to update lockfiles.
1. Commit the result.

### Updating package dependencies
### Updating documentation

Much of Blueprint's documentation lives inside source code as JSDoc comments in `.tsx?` files and KSS markup in `.scss` files. This documentation is extracted and converted into static JSON data using [documentalist](https://github.com/palantir/documentalist/).

If you are updating documentation sources (_not_ the docs UI code which lives in `packages/docs-app`), you'll need to run `yarn generate-docs-data` from the `docs-app` package to see it reflected in the application. Note that `yarn bundle` in this package also runs this script.

### Updating icons

The [One-time setup](#one-time-setup) and [Incorporating upstream changes](#incorporating-upstream-changes) steps should produce the generated
source code in this repo used to build the icons documentation. This is sufficient for most development workflows.

1. Update the relevant `package.json` file. Make sure to retain the `^` semver range.
1. Run `yarn bootstrap` and commit the result.
If you are updating icons or adding new ones, you'll need to run `yarn compile` in `packages/core` to see those changes reflected before
running any of the dev scripts.

## Contributing

Expand Down
52 changes: 20 additions & 32 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,51 @@
machine:
pre:
- mkdir ~/yarn
environment:
PATH: $PATH:$HOME/yarn/bin:$HOME/$CIRCLE_PROJECT_REPONAME/node_modules/.bin:$HOME/$CIRCLE_PROJECT_REPONAME/scripts
YARN_VERSION: 1.2.1
node:
version: 8.5.0

general:
artifacts:
# compiled assets for each package
- packages/core/dist
- packages/datetime/dist
- packages/docs/dist
- packages/labs/dist
- packages/site-docs/dist
- packages/site-landing/dist
- packages/docs-app/dist
- packages/landing-app/dist
- packages/table/dist
# code coverage reports
- packages/core/coverage
- packages/datetime/coverage
- packages/table/coverage
# preview pages
- packages/table/preview
# GH Pages content
- docs

machine:
pre:
- mkdir ~/yarn
environment:
YARN_VERSION: 0.28.4
PATH: $PATH:$HOME/$CIRCLE_PROJECT_REPONAME/node_modules/.bin
node:
version: 7.10.0

dependencies:
cache_directories:
- ~/yarn
- ~/.cache/yarn
- ~/$CIRCLE_PROJECT_REPONAME/packages/core/node_modules
- ~/$CIRCLE_PROJECT_REPONAME/packages/datetime/node_modules
- ~/$CIRCLE_PROJECT_REPONAME/packages/docs/node_modules
- ~/$CIRCLE_PROJECT_REPONAME/packages/labs/node_modules
- ~/$CIRCLE_PROJECT_REPONAME/packages/site-docs/node_modules
- ~/$CIRCLE_PROJECT_REPONAME/packages/site-landing/node_modules
- ~/$CIRCLE_PROJECT_REPONAME/packages/table/node_modules
# non-zero exit codes in `dependencies` group will fail the build early
# so these following commands will block the build and prevent tests
override:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION
- yarn install --pure-lockfile
- echo "Checking if yarn.lock changed..." && git diff --exit-code
- yarn bootstrap
- yarn build:gulp
- yarn
- echo "Checking if lockfiles changed..." && git diff --exit-code
- npm rebuild node-sass
- yarn compile-libs

test:
override:
- gulp check
- gulp test
- case $CIRCLE_NODE_INDEX in 0) yarn dist ;; 1) yarn test ;; 2) yarn lint ;; esac:
parallel: true

deployment:
preview:
branch: /.*/
commands:
- ./scripts/preview.sh
- build-docs-artifacts
- submit-preview-comment
npm:
tag: /release-.*/
owner: palantir
commands:
- ./scripts/npmPublish.sh
- publish-npm-semver-tagged
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"version": "2.0.0",
"version": "2.4.2",
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"experimentalDecorators": true,
"importHelpers": true,
"jsx": "react",
"module": "commonjs",
"moduleResolution": "node",
Expand All @@ -12,12 +12,10 @@
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"pretty": true,
"removeComments": false,
"sourceMap": false,
"stripInternal": true,
"target": "es5",
"paths": {
"@blueprintjs/docs": ["../../docs/dist/index"]
}
"target": "es5"
}
}
29 changes: 0 additions & 29 deletions gulp/aliases.js

This file was deleted.

Loading