Commit Graph

314 Commits

Author SHA1 Message Date
Christopher Allen
f9d0caa112 Migrate core.global.js to named exports (#5451)
This is part of #5153 but is being prioritised because we want remove
the declareLegacyNamespace calls from the core/utils/*.js modules and
then reexport them explicitly via utils.js, and it turns out that
doing so results in the exports object of this module being passed to
Object.freeze - which fails on the global object, which can't be made
non-extensible!

The new name chosen for the former default export is globalThis, since
it is intended to have the same value as the global variable of that
name; see:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis
2021-09-14 14:39:29 +01:00
Christopher Allen
a6471c4276 Rename Blockly.utils.IdGenerator to idGenerator and move Blockly.utils.genUid to there (#5441)
* Rename Blockly.utils.IdGenerator -> idGenerator
* Move genUid from Blockly.utils to Blockly.utils.idGenerator
2021-09-09 17:08:44 +01:00
Christopher Allen
24d73be1c3 docs: Create renamings.js to collect renamed API entries (#5426)
Create a file scripts/migration/renamings.js to collect information about renamed API entries. Start by filling it with the renamings already done to blockly.js.
2021-09-03 17:57:31 +01:00
Maribeth Bottorff
744e0ecb3d Quiet the typings script unless you tell it to be verbose. (#5362) 2021-08-13 12:58:18 -07:00
Maribeth Bottorff
50e470ccb1 Quiet the typings script unless you tell it to be verbose. (#5359) 2021-08-12 10:15:35 -07:00
Christopher Allen
4c40378b9a Use goog.requireType when importing interfaces (etc.) (#5343)
* Use goog.requireType when importing I* interfaces

Interfaces have no code, so should never be referred to outside of
(JSDoc) comments, and so the modules that define only interfaces never
need to be goog.require'd - goog.requireType is always sufficient.

This commit fixes imports of all modules whose name matches
/(.*\.)?I[A-Z]*/ - i.e., the hungarian-notation named ones in
core/interfaces/.

* Use goog.requireType when only using import for type specifications

Where a module is imported only to used in JSDoc comments it can
(and should) be goog.requireType'd instead of goog.require'd.

* Remove spurious eslint-disable no-unused-vars

There were a few cases where modules were being imported with
goog.require (because they are referred to in code, not just JSDoc
comments) but were prefaced by a spurious eslint suppress.

Remove these, restoring the invariant that an import gets an eslint
if and only if it is a requireType.

* Remove obsolete Closure Compiler error group

stricterMissingRequire has been superceded by missingRequire, and now
causes a Java null pointer exception if supplied.
2021-08-11 18:50:45 +01:00
kozbial
2a62c06a92 Update script to use python3 command 2021-08-10 16:43:08 -07:00
Neil Fraser
52d280e615 Recompile of JSON to JS messages.
Delete unused Klingon message.
Remove '.' from message that confusingly appears after a filename.
2021-08-05 10:39:22 -07:00
kozbial
c74c1bf416 wording update 2021-07-29 15:24:45 -07:00
kozbial
34042519f4 Add regex lookarounds to check for require overlaps 2021-07-29 15:24:45 -07:00
kozbial
87a714fff8 Add handling for modules that are not leaf nodes 2021-07-29 11:29:51 -07:00
kozbial
311373230f Fix help log 2021-07-29 09:25:55 -07:00
kozbial
7495fad6b3 Add missing period and fix typo 2021-07-27 11:54:17 -07:00
kozbial
3fbbedf6f1 Fix typos and update wording again 2021-07-27 11:54:17 -07:00
kozbial
f64e8df486 Update wording 2021-07-27 11:54:17 -07:00
kozbial
636cd58add Add comment to top of convert-file script for reference to syntax used throughout the file 2021-07-27 11:54:17 -07:00
Monica Kozbial
1360b5bb49 Apply fixes for convert-file script (#5206) 2021-07-23 18:10:38 -07:00
Monica Kozbial
96ec93f91e Remove deconstructing properties and update logic (#5202) 2021-07-23 14:52:42 -07:00
Monica Kozbial
9d29bff713 Ask before deconstructing properties for a require (#5169) 2021-07-22 10:01:41 -07:00
Monica Kozbial
720059e502 Fix bugs (#5175) 2021-07-22 09:59:02 -07:00
Monica Kozbial
efdc9e3afa Support filepath as first argument and cleanup (#5168) 2021-07-22 09:11:54 -07:00
Monica Kozbial
96420f0daf Add command to deploy beta version of demos (#4958) 2021-07-21 11:53:52 -07:00
kozbial
8d6f2626cd Remove command to add missing nullability modifiers 2021-07-20 19:02:36 -07:00
kozbial
e6817778db fix formatting and help 2021-07-20 19:02:36 -07:00
kozbial
5e3209b6f5 Remove extra logging line 2021-07-20 19:02:36 -07:00
kozbial
972f9bc386 Fix bugs caused by Blockly being a require 2021-07-20 19:02:36 -07:00
kozbial
b2ed132ebb Fix bug where script was incorrectly reporting missing requires 2021-07-20 19:02:36 -07:00
kozbial
edfb87fd61 Update more grep calls 2021-07-20 15:48:44 -07:00
kozbial
41eead78ff Update grep calls 2021-07-20 15:48:44 -07:00
kozbial
89e4151810 Update commands to be OSX compatible 2021-07-20 15:48:44 -07:00
kozbial
5f5b437025 Add script for partially automating goog.module conversion steps 2021-07-20 15:48:44 -07:00
Christopher Allen
2bdf2627af Configure eslint and Closure Compiler to accept ES6 2021-07-13 23:54:36 +01:00
Christopher Allen
d313ec804a Merge branch 'develop' into goog.module-prep
This resolves a conflict in `blockly_uncompressed.js`, and missing
updates to `test/deps.js`, caused by PR #5041.
2021-07-13 22:16:35 +01:00
Christopher Allen
c42c5e72b4 Remove obsolete TODO
No more `execSync('mkdir -p')` so no more need to check if it works on
Windows.
2021-07-13 16:11:54 +01:00
Christopher Allen
ebd6559822 Fix incorrectly-reverted change to mkdirSync call
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.
2021-07-13 16:11:54 +01:00
Christopher Allen
85b50fcb73 Use fs.mkdirSync instead of execSync('mkdir -p ...')
Also consistently use {recursive: true} in case directory is nested
in an also-not-yet-existent directory.
2021-07-13 16:11:54 +01:00
Christopher Allen
f5a9f2cf2b Load dependency graph from tests/deps.js in uncompiled mode
* 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)
2021-07-12 02:28:09 +01:00
Christopher Allen
6ccff4431d Fix line lengths
Including by using the node_modules/.bin/closure2ts wrapper provided by
typescript-closure-tools instead of running the source .js directly.
2021-07-10 13:02:47 +01:00
Sam El-Husseini
6136d93cdf Fix msg typings script and move to typings build directory 2021-07-10 13:02:47 +01:00
Christopher Allen
c45929db22 Rename internal recompile function to rebuildAll 2021-07-09 23:08:59 +01:00
Christopher Allen
ffd0252947 Merge branch 'develop' into build-elsewhere
Fix conflict in package.json.
2021-07-09 14:13:23 +01:00
Christopher Allen
9e72378b69 Finish renaming BUILD_DIR; make tests more error-prone
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.
2021-07-09 14:06:59 +01:00
Christopher Allen
1e4fa8005a Fix comment TODO formatting. 2021-07-08 17:29:26 +01:00
Christopher Allen
311b2c16d8 Rename BUILD_DIR to "build" (was "built")
Per discussion in PR #4968, the dirname "build" is widely used for
this purpose.
2021-07-08 16:55:15 +01:00
Christopher Allen
ec14cc3ed8 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.
2021-07-08 16:34:50 +01:00
Rachel Fenichel
23602bb177 Initial commit for appengine deploy action 2021-07-07 17:57:48 -07:00
Christopher Allen
e6929decde Also check in sourcemaps
The .js.map files generated by buildCompressed, buildBlocks etc. were
not being copied back by checkinBuilt.
2021-07-07 15:36:39 +01:00
Christopher Allen
37ecce8d80 Have npm run typings use built directory; fix typescript tests
* 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.
2021-06-30 15:34:54 +01:00
Christopher Allen
1aa35ef438 Merge branch 'develop' into build-elsewhere 2021-06-29 16:22:13 +01:00
Christopher Allen
c521fa9bfa Fix release process
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.
2021-06-23 13:11:29 +01:00