Commit Graph

5909 Commits

Author SHA1 Message Date
Christopher Allen
2bdf2627af Configure eslint and Closure Compiler to accept ES6 2021-07-13 23:54:36 +01:00
Christopher Allen
8b81043a54 Merge pull request #5019 from cpcallen/goog.module-prep
Preparation for goog.module transition: base.js, deps.js
2021-07-13 22:21:34 +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
jschanker
de1b3214be Enforce connection preconditions for setParent (#4999)
* Fix error conditions for setParent #4989

* Error now thrown when calling `a.setParent(b)` on non-null b if the output/previous connection of a is not connected to an input/next connection of b without removing block from old parent's child list.
* Commented out error for when calling `a.setParent(null)` if a is connected to superior block.
* Adjusted comment to reflect that blocks were no longer being disconnected in this method.
* Also changed == to === per #4924 (`newParent` and `this.parentBlock_` must both be instances of `Blockly.Block`).

* Fix error conditions for setParent #4989

* Error now thrown when calling `a.setParent(b)` on non-null b if the output/previous connection of a is not connected to an input/next connection of b without removing block from old parent's child list.
* Error now thrown when calling `a.setParent(null)` if a is connected to a superior block.
* Adjusted comment to reflect that blocks were no longer being disconnected in this method.
* Also changed == to === per #4924 (`newParent` and `this.parentBlock_` must both be instances of `Blockly.Block`).

* Fix error conditions for setParent #4989

* Error now thrown when calling `a.setParent(b)` on non-null b if the output/previous connection of a is not connected to an input/next connection of b without removing block from old parent's child list.
* Commented out error for when calling `a.setParent(null)` if a is connected to superior block.
* Adjusted comment to reflect that blocks were no longer being disconnected in this method.
* Also changed == to === per google#4924 (`newParent` and `this.parentBlock_` must both be instances of `Blockly.Block`).
* Fixed lint errors.

* Fix error conditions for setParent google#4989

* Error now thrown when calling `a.setParent(b)` on non-null b if the output/previous connection of a is not connected to an input/next connection of b without removing block from old parent's child list.
* Commented out error for when calling `a.setParent(null)` if a is connected to superior block.
* Adjusted comment to reflect that blocks were no longer being disconnected in this method.
* Also changed == to === per google#4924 (`newParent` and `this.parentBlock_` must both be instances of `Blockly.Block`).
* Fixed lint errors.
* Adjusted comment.

* Removed unnecessary set to null/added tests

* One is failing (commented out), will investigate later

* Lint fix

* Removed failing test that correctly fails

* Update comments to conform to style guide

Capitalize first letter, period at end
2021-07-13 13:56:42 -07:00
alschmiedt
2b6b89dc54 Remove themes that were moved to blockly samples (#5041) 2021-07-13 13:31:27 -07:00
Monica Kozbial
0af6bc4b01 Remove unused parameters from test helpers (#5032) 2021-07-13 13:13:06 -07:00
Christopher Allen
ec3da1e415 Update package-lock.json to lockfileVersion 2 2021-07-13 21:08:47 +01:00
Monica Kozbial
e2d0498db2 Add flag to webdriverio options (#5035)
* Add flag to webdriverio options

* update indentation of code
2021-07-13 09:31:21 -07: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
7d306f4089 Don't lint build output
npm test has been failing if previous build output was present,
because the generated build/msg/??.msg files are missing a trailing
newline and the line to exclude build/* from being linted was
inadvertently omitted from commit 9e72378.

(Much of the rest of the build output would also fail lint checks but
was already excluded by the *_compressed*.js exclusion.)
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
948fade7c5 Only disable eslint indent check on one line
For whatever reason eslint was rejecting the (styleguide-correct)
indentation of the line beginning with "/** @type ...", and in my
naïvete I got a little more zealous than I intended in suppressing
the error.
2021-07-13 12:08:35 +01:00
Monica Kozbial
2c83652733 Add missing whitespace to test files (#5031)
* Add missing spaces

* undo incorrect replaces in utils tests
2021-07-12 15:11:33 -07:00
Neil Fraser
783956d4cd Remove undesirable \n from sv.json
Resolves #5017
2021-07-12 10:12:31 -07:00
dependabot[bot]
6484a7e735 Bump @blockly/dev-tools from 2.4.0 to 2.5.1 (#5023)
Bumps [@blockly/dev-tools](https://github.com/google/blockly-samples/tree/HEAD/plugins/dev-tools) from 2.4.0 to 2.5.1.
- [Release notes](https://github.com/google/blockly-samples/releases)
- [Commits](https://github.com/google/blockly-samples/commits/@blockly/dev-tools@2.5.1/plugins/dev-tools)

---
updated-dependencies:
- dependency-name: "@blockly/dev-tools"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-12 09:43:38 -07:00
dependabot[bot]
26d2920fb6 Bump @blockly/theme-modern from 2.1.18 to 2.1.19 (#5024)
Bumps [@blockly/theme-modern](https://github.com/google/blockly-samples/tree/HEAD/plugins/theme-modern) from 2.1.18 to 2.1.19.
- [Release notes](https://github.com/google/blockly-samples/releases)
- [Commits](https://github.com/google/blockly-samples/commits/@blockly/theme-modern@2.1.19/plugins/theme-modern)

---
updated-dependencies:
- dependency-name: "@blockly/theme-modern"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-12 09:41:43 -07:00
Neil Fraser
b3c94db951 Revert "Revert "Group field edits together for undo/redo""
This reverts commit 344ebcfd02.
2021-07-12 09:38:04 -07:00
dependabot[bot]
34ed6bc9ca Bump concurrently from 6.1.0 to 6.2.0 (#4867)
Bumps [concurrently](https://github.com/kimmobrunfeldt/concurrently) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/kimmobrunfeldt/concurrently/releases)
- [Commits](https://github.com/kimmobrunfeldt/concurrently/compare/v6.1.0...v6.2.0)

---
updated-dependencies:
- dependency-name: concurrently
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-12 09:10:35 -07:00
Monica Kozbial
afa051ac18 update turtle mask placing and remove s (#4962) 2021-07-12 09:09:32 -07:00
Aaron Dodson
0b66af2e84 Merge pull request #5020 from hpnrep6/flyout-button
Fix vertical button padding in horizontal flyout
2021-07-12 08:28:28 -07:00
Neil Fraser
8a3c701026 Enable static method inheritance. 2021-07-11 23:20:20 -07:00
Neil Fraser
2c6d044c40 Review updates 2021-07-11 23:19:01 -07:00
Neil Fraser
02fd8cf7a4 Linting 2021-07-11 23:19:01 -07:00
Neil Fraser
cba7a68207 Allow inheriting of fromJson in fields 2021-07-11 23:19:01 -07:00
hpnrep6
048e77dc9a Include button heights in flyout height calculation 2021-07-12 01:26:03 -04:00
Christopher Allen
603755f250 Suppress spurious eslint error
eslint appears to be confused by the leading JSDoc comment on the
continuation line and suggests it should be indented only 4 rather
than 8 spaces.
2021-07-12 03:51:17 +01:00
Christopher Allen
1197afcee7 Fix JSDoc type annotations causing closure-make-deps warnings
Some type annotations were missing curly brackets, which makes
closure-make-deps emit uninteresting warnings.  Now any output
from the command will be informative and related to whatever
one is presently working on.
2021-07-12 03:17:14 +01:00
Christopher Allen
173ea2bc79 Have eslint ignore undefined variable "exports"
Modules defined using goog.module declare their exported functions
by assigning them to properties on an object which is the value of
the variable "exports" (e.g., "exports.MyClass = class { ... };").

Normally eslint would complain about this variable being undefined,
but this commit suppresses these errors.
2021-07-12 02:54:59 +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
214492cd08 Use the current standard Closure base.js
The version of base.js we have been using is a cut-down copy of an older
version, stripped of everything that wasn't strictly needed for Blockly.

We now need things that were previously stripped out, so restore the
current version from
https://github.com/google/closure-library/blob/master/closure/goog/base.js
as of commit 5cb5e81 (2021-06-04).

We can always strip out unused sections again in future - once we know
which sections those are.
2021-07-10 13:04:19 +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
Rachel Fenichel
89cf049e74 Merge pull request #4995 from BeksOmega/fix/jsdoc
Updates JSDoc in Block and BlockSvg
2021-07-09 15:57:38 -07:00
Rachel Fenichel
61e2d4caee Merge pull request #4985 from maribethb/typo
fix doc typo
2021-07-09 15:31:15 -07:00
Christopher Allen
899493e36d Merge pull request #4968 from cpcallen/build-elsewhere
Build in a temporary directory
2021-07-09 23:16:38 +01:00
Christopher Allen
1306e41d3b Load playground.html etc. from local http server
Unlike goog.provide packages, goog.module modules are loaded using
XMLHttpRequest in uncompiled mode.  Because browsers treat file: URLs
as each being a separate, unique origin, this means that CORS rules
prevent goog.module modules being loaded from a file URL.

To work around this, use the http-server npm to serve the repository
root directory on localhost:8080.

Provide a script so that you can type `npm start` to start the local
http server and automatically open a browser window pointing at
tests/playground.html.

Modify the setBackgroundColour function in the playgrounds to provide
the usual lilac background on locahost URLs and a sickly green one
if using a file: URL, all of which will soon stop working.

(The background doesn't actually appear to be visible in the advanced
playground.)
2021-07-09 23:11:19 +01:00
Monica Kozbial
b2490c57b8 Create develop_freeze.yml (#5012)
* Create develop_freeze.yml

* Remove test message
2021-07-09 15:10:35 -07: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
Rachel Fenichel
f5e4022407 Merge pull request #4998 from rachel-fenichel/deploy_appengine_workflow
Initial commit for appengine deploy action
2021-07-08 19:11:37 -07:00
Rachel Fenichel
16a11e419a Update comments to be more descriptive 2021-07-08 19:05:56 -07:00
Aaron Dodson
b562242614 Merge pull request #5003 from gonfunko/owners
Added @google/blockly-eng as the owner of the entire repo
2021-07-08 14:34:14 -07:00
Aaron Dodson
fa95a3a332 Added @google/blockly-eng as the owner of the entire repo 2021-07-08 14:23:52 -07: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
Aaron Dodson
3f55ca59ad Merge pull request #4969 from gonfunko/scrollin-safari
Work around WebKit bug that prevents scrolling/zooming the workspace.
2021-07-08 08:25:29 -07:00
translatewiki.net
fd93e312b1 Localisation updates from https://translatewiki.net. 2021-07-08 13:00:37 +02:00