Skip to content

Reset build script#2767

Merged
compulim merged 36 commits intomicrosoft:masterfrom
compulim:fix-2748
Jan 15, 2020
Merged

Reset build script#2767
compulim merged 36 commits intomicrosoft:masterfrom
compulim:fix-2748

Conversation

@compulim
Copy link
Copy Markdown
Contributor

@compulim compulim commented Dec 19, 2019

Fixes #2748.

This PR will need to update CI pipeline.

Changelog Entry

Changed

Description

  • Decreased npm install time by about 4x
    • Do not install/build samples and embed
    • Down to ~7 packages to install
  • npm start will start dev mode
    • Watch mode on all packages
    • Serve samples and bits (today, we need to run serve manually)
    • Instrumented build (i.e. bits good for both local dev and Docker tests)
  • npm prepublishOnly will build production bits
  • Support source maps for development build of CDN bundle
  • Running 4 instances of Chrome (Azure CI seems using a D2-machine)
  • Support test and code coverage reporting on VSTS

Design

For all packages, we provide 3 favors and 2 build scripts.

Favors

We offer 3 build favors:

Instrumented Minified Source maps
Production
Test
Development

Eval source maps took 1.6s to load in browser, while code without source maps only took 300-500ms to load. Thus, test build should not contains source maps to speed up testing in CI.

Tests run locally will be using development build without any code coverage collection.

To select different build favors, set node_env environment variable to:

  • production
  • test
  • development or not set

Scripts

We offer 2 types of build processes:

  • npm run build will build once
  • npm start will build continuously with watch

Specific Changes

  • Build
    • Remove samples from Lerna
      • Today, we no longer use npm link in samples, Lerna has no values in samples project
    • Update build script
      • npm run bootstrap will always use CI (CI = nuke + faster install)
      • npm run build to build once
      • npm start to build continuously
      • Remove clean and most scripts
      • npm test will target for development mode (watch, no coverage)
        • npm run test:ci will be used on VSTS (no watch, but coverage)
    • Renamed .babelrc to babel.config.json
    • Aggregated webpack*.config.js into a single webpack.config.js
      • Use node_env to determines build favor (development, production, testing)
    • Enabled source maps for development build
    • Clean up tsconfig.json, we are not using tsc to build, only use for type checking and emit declarations
      • Remove options that are related to build
    • Direct Line Speech converge to use the Web Chat config and scripts
  • Code analysis
    • Added prettier.yml at root for prettifying babel-jest-config.js and other config files
  • CI
    • Update .travis.yml to match VSTS
    • Preparing azure-pipelines.yml (we will tune and enable it after merged)
  • Doc
    • Add BUILD_SCRIPTS.md for the build script design and verification
    • Add packages/README.md for explanation of different packages
    • Update CONTRIBUTING.md
  • Test
    • Update .dockerignore to improve Docker build time
    • Enable Selenium Grid with 4 nodes
    • For port 5080, added an easy button to start Web Chat (we used to run main() in console)
    • Moved Jest config to separate jest.config.js file
    • Export JUnit test report and Cobertura code coverage report
    • Include Direct Line Speech tests in root npm test
    • Also serve directlinespeech.development.js with serve

To-do

  • Rename .babelrc.js back to babel.config.json
    • Make sure to modify babel-jest-config.js
  • Update /.github/CONTRIBUTING.md
  • Clean up/packages/README.md
  • Update Azure Pipelines

  • Testing Added
    • This is build script changes, our current PR validation CI pipeline should be sufficient to test this PR.
    • However, since the build script is new, we should spare some time making sure daily builds are correct.

@corinagum
Copy link
Copy Markdown
Contributor

what about this? #2394

@compulim compulim marked this pull request as ready for review December 24, 2019 23:10
@compulim compulim changed the title [DRAFT] Reset build script Reset build script Dec 27, 2019
@corinagum
Copy link
Copy Markdown
Contributor

Are we closing #2394 in this PR too? could you add to Fix line in top comment?

Comment thread .dockerignore
Comment thread .github/CONTRIBUTING.md
Comment thread lerna.json
Comment thread packages/isomorphic-react/package.json Outdated
Comment thread packages/isomorphic-react-dom/package.json Outdated
Comment thread package.json Outdated
Comment thread packages/README.md Outdated
Comment thread packages/README.md Outdated
Comment thread packages/README.md Outdated
Comment thread packages/README.md Outdated
Comment thread packages/README.md Outdated
Copy link
Copy Markdown
Contributor

@corinagum corinagum left a comment

Choose a reason for hiding this comment

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

Mostly docs cleanup

Comment thread BUILD_SCRIPTS.md Outdated
Comment thread BUILD_SCRIPTS.md Outdated
Comment thread BUILD_SCRIPTS.md Outdated
Comment thread BUILD_SCRIPTS.md Outdated
Copy link
Copy Markdown
Contributor

@corinagum corinagum left a comment

Choose a reason for hiding this comment

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

LGTM! As a low priority I would like to go through all our .md files to match up tone and tense, etc. xD

@compulim compulim merged commit 907fa9e into microsoft:master Jan 15, 2020
@compulim compulim deleted the fix-2748 branch January 15, 2020 16:21
@compulim compulim mentioned this pull request Mar 5, 2020
40 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make build scripts better

2 participants