* chore: add variable map tests
* chore: move firing create events into the variable map
* feat: add early returning in the case of noop renames
* chore: format
* Add tsick.js to rewrite enums.
tsc generates JavaScript which is incompatible with the Closure Compiler's advanced optimizations.
* Remove unused 'outputCode' variable.
* Rename 'run_X_in_browser.js' to 'webdriver.js'
The Mocha and generator tests can both be run either manually or via our webdriver. In all cases they run in a browser. These two 'run_X_in_browser.js' files only apply to webdriver, thus they are confusingly named.
Also delete completely unused (and broken) `run_all_tests.sh`
* Linting improvements to mocha/webdriver.js
Still not at 100%. Complains about require/module/process/__dirname not being defined in multiple places.
* runTestBlock -> runTestFunction
'Block' means something very different in Blockly.
* Removal of `var` from scripts.
* Add webdriver test to verify compile test worked.
* Resolve conficts with 'develop'.
* Address PR comments.
The bash script tests/run_all_tests.sh was deleted in PR #6431, where
it was replaced by scripts/gulpfiles/test_tasks.js, but it was
inadvertently resurrected by PR #6475, apparently due to an error when
manually resolving conflicts for merge commit 00676ed.
Begone, undead script!
* feat: add new path for deserialization of events
* chore: add tests for round-tripping events
* chore: add static fromJson methods to all events
* chore: add inline docs to new static methods
* chore: add deprecation warnings
* chore: cleanup
* chore: add deprecation and docs to abstract
* chore: format
* chore: cleanup from rebase
* chore: update docs comment
* chore: move comments
* chore: remove underscores from private property names
* chore: remove underscores from properties and methods in insertion marker manager
* chore: format
* chore: track closestConnection and localConnection as a single object
* chore: format
* chore: add comments and simplify shouldUpdatePreviews
* chore(docs): add jsdoc for new params
* chore: use destructuring assignments
* chore: improve readability
* chore: address review feedback
* chore: respond to review feedback
* chore: fix types in shouldDelete
* chore: make wouldDeleteBlock a property
* chore: format
* chore: add basic tests
* chore: add assertion explanations
* chore: define some additional tests
* chore: add tests for not firing when not added to map
* chore: add better assertions for not firing events
* chore: change the order of return type tests
* chore: skip tests
* test: make sure the insertion marker manager creates the correct number of markers
* test: add more tests for insertion marker manager
* chore: format
* test: respond to pr feedback
* test: make test names more descriptive
* test: add row_to_stack test block
* feat(build): Make build tasks invoke their prerequisites
- Divide gulp targets into three kinds: main sequence,
manually invokable, and script-only. The first two categories
automatically invoke their prerequisites.
- Give (most of) the affected gulp targets shorter and more memorable
names that could become their npm script names in future.
* feat(build): Make package tasks invoke their prerequisites
Have the package task invoke the cleanBuildDir (as well as
cleanPackageDir) and build tasks. Remove the checkBuildDir
task as it is now redundant since a fresh build is done every
time.
* feat(build): Make git tasks invoke their prerequisites
* feat(build): Make cleanup, license [sic] tasks invoke their prerequisites
Turns out they don't have any, so this commit just classifies
their gulp targets according to the established scheme.
* feat(build): Make appengine tasks invoke their prerequisites
In this case prepareDeployDir will eventually depend on package
but does not for now.
* feat(build): Have npm scripts run npm ci first where applicable
Have any npm script that have external effects (e.g. publishing an
npm package, pushing a new version to appengine, or updating GitHub
Pages) start by running npm ci to ensure that all dependencies are
up-to-date with respect to package-lock.json.
(This is done by npm and not a gulp script because gulp itself
might need updating. So might npm, but that is less likely to
make any difference to what gets published/pushed.)
* chore(build): have tests use package target
Have the tests just run the package target (with debug flags)
since that runs the the build target automatically.
* feat(tests): Write Closure Compiler output directly to dist/
Since they are already UMD-wrapped, have Closure Compiler write
output chunks directly to RELEASE_DIR, i.e. dist/.
* chore(tests): Use freshly-build files in compressed mode.
Use the freshly-built build/*_compresssed.js files when bootstrapping
in compressed mode, rather than using the checked-in files in the
repository root.
This helps ensure that compressed and uncompressed mode will be
testing (as closely as possible) the same code.
Obsoletes #6218 (though the issues discussed there have not actually
yet been addressed in this branch).
* chore(build): Write intermediate langfiles to build/msg
Write the results of create_messages.py to build/msg instead of
build/msg/js.
* fix(build): Use build/msg/en.js instead of msg/messages.js in tests
This has no direct effect but fixes a long-standing misdesign
where we are testing against the input to, rather than the output
of, the language file processing pipeline.
* feat(demos): Use freshly-built files
Use the freshly-built dist/*_compresssed.js and build/msg/* files
rather than using the checked-in files in the repository root.
This helps ensure that these demos are using the most recent
version of Blockly (even in the develop branch).
* fix(build): Update appengine deployment to include built files
Modify the prepareDemos task as follows:
- Use the git index instead of HEAD, so that most local changes
will be applied (without copying whatever .gitignored cruft
might be in the local directory).
- Run clean and build and then copy build/msg and
dist/*_compressed.js* to the deploy directory.
This fixes the problem created by the previous commit, wherein the
demos relied on built files that were not being deployed to
appengine.
* fix(build): Update GitHub Pages deployment to include built files
Modify the updateGithubPages task to run clean and build and
then git add build/msg dist/*_compressed.js*, so that they will
be included in the deployed pages.
This fixes the problem created by the previous^2 commit,
wherein the demos relied on built files that were not being
deployed to GitHub Pages.
* chore(build): Remove build products from repository
Remove *_compressed.js* and msg/js/* from the blockly repository.
Also remove the now-obsolete checkinBuilt gulp task.
* chore(build): Apply relevant changes to test_tasks.js
Apply changes made to run_all_tests.sh and check_metadata.sh to
the corresponding parts of their JS replacements in
test_tasks.js.
* chore(build): Make updates suggested in PR #6475
- Remove `clean:builddir` and `clean:releasedir` - `clean`
is sufficient.
- Remove duplicate `require` from `appengine_tasks.js`.
* feat(build): Use shorter npm script names
Since scripts that run build tasks now automatically run their
prerequisite tasks, the previous naming scheme of task `build`
running all the `build:subtask`s no longe really makes very
much sense.
Additionally, following a chat discussion, there seems to be a
rough consensus to use "messages" to refer to the .json input
files, and "langfiles" to the generated .js output files.
Consequently, simplify npm script names by renaming as follows:
- "generate:langfiles" -> "messages"
- "build:langfiles" -> "langfiles"
- "build:js" -> "tsc"
- "build:deps" -> "deps"
- "build:compiled" -> "minify"
- "build:compressed": delete this synonym for "build:compiled",
("minify" was chosen as agnostic to Closure Compiler vs. WebPack.)
* chores(build): Add deprecation notice for old scripts
To reduce potential confusion/frustration, restore the previous
npm scripts but have them display a deprecation notice instead
(note that npm prints the script contents before running it, so
echo is not needed).
* docs(build): Add comments distinguishing 'messages' from 'langfiles'
* chore: remove underscores from properties and methods in comment.ts
* chore: remove some underscores from icon-related classes
* chore: cleanup
* chore: respond to PR feedback
* chore: catch one more bit of PR feedback
* build: build/test on windows
* chore(deps): bump @hyperjump/json-schema from 0.18.4 to 0.18.5
* chore(deps): add gulp-gzip 1.4.2
* build: migrate test scripts to gulp task (test_tasks.js)
* build: not to use the grep command
* build: normalize path
* fix: Modified based on review suggestions.
* Add JSDoc comment
* Line length <= 80 characters.
* Formatting test output as previously.
* Always continue even if a test unit fails.
* Suppress the gulp messages.
* Fix test_tasks.js to pass eslint.
* fix: Modified based on review suggestions.
* Change generator test output directory.
* Formatting test output as previously.
* fix: Formatting test output as previously.
* fix: Modified based on review suggestions.
* fix: expand the IParameterModel interface
* fix: remove support for return types from the concrete procedure model
* feat: add an interface for the procedure map, and add getting procedures
* fix: add procedure map to workspace
* chore: format
* fix: add name parameter to procedure model to match parameter model
* chore: format
* chore: fix comments
* chore: add tests for the backing variable of parameter models
* chore: update existing procedure map tests
* chore: update block update tests to use refactored API
* chore: update tests to actually use fluent API
* chore: format
* chore: fix tests
* chore: reorganize tests
* chore: format
* chore: add comment
* fix: feedback on procedure model implementations
* chore: format
* chore: add tests for the backing variable of parameter models
* chore: update existing procedure map tests
* chore: update block update tests to use refactored API
* chore: update tests to actually use fluent API
* chore: format
* chore: fix tests
* chore: reorganize tests
* chore: format
* chore: add comment
* Remove usages of utils.dom.add/removeClass from Blockly Factory
* Use template strings for error messages.
(Random stuff found while working on something larger.)
* chore: rename properties to remove underscores in zoom_controls.ts
* chore: remove underscores from private methods in zoom_controls.ts
* chore: fix underscores in private property names in ws_svg
* chore: format
* fix: disposing of a workspace that has overwritten shadows
* fix: try slightly different placement to fix tests
* fix: add disposing parameter to guaruntee consistent behavior
* chore: wrap properties in a isDeadOrDying method
* chore: make disposing private
* chore: remove radix from parseInt
Previously any number starting with '0' would be parsed as octal if the radix was left blank. But this was changed years ago. It is no longer needed to specify a radix.
* chore: 'ID' is identification
'id' is a part of Freud's brain.
* Use Unicode characters instead of codes
This is in line with the current style guide.
* Simplify Blockly.utils.dom methods.
classList add/remove/has supports SVG elements in all browsers Blockly supports (i.e. not IE).
* refactor: Remove uses of AnyDuringMigration from flyout_vertical.ts.
* refactor: Remove uses of AnyDuringMigration in flyout_horizontal.ts.
* refactor: Remove uses of AnyDuringMigration from zoom_controls.ts.
* refactor: Remove uses of AnyDuringMigration from comment.ts.
* refactor: Remove uses of AnyDuringMigration from dialog.ts.
* refactor: Remove uses of AnyDuringMigration from icon.ts.
* refactor: Remove uses of AnyDuringMigration from scrollbar_pair.ts.
* refactor: Remove uses of AnyDuringMigration from workspace_audio.ts.
* refactor: Remove uses of AnyDuringMigration from workspace_drag_surface_svg.ts.
* feat!: allow blocks to receive their own delete events
* fix: move block tests back into main directory
* chore: add a test for disposing of callers
* chore: add test for delete being received
* chore: add comment about why we have to run the clock twice
* chore: fix whitespace
* chore: fix whitespace
* chore: fix imports in tests
* chore: bump mocha timeout
* chore: bump timeout again?
* chore: eliminate the possibility that tests are actually timing out
* chore: change timeout back
* chore: remove tests that might be the problematic ones
* chore: attempt enabling delete event test
* chore: enable lists tests
* chore: try ternary test as well
* chore: actually add block test files
* chore: enable remaining tests
* refactor: Convert objects to sets and maps
* refactor: Use maps instead of objects in workspace.ts.
* refactor: Use maps instead of objects in theme_manager.ts.
* refactor: Use maps instead of objects in block_svg.ts.
* refactor: Use sets instead of objects in variables.ts.
* refactor: Use maps instead of objects in marker_manager.ts.
* refactor: Use maps instead of objects in touch_gesture.ts.
* refactor: Use maps instead of objects in variable_map.ts.
* refactor: Use maps and sets instead of objects in path_object.ts.
* refactor: Use maps instead of objects in shortcut_registry.ts.
* refactor: Use a map instead of an object in workspace_audio.ts.
* refactor: Use better ivar names and enforce the singleton ShortcutRegistry object and type.
* refactor: Use public API in the shortcut registry test.
* refactor: Simplify implementation of getAllVariableNames().
* refactor: Remove unnecessary emptiness check in block_svg.ts.
* fix: clang-format variable_map.ts.
* chore: change goog.module to goog.declareModuleId
* chore: change test helper exports to esmod exports
* chore: change test helpers to use esmodule imports
* chore: convert imports of test helpers to esmodule imports
* chore: convert other imports in tests to esm imports
* fix: make imports use built files
* chore: add blockly imports to a bunch of tests
* fix: reference Blockly.Blocks instead of Blocks'
* fix: properly import generators
* chore: fix lint
* chore: cleanup from rebase
* chore: cleanup from rebase
* chore: fix blocks tests