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

Refactor build system, remove Gulp #1786

Merged
merged 75 commits into from
Nov 16, 2017
Merged

Conversation

adidahiya
Copy link
Contributor

@adidahiya adidahiya commented Nov 3, 2017

⚠️ Targeting branch ad/workspaces

Fixes #116.
Fixes #436.
Fixes #1527.
Fixes #780.

Changes proposed:

Replace Gulp build tooling with Lerna & NPM scripts. Each package now has its own list of "scripts" in package.json. There are a few new private packages which help us manage build configuration. The three types of packages are:

  • libraries: core, datetime, labs, table
    • these are our UI libraries that we publish on NPM
  • applications: landing-app, docs-app
    • these require bundling with webpack
    • I renamed these from site-landing and site-docs because I feel like "application" much better represents what they are; they're not static web pages
  • build tooling: webpack-build-scripts, karma-build-scripts, tslint-config
    • these new private packages help us:
      • keep clear API boundaries for build configuration
      • isolate groups of dev dependencies
    • in the future, we might publish these packages for use in other blueprint repos

A decent amount of cruft was removed in this process:

  • Removed all usage of the deprecated typings registry in favor of @types packages from NPM.
  • All projects share tsc configuration using TypeScript's "extends" inheritance feature (it was unsupported in gulp-typescript).

There is a new publishing workflow. I brought over some of our internal monorepo build scripts to handle publishing using Lerna publish commits (generated by lerna publish).

And a few random enhancements:

  • Faster CI builds with concurrent containers -- we run dist, test, and lint in parallel.

Further improvements to be addressed in future PRs

Remaining tasks

  • landing-app
    • compiling
    • bundle assets correctly
    • webpack dev setup
  • docs-app
    • examples compiling
    • webpack dev setup
    • run documentalist
  • misc. scripts, tests
    • generate icons
    • isomorphic tests
    • generate sass / less variables files
  • table
  • delete Gulp build code
  • dev documentation
  • core
    • build src and test
    • tests pass
  • datetime
    • build src and test
    • tests pass
  • labs
    • build src and test
    • tests pass

@adidahiya
Copy link
Contributor Author

it's beautiful 😂
image

@adidahiya adidahiya changed the title Refactor build system, remove Gulp [WIP] Refactor build system, remove Gulp Nov 8, 2017
@adidahiya adidahiya changed the title [WIP] Refactor build system, remove Gulp Refactor build system, remove Gulp Nov 16, 2017
@blueprint-bot
Copy link

compile libs in all CI container

Preview: documentation | landing | table
Coverage: core | datetime

@blueprint-bot
Copy link

fix build artifacts

Preview: documentation | landing | table
Coverage: core | datetime

@adidahiya
Copy link
Contributor Author

adidahiya commented Nov 16, 2017

almost good to go... missing some assets in the statically built artifacts:

  • icon font in docs site
  • svg images (non-inline ones) in landing app

@@ -98,10 +98,6 @@ const projects = [
entry: "src/index.tsx",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should delete this file

@blueprint-bot
Copy link

fix public paths

Preview: documentation | landing | table
Coverage: core | datetime

@@ -58,7 +58,7 @@ const ELEVATION_CLASSES = [
export class Card extends React.Component<ICardProps, {}> {
public static displayName = "Blueprint.Card";
public static defaultProps: ICardProps = {
elevation: Elevation.ZERO,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems wrong?

"declaration": false,
"noEmit": true
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline

},
"author": "Palantir Technologies",
"license": "Apache-2.0"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline

{
loader: require.resolve("postcss-loader"),
options: {
config: { path: path.resolve(__dirname, "postcss.config.js") },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does this __dirname resolve? usage on line 100 implies it resolves in the directory in which webpack is being run, so is postcss not happening?

@blueprint-bot
Copy link

address CR comments

Preview: documentation | landing | table
Coverage: core | datetime

@blueprint-bot
Copy link

fix table preview public url

Preview: documentation | landing | table
Coverage: core | datetime

@adidahiya
Copy link
Contributor Author

:shipit:

@adidahiya adidahiya merged commit 83ffd5e into ad/workspaces Nov 16, 2017
@adidahiya adidahiya deleted the ad/refactor-build-scripts branch November 16, 2017 15:13
giladgray pushed a commit that referenced this pull request Nov 16, 2017
* Switch to yarn workspaces, upgrade some dev dependencies

* [core] fix typescript compilation

* Remove require-shim.d.ts files, we now use @types/node

* [table] fix typescript compilation

* update tsconfig.json files

* [docs] fix typescript compilation

* [labs] fix typescript compilation

* [core] fix some tests

* bump to webpack 3!

remove localResolve support -- not necessary with hoisting

* fix ts-loader errors

* clean yarn.lock

* massage package.json versions to hoist as much as possible

* upgrade site-landing and table preview to webpack 3

* get karma webpacking

* karma serves/includes correct files

* ⭐ test compile errors now fail the build!

* fix core and datetime tests

* fix webpack-watch

* quick ignore ContextMenu component cuz it's untestable (not exported)

* bump range slider test coverage

* Fix Table test typings

* Comment out broken tests :/

* Refactor build system, remove Gulp (#1786)

* Remove Gulpfile.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants