An intermediate version of this code read:
fs.mkdir(demoStaticTmpDir, {recursive: true}), done);
but apparently `fs.mkdir` doesn't honour the recursive option, so I
tried to revert the change but munged it instead.
This commit cleans up the mess I made.
* New gulp task buildDeps (npm run build:deps) to create tests/deps.js.
* Old gulp task buildUncompressed is deleted.
* blockly_uncompressed.js is now handwritten.
* And simplified; in particular, BLOCKLY_BOOT is gone.
* And linted!
* For consistency with the Closure documentation and base.js,
consistently refer to what blockly_uncompressed.js is used for as
"uncompiled mode" rather than "uncompressed mode" (but don't yet
rename it to blockly_uncompiled.js)
I had forgotten that I needed to change the value of BUILD_DIR
in several different places.
Added comments warning future editors about this as well as filing
issue #5007 to track fixing this properly.
Despite being misconfigured and therefore failing, the typescript
and metadata test scripts were exiting with status 0, indicating
successful completion. These have been fixed so they should fail
on any error, including misconfiguration.
- 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.
* Modify scripts/gulpfiles/typings.js to write typings to BUILD_DIR.
* Modify tests/scripts/compile_typings.sh to check compilability of
resulting output from BUILD_DIR.
* Rename checkin script to checkin:built, add a checkin:typings script
to do the same for .d.ts files, and a new checkin script to do both.
* Have recompile run checkin:typings.
The documented release process is to do npm run recompile, merge the
resulting branch to develop, and then do npm run relase, which does
not do another build.
This process should probably be changed, but for the moment ensure
that npm run recompile (as well as npm run package:beta) runs
buildTasks.checkinBuilt after each .build to preserve the old procedure.
You can now do npm run clean:buildDir, ... clean:releaseDir, or just
... clean, which does both.
The release directory is automatically cleaned before packaging
commences.
There are some files in msg/json/ (currently en.json, qqq.json,
constants.json and synonyms.json) that are generated by
scripts/i18n/js_to_json.py as part of the language file build process
- but this only needs to be done when messages.js is updated and
and usually requires some manual cleanup, so remove this step from the
existing buildLangfiles gulp script and create a separate command
('npm run generate:langfiles') to do this when required.
I have verified that
npm run build && npm run package
produces an identical dist/ directory compared to the one produced prior
to this and the previous commit.
Make the destination directories for certain build/package/release
steps more easily (and centrally) configurable.
This only deals with building *_compressed* files;
blockly_uncompressed.js and the various msg/js/*.js files are not
affected by this commit.
A {} has a bunch of names already defined on it (like ‘toString’). When using an object as a map with arbitrary keys, it should not inherit from Object.prototype.