Package build output; fix node tests.

- Reconfigure package_tasks.js to use BUILD_DIR from config.js
  (i.e., build/) rather than repository root as source of files to
  package.

  - Add check to packageTasks.package to ensure that certain required
    files exist in BUILD_DIR, to verify that buildTasks.build and
    typings.typings have been run.

  - Fix packageUMDBundle to use generated, rather than checked-in
    version of en.js.

  - Fix packageDTS to use the generated (rather than checked-in)
    versions of blockly.d.ts and msg/*.d.ts.

- Modify run_all_tests.sh to run packageTasks.package before running
  node tests, since they depend on it.  Previously this was only
  working because 'npm install' runs the 'prepare' script, which would
  run the 'package' script - so the code being tested by the node tests
  was not the current source but whatever precomipled code had
  previously been checked in.

- Remove the 'prepare' script from package.json, since it is no longer
  needed (and is now broken, since it requires that build and typings
  have been done first.)  Note that no scripts at all are included in
  the version of package.json that is created in dist/ and subsequently
  included in the published npms, so this deletion does not affect what
  happens when the Blockly npm in installed - it only affects what
  happens when 'npm install' is run after the blockly repo is cloned.

- Factor out the actual recompilation steps from releaseTasks.recompile.

- Rename releaseTasks.recomple to recompileDevelop, since it deals
  specifically with the develop branch.  (The npm script name is
  unchanged.)

- Ensure that a full recompile and repackage is done before publishing
  (beta and non-beta) npms.
This commit is contained in:
Christopher Allen
2021-07-07 16:22:42 +01:00
parent e6929decde
commit ec14cc3ed8
4 changed files with 76 additions and 30 deletions

View File

@@ -149,8 +149,18 @@ function updateBetaVersion(done) {
done();
}
// Build Blockly and prepare to check in the resulting built files.
const recompile = gulp.series(
buildTasks.cleanBuildDir,
buildTasks.build,
buildTasks.checkinBuilt,
typings.typings,
typings.checkinTypings,
);
// Package and publish to npm.
const publish = gulp.series(
recompile,
packageTasks.package,
checkBranch,
checkReleaseDir,
@@ -160,30 +170,25 @@ const publish = gulp.series(
// Publish a beta version of Blockly.
const publishBeta = gulp.series(
updateBetaVersion,
buildTasks.cleanBuildDir,
buildTasks.build,
buildTasks.checkinBuilt,
recompile,
packageTasks.package,
checkBranch,
checkReleaseDir,
loginAndPublishBeta
);
// Switch to a new branch, update the version number, and build Blockly.
const recompile = gulp.series(
// Switch to a new branch, update the version number, build Blockly
// and check in the resulting built files.
const recompileDevelop = gulp.series(
gitTasks.syncDevelop(),
gitTasks.createRebuildBranch,
updateVersionPrompt,
buildTasks.cleanBuildDir,
buildTasks.build,
buildTasks.checkinBuilt,
typings.typings,
typings.checkinTypings,
recompile,
gitTasks.pushRebuildBranch
);
module.exports = {
recompile: recompile,
recompile: recompileDevelop,
publishBeta: publishBeta,
publish: publish
}