Commit Graph

274 Commits

Author SHA1 Message Date
Maribeth Bottorff
2a2b3b3ac5 chore: change the way we look for upstream remote (#7230)
* chore: change the way we look for upstream remote

* chore: use js instead of shell

thanks christopher

Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>

* chore: store the found upstream name

---------

Co-authored-by: Christopher Allen <cpcallen+github@gmail.com>
2023-08-04 16:41:24 -07:00
Abdul Al-Hasany
5e0390b3ec fix(build): support running Blocky locally on Windows machines (#7281)
* fix: update build path for windows

  When using single quote on windows, e.g. 'build/src', the folder
  are created with a single quote at the beginning `'build` and end
  `src'`. This commit fixes this issue.

* fix: update python command and folder separator

  Ensure that when running on windows, python command is python and
  not python3. Also, separators are normalized to posix style `/` even on
  windows system

* fix: add global PYTHON constant to run python command

* fix: simplify `path.sep` to forwadslash since it is cross-platform

* fix(syntax): replace double quote with single quote
2023-08-02 16:27:04 +00:00
dependabot[bot]
2546b01d70 chore(deps): Bump prettier from 2.8.8 to 3.0.0 (#7322)
* chore(deps): Bump prettier from 2.8.8 to 3.0.0

Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.0.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: Reformat using Prettier v3.0 defaults

The main change is to add trailing commas to the last line of
block-formatted function calls.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christopher Allen <cpcallen+git@google.com>
2023-07-25 14:56:10 +00:00
Beka Westberg
9efc0d7dd0 chore: fix renamings (#7312) 2023-07-20 13:50:12 -07:00
Christopher Allen
1bc4f67d78 fix: Correct errors in HSV_SATURATION, HSV_VALUE accessors (#7297)
* fix: Correct errors in HSV_SATURATION, HSV_VALUE accessors

  Fix the comment / message errors noted in
  https://github.com/google/blockly/pull/7249#issuecomment-1638645810

* chore: Add renamings for HSV_SATURATION, HSV_VALUE
2023-07-17 21:00:06 +01:00
Maribeth Bottorff
fa58cbaaf7 chore: update app engine version names (#7231) 2023-06-30 14:12:48 -07:00
ericblackmonGoogle
4b563c1503 chore: update renamings file for new release (#7219)
* chore: update renamings file for new release

* chore: update renamings file for new release

* chore: update renamings file for new release
2023-06-28 15:20:40 -04:00
Rachel Fenichel
e2cd1bad24 chore: remove js-green-licenses (#7201) 2023-06-27 13:36:06 -07:00
Beka Westberg
b189b1989c chore: deprecate minimalist renderer (#7210)
* chore: deprecate the minimalist renderer

* chore: add renamings
2023-06-26 14:30:06 -07:00
Christopher Allen
7771a6dbff fix(build): Correct typos in PR #7169 (#7197)
Three separate mistakes left only the Python and PHP chunks with
the correct code for the legacy script exports.
2023-06-22 20:35:19 +00:00
Christopher Allen
b6e084257e refactor(blocks): Migrate blocks/blocks.js to TypeScript (#7193)
* refactor(blocks): Auto-migration of blocks/blocks.js to ts

* fix(blocks): Manually migrate & fix types in blocks.ts

* fix(build): Update location of blocks/blocks.ts exports object

* fix(blocks): Remove lint

* chore(blocks): Format
2023-06-21 22:07:20 +01:00
Beka Westberg
5ee9003044 fix: bubble exports (#7189)
* fix: bubble exports

* chore: delete the old bubble
2023-06-21 11:26:22 -07:00
Christopher Allen
130989763c refactor(generators): Restructure generator modules to contain side effects (#7173)
* refactor(generators): Move lang.js -> lang/lang_gernator.js

  Move the LangGenerator definitions into their respective
  subdirectories and add a _generator suffix to their filenames,
  i.e. generators/javascript.js  becomes
  generators/javascript/javascript_generator.js.

  This is to keep related code together and allow the `lang/all.js`
  entrypoints to be moved to the top level generators/ directory.

  No goog module IDs were changed, so playground and test code
  that accesses this modules by filename does not need to be modified.

* refactor(generators) Move lang/all.js -> lang.js

  - Move the entrypoints in generators/*/all.js to correspondingly-named
    files in generators/ instead—i.e., generators/javascript/all.js
    becomes generators/javascript.js.

  - Update build_tasks.js accordingly.

* fix(generators): Add missing exports for LuaGenerator, PhpGenerator

  These were inadvertently omitted from #7161 and #7162, respectively.

* refactor(generators): Make block generator modules side-effect free

  - Move declaration of <lang>Generator instance from
    generators/<lang>/<lang>_generator.js to generators/<lang>.js.
  - Move .addReservedWords() calls from generators/<lang>/*.js to
    generators/<lang>.js
  - Modify generators/<lang>/*.js to export block generator functions
    individually, rather than installing on <lang>Generator instance.
  - Modify generators/<lang>.js to import and install block generator
    functions on <lang>Generator instance.

* fix(tests): Fix tests broken by restructuring of generators

  Where these tests needed block generator functions preinstalled
  they should have been importing the Blockly.<Lang>.all module.

  Where they do not need the provided block generator functions
  they can now create their own empty <Lang>Generator instances.

* chore: Update renamings file

  - Fix a malformation in previous entries that was not detected by
    the renaming file validator test.
  - Add entries describing the work done in this and related recent
    PRs.

* fix: Correct minor errors in PR #7173

  - Fix a search-and-replace error in renamings.json5
  - Fix an incorrect-but-usable import in generator_test.js
2023-06-20 23:22:44 +01:00
Christopher Allen
4adc932ed5 fix(build): Fix GitHub pages & deployment task (#7186)
* fix(build): Include node_modules/@blockly/ in gh-pages branch

  - Add node_modules/@blockly to the list of files added to the gh-pages
    branch.
  - Add a _config.yml file telling Jekyll (which is needed to produce
    the homepage served at https://google.github.io/blockly/, and hence
    can't be disabled with a .nojekyll file instead) not to exclude
    node_modules (which it does by default).

* refactor(build): Modernise git_tasks.js

  - Various style updates:
    - Use CONSTANT_CASE.
    - Use /** JSDoc comments */
    - Use `template ${literals}`.
  - Use git switch instead of git checkout.
  - Try to avoid use of remote names; use URLs where possible.

* refactor(build): Look up upstream git remote

  Since git reset can't take a URL but needs an actual remote name,
  use git branch -v to look up the remote for
  github.com/google/blockly and then use that remote name.

* chores(build): format
2023-06-20 21:50:44 +01:00
Christopher Allen
ace9c4a188 fix(tests): Fix compressed mode loading (#7178)
Due to errors in PRs #7171 and 7173 (and the author's failure to do
enough local testing before submitting those PRs), compressed mode
loading was broken in the playgrounds.  Fix this by:

- Fix a typo in bootstrap.js ("Blocky" -> "Blockly").
- Updating the chunks definitions build_tasks.js to use the new
  variables we expect to contain generator exports objects.
2023-06-20 21:49:26 +01:00
Beka Westberg
d7ccf8a5ee fix: input exports (#7165)
* fix: input exports

* chore: fix build

* chore: attempt to fix build

* chore: attempt to fix build

* chore: create new align enum to replace old one

* chore: format

* fix: Tweak renamings entries

It appears that the goal is to map:

Blockly.Input.Align -> Blockly.inputs.Align
Blockly.Align -> Blockly.inputs.Align
Blockly.ALIGN_* -> Blockly.inputs.Align.*

I believe this commit achieves that in a more minimal (and correct)
way—but if I have misunderstood the intention then this will not
be a useful correction.

---------

Co-authored-by: Christopher Allen <cpcallen+git@google.com>
2023-06-16 11:27:46 -07:00
Beka Westberg
2d3aec45f6 fix: icon exports (#7159) 2023-06-16 10:59:36 -07:00
Christopher Allen
817ffab754 refactor(tests): Update bootstrap.js to better support generator chunks (#7171)
Refactor bootstrap.js and bootstrap_helper.js to be able to deal
with generator chunks.  In particular for each chunk, specify:

- The goog.module ID to goog.require() in uncompressed mode.
- The script filename to load in compressed mode.
- Where the chunk's UMD wrapper will save the export object when
  loaded as a script.
- What global variable the chunk's export object should be saved in
  (if desired).
- Any individual named exports to destructure to global variables.

This allows the bootstrap scripts to be slightly simpler while
also being more flexible.
2023-06-15 21:03:04 +01:00
Christopher Allen
2d97e5aaf1 refactor(build)!: Provide all generator exports when loaded as script (#7169)
Previously, when loading a generator chunk (e.g.,
javascript_compressed.js) as a script (e.g., in a browser using
a <SCRIPT> tag), only a single named export from that chunk would
be made available (e.g, javascriptGenerator would be made availabe
as Blockly.JavaScript).

Until recently, that was fine because each generator chunk had only
a single named export, but now each one additionally has a
<Lang>Generator class and Order enum export.

To allow these new exports to be accessed by script users, the
chunk wrappers are modified to provide the whole export object
at a correspondingly-named global variable—e.g., when loaded as
a script javascript_compressed.js creates a global variable named
javascript, so the named exports can be accessed as
javascript.javascriptGenerator, javascript.JavascriptGenerator
and javascript.Order, as if the user had imported them via

    import * as javascript from 'blockly/javascript';

This PR includes a breaking change and a deprecation, both of
which are only applicable when loading generators as scripts
(e.g. via a <SCRIPT> tag):

BREAKING CHANGE: The generator chunks will, when loaded as scripts
(e.g. via a <SCRIPT> tag, now clobber any existing global variable
of the corresponding name:

- dart_compresed.js will set dart
- javascript_compresed.js will set javascript
- lua_compresed.js will set lua
- php_compresed.js will set php
- python_compresed.js will set python

DEPRECATION: Accessing the generator instances at their previous
locations (Blockly.Dart, Blockly.JavaScript, Blockly.Lua,
Blockly.PHP, and Blockly.Python) is deprecated and may cease
to work in a future version of Blockly.
2023-06-15 16:52:51 +01:00
Beka Westberg
2f74ce822f fix!: refactor mutator icon (#7115)
* feat: add basic mutator icon

* feat: add actual mutation behavior to icon

* chore: add bumping blocks back into the bubble

* fix: add updating block styles

* feat: add static methods to mutator icon

* chore: delete old mutator code

* fix: use the new mutator icon

* chore: docs and format

* chore: my own comments

* chore: first pass at PR comments

* chore: make type strings internal

* chore: add todo

* chore: format

* chore: move properties to module level

* chore: fix using in demos

* chore: move Mutator to icons.MutatorIcon

* chore: move reconnect to connection

* chore: move findParentWs to workspace

* chore: properly override and call super

* chore: remove bubbleIsVisible check

* chore: change imports to import type

* chore: use elvis operator

* chore: update renamings

* chore: reduce changes to js block files
2023-06-02 12:18:41 -07:00
Beka Westberg
50d9474db5 fix!: refactor comment icon (#7128)
* fix: add basic comment icon

* fix: add using comment icon

* chore: delete old comment icon

* chore: add docs to the comment icon

* chore: move Comment to icons.CommentIcon

* chore: mode properties to module level

* chore: properly override and call super

* chore: remove .comment and .commentIcon_

* chore: cleanup test

* chore: deprecate getCommentIcon and getCommentText

* chore: change imports to import type

* chore: refactor code for paren peace

* chore: fix lint and make it error

* chore: remove change to block JS file

* chore: fix css

* chore: add renamings

* chore: format
2023-06-02 09:53:05 -07:00
Beka Westberg
f4e378d096 fix!: refactor warning icon (#7112)
* feat: add basic warning icon

* feat: work on actually using the warning icon

* chore: add docs

* chore: delete old warning icon

* chore: fix build

* chore: my own comments

* chore: move Warning to icons.WarningIcon

* chore: move properties to the module level

* chore: properly override and call super

* chore: properly use optional chaining

* chore: fixup comment typo

* chore: change imports to import type

* chore: reduces changes in block js files

* chore: add renaming
2023-06-02 09:34:34 -07:00
Christopher Allen
3ae4a61842 fix(build): Fix path issue on Windows (#7127)
Fixes #6864.
2023-06-01 13:27:38 +01:00
Christopher Allen
4d2201a427 chore(generators): Migrate generators to ES Modules (#7103)
* feat(j2ts): Add support for migrating renaming imports

  Convert
      const {foo: bar} = require(/*...*/);
  into
      import {foo as bar} from /*...*/;
              ^^^^^^^^^^

  Also fix a bug that caused relative paths to ESM in the same
  directory to be missing a leading "./".

* fix(build): Fix trivial error exports for generators

  The UMD wrapper was inadvertently exporting the contents of (e.g.)
  the Blockly.JavaScript closure module rather than the intended
  export of Blockly.JavaScript.all module - which went unnoticed
  because the latter just reexported the former - but we are
  about to convert the former to ESM.

* chore(generators): Migrate language generators to ESM

  Migrate the main language generators in generators/*.js to ESM.

  This was done by running js2ts on the files, renaming them back
  to .js, and commenting out "import type" statements, which are
  legal TS but not needed in JS (at least if you are not actually
  letting Closure Compiler do type checking, which we are not.)

* chore(generators): Migrate block generators to ESM

  Migrate generators/*/*.js (except all.js) to ESM.

  This was done by running js2ts on the files, renaming them back
  to .js, and removing now-spurious @suppress {extraRequire}
  directives.

* chores(generators): Migrate generator chunk entrypoints to ESM

  This was done by running js2ts on the files, renaming them back
  to .js, and manually fixing the export statements.

  An additional change to the chunk exports configuration in
  build_tasks.js was necessary in order for the UMD wrapper to
  find the new module object, which is given a different name
  than the old exports object.
2023-05-19 23:09:37 +01:00
dependabot[bot]
0afcabe959 chore(deps): Bump @hyperjump/json-schema from 0.23.3 to 1.5.0 (#7079)
* chore(deps): Bump @hyperjump/json-schema from 0.23.3 to 1.5.0

Bumps [@hyperjump/json-schema](https://github.com/hyperjump-io/json-schema) from 0.23.3 to 1.5.0.
- [Commits](https://github.com/hyperjump-io/json-schema/compare/v0.23.3...v1.5.0)

---
updated-dependencies:
- dependency-name: "@hyperjump/json-schema"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(tests): Compatibility updates to validate-renamings.js

A minimal set of updates to validate-renamings.js to make it
compatible with @hyperjump/json-schema v1.5.  The main difference
is that that package now ships ESM rather than CJS modules,
forcing the script to use import rather than require, with
various knock-on effects (no __dirname variable, must be named
*.mjs, etc.)

* chore(tests) Remove unneeded IIFE

* chore(tests): Additional tidy-up of ESM version

Now that validate-renamings is an ES module, we can do some other
cleanup to it.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christopher Allen <cpcallen+git@google.com>
2023-05-18 18:47:04 +01:00
Rachel Fenichel
8b635ab43a chore: remove sortrequires task (#7074) 2023-05-11 11:35:45 -07:00
Maribeth Bottorff
88ff901a72 chore: use prettier instead of clang-format (#7014)
* chore: add and configure prettier

* chore: remove clang-format

* chore: remove clang-format config

* chore: lint additional ts files

* chore: fix lint errors in blocks

* chore: add prettier-ignore where needed

* chore: ignore js blocks when formatting

* chore: fix playground html syntax

* chore: fix yaml spacing from merge

* chore: convert text blocks to use arrow functions

* chore: format everything with prettier

* chore: fix lint unused imports in blocks
2023-05-10 16:01:39 -07:00
Christopher Allen
60a2358cd7 chore(build): Delete chunks cache file chunks.json (#7011)
This file should have been deleted in PR #6222 but was somehow
overlooked.
2023-04-24 21:27:22 +01:00
dependabot[bot]
7feefa44d0 chore(deps): bump rimraf from 4.1.2 to 5.0.0 (#6986)
* chore(deps): bump rimraf from 4.1.2 to 5.0.0

Bumps [rimraf](https://github.com/isaacs/rimraf) from 4.1.2 to 5.0.0.
- [Release notes](https://github.com/isaacs/rimraf/releases)
- [Changelog](https://github.com/isaacs/rimraf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/rimraf/compare/v4.1.2...v5.0.0)

---
updated-dependencies:
- dependency-name: rimraf
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): Update imports of rimraf for compatibility with v5.0.0

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christopher Allen <cpcallen+git@google.com>
2023-04-21 16:02:07 +01:00
Beka Westberg
ba208037c0 chore: update renamings file for 2023 Q1 release (#6932) 2023-03-29 10:09:58 -07:00
Christopher Allen
42e838621d chore(build): Temporarily exclude blocks and generators .d.ts files (#6930)
Temporarily exclude the generated .d.ts files for blocks/* and
generators/* from the package.

This will in due course replace the (very simplistic) hand-written
versions in typings/, but for now they are not referenced
anywhere a developer's tooling should be looking, and contain
in some cases actually incorrect typings (e.g., in unmigrated
blocks files, the blocks export is typed as ObjectConstructor,
which is wrong), so do not include them in the package least they
cause problems for the unwary.
2023-03-28 22:30:08 +01:00
Maribeth Bottorff
a7c342ec29 chore: force add the build files when updating gh-pages (#6904) 2023-03-17 12:36:48 -07:00
Neil Fraser
42fde0f81b chore: Reduce delta on ports to blockly-samples (#6886)
* Reduce usage of obsolete .keyCode property.
* Rename private properties/methods which violate eslint rules.
* Use arrays of bound events rather than individual properties.
* Improve typing info.
* Also fix O(n^2) recursive performance issue in theme's getComponentStyle function.
* And replace String(...) with '${...}' (smaller, faster).
* .toString() is considered harmful.
2023-03-15 13:28:57 -07:00
Tim Gates
0a1096262f docs: Fix a few typos (#6878)
There are small typos in:
- closure/goog/base.js
- demos/minimap/minimap.js
- gulpfile.js
- scripts/gulpfiles/build_tasks.js
- scripts/gulpfiles/cleanup_tasks.js
- scripts/gulpfiles/license_tasks.js

Fixes:
- Should read `prerequisites` rather than `prequisites`.
- Should read `satisfies` rather than `satisifies`.
- Should read `regenerates` rather than `regenrates`.
- Should read `minimap` rather than `mimimap`.
- Should read `diagnostic` rather than `disagnostic`.

Signed-off-by: Tim Gates <tim.gates@iress.com>
2023-03-14 05:15:37 -07:00
Christopher Allen
f90a2531a7 feat(build): Run tsc on blocks/ and generators/ (#6836) 2023-02-15 13:10:27 -08:00
Christopher Allen
ddd38a411a chore: Create script to help with js -> ts migration (#6837) 2023-02-10 18:54:26 +00:00
Blake Thomas Williams
13fe6eeccf feat: added tests/typescript to test supported TS examples (#6775)
* feat: added `tests/typescript` to test supported TS examples

* fix: update the test name, description, and output

* chore: remove unused imports in `test_tasks.js`

* fix: wrap README line at 80 characters

* fix: implemented `different_user_input.ts` feedback

* fix: correct mistaken comments

* chore: rename `./eslintrc.json` to `./eslintrc.js`

* feat: added linting for tests/typescript

* chore: cleanup eslintrc lines over 80 characters

* fix: updated `.eslintrc.js` to provide an override for linting itself

* fix: updated tests to build to the `build` directory

* feat: updated `gulp format` to handle formatting `.eslintrc.js`

* fix: updated `.eslintrc.js` to align with both formatter and linter

* fix: updated config comment wording

* fix: removed quotes for valid identifiers

* Revert "fix: removed quotes for valid identifiers"

  This reverts commit 03eff91aea1468e503bc79a90fb139914d3f39d2.
2023-02-10 17:12:18 +00:00
Neil Fraser
90217360c7 fix: Fire deletion events when clearing variables. (#6827)
https://groups.google.com/g/blockly/c/l_vUnrGSJ0M
2023-02-07 21:20:01 +01:00
Christopher Allen
167e26521c refactor: Remove last remaining circular import in core/ (#6818)
* refactor(xml): Move textToDom to core/utils/xml.ts

  This function being in core/xml.ts was the cause for the last
  remaining circular import in core/ (between variables.ts and
  xml.ts).

  Moving it to utils/xml.ts makes sense anyway, since there is
  nothing Blockly-specific about this function.

  Fixes #6817.

* fix(closure): Reenable goog.declareModuleId multiple-call check

  Reenable an assertion which check to make sure that
  goog.declareModuleId is not called more than once in a module
  (and which also catches circular imports amongst ES modules, which
  are not detected by closure-make-deps).

* chore(tests,demos): Augo-migrate use of textToDom

  Testing the migration file entry by auto-migrating all uses of
  Blockly.Xml.textToDom to Blockly.utils.xml.textToDom.

* chore(blocks): Manually migrate remaining use of textToDom

  Update the one remaining call to textToDom (in blocks/lists.ts)
  to the function's new location - also removing the last use of
  the Blockly.Xml / core/xml.ts) module from this file.

* docs(xml): Remove unneeded @alias per comments on PR #6818

* fix(imports): Remove unused import
2023-02-07 12:11:11 +00:00
Christopher Allen
a7f498a6a0 fix(build): Fix event tests, improve buildDeps (#6773)
* fix(tests): Fix errors in event tests
  - Fix actual syntax errors in imports in event_marker_move_test.js
    and event_selected.test.js, which were preventing those tests from
    being run.
  - Remove suite.only directives in those tests that would prevent
    all the other tests from running.

* refactor(build): Improve buildDeps

  - Run closure-make-deps only once, instead of separately for core/
    and tests/.

  - Specify a larger exec maxBuffer size, to ensure output and
    diagnostics are not truncated.

  - Change stderr filtering in buildDeps to filter out bounded
    generics messages and blank lines.

  - Attempt to suppress warnings in stderr output when
    closure-make-deps returns a non-zero exit code.

    Unfortunately, there seems to be a race condition which usually
    the stderr argument to the exec callback not to contain the
    complete output, so in that case print a helpful message.

  - Have buildDeps just return a Promise instead of using a callback.

* fix(docs): Typo fix in JSDoc for log helper
2023-01-26 20:09:19 +00:00
Maribeth Bottorff
86f3fde69c chore: add a pretty summary to CI (#6780) 2023-01-18 10:31:56 -08:00
dependabot[bot]
ee51c0f41c chore(deps): bump rimraf from 3.0.2 to 4.0.7 (#6778)
* chore(deps): bump rimraf from 3.0.2 to 4.0.7

Bumps [rimraf](https://github.com/isaacs/rimraf) from 3.0.2 to 4.0.7.
- [Release notes](https://github.com/isaacs/rimraf/releases)
- [Changelog](https://github.com/isaacs/rimraf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/rimraf/compare/v3.0.2...v4.0.7)

---
updated-dependencies:
- dependency-name: rimraf
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: fix use of rimraf

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Beka Westberg <bwestberg@google.com>
2023-01-18 13:16:40 +00:00
Aaron Dodson
e89fcea02c fix: Make metadata tests more resilient. (#6771)
* fix: Make metadata tests more resilient.

* fix: improve control flow and clarify xargs purpose.
2023-01-17 08:32:05 -08:00
Maribeth Bottorff
59c7cb941b fix: Increase generator test timeout (#6776) 2023-01-17 16:17:46 +00:00
Christopher Allen
cd57e74d1a fix(deps): Don't use global variables for jsdom injection in scripts/package/node/core.js and core/utils/xml.ts (#6764)
* fix(node): Don't use global variables for jsdom injection

Introduce a (hopefully generally applicable) mechanism for
injecting dependencies into modules, specifically in this case
to inject required bits of JSDOM's Window and Document
implementations into core/utils/xml.js when running in
node.js or other environments lacking a DOM.

The injectDependencies function uses an options object to
facilitate optionally injecting multiple named dependencies
at the same time.

Rename the xmlDocument local variable back to document (was
renamed in #5461) so that the name used in this module
corresponds to the usual global variable it replaces.

Change the injection in scripts/package/node/core.js to use
injectDependencies instead of setXmlDocument + global variables;
also eliminate apparently-unnecessary creation of a special
Document instance, using the default one supplied by jsdom
instead.

Fixes #6725.

* deprecate(xml): Deprecate getXmlDocument and setXmlDocument

Mark getXmlDocument and setXmlDocument as @deprecated, with
suitable calls to deprecation.warn().

There are no remaining callers to either function within core -
setXmlDocument was only used by the node.js wrapper, and and
apparently getXmlDocument was never used AFAICT - and we do not
anticipate that either were used by external developers.

* fix: Corrections for comments on PR #6764.
2023-01-12 15:31:53 -08:00
Maribeth Bottorff
d1d60c4629 fix: CI exits properly after failure (#6763)
* fix: CI exits properly after failure

* fix: remove useless async
2023-01-12 12:52:14 -08:00
Christopher Allen
3be3d4a6ff chore: miscellaneous fixes to docs, style, and tests (#6705)
* docs(icon): Better description for Icon.prototype.setVisible

  Also tweak description of getBlock.

* docs(blocks): Fix typo in description of BlockDefinition

* chore(tests): Factor out common goog:chromeOptions

* chore(build): Minor style fixes
2022-12-14 23:48:12 +00:00
Christopher Allen
e3c04978f3 chore(build): Remove prepare script; run deps script from start script (#6653)
To make `npm install` and `npm ci` faster, and to avoid redundant
work when doing either of these followed by `npm run build` (or
any other script which does a build), delete the `prepare`
script and instead add an invocation of `npm run deps` to the
beginning of the `start` script.
2022-12-08 16:32:25 +00:00
Christopher Allen
983a8be441 fix(appengine): Restore build products to previous location (#6687)
Modify the prepareDemos script to copy the messages and compressed
files to their previous locations in the deploy directory, to
fix 404 errors on devsite that we can't immediately fix by pushing
devsite.
2022-12-07 19:43:50 +00:00
Aaron Dodson
90cb965e7c refactor: Migrate to PointerEvents (#6598)
* refactor: Remove checks for PointerEvent support.

* refactor: Deprecate and remove calls to splitEventByTouches.

* refactor: Deprecate and remove calls to setClientFromTouch().

* refactor: Use PointerEvent in place of Event/MouseEvent/TouchEvent/PseudoEvent.

* refactor: Update references to mouse/touch events in code and documentation to reference pointer events.

* refactor: Merge Gesture and TouchGesture

* chore: clang-format changed files

* refactor: Bind and expect PointerEvents instead of MouseEvents.

* refactor: Rename TouchGesture to Gesture.

* fix: Fix test failures.

* chore: clang-format changed files.

* fix: Fix errant _ from merging

* refactor: Clean up dead code in browser_events.ts.

* chore: Update version in deprecation notices to reflect release schedule

* fix: Fixed a bug that caused the browser context menu to not be suppressed in Chrome.

* fix: Re-export Gesture as TouchGesture for backwards compatibility.

* refactor: Deprecate and remove uses of opt_noPreventDefault.

* chore: Fix error message in gesture.ts.

* chore: Removed obsolete todo.
2022-12-05 11:27:52 -08:00