Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f1b2bcc
fix: convert files to typescript
BeksOmega Jun 7, 2022
a07b154
fix: add alias for AnyDuringMigration so that tsc will run
BeksOmega Jun 17, 2022
d481815
chore: format
BeksOmega Jun 17, 2022
59368ac
chore: enable ts for the clang-format workflow (#6233)
BeksOmega Jun 22, 2022
887ccba
chore: Restore @fileoverview comment locations (#6237)
Jun 23, 2022
88530d2
chore: add declareModuleId (#6238)
Jun 23, 2022
94b4f6c
fix: Revert comment change to app_controller.js (#6241)
Jun 24, 2022
6567092
fix: Add missing import goog statements (#6240)
cpcallen Jun 24, 2022
8ad2f0f
chore: Fix whitespace (#6243)
cpcallen Jun 24, 2022
9c0b6b6
fix(build): Skip npm prepare when running in CI (#6244)
cpcallen Jun 24, 2022
a58f15c
fix: re-add `@package` annotations as `@internal` annotations (#6232)
BeksOmega Jun 27, 2022
42159c2
fix: tsc errors picked up from develop (#6224)
BeksOmega Jun 27, 2022
62166af
chore: move comments back to their correct positions (#6249)
BeksOmega Jun 28, 2022
01a0420
fix: Correct enum formatting, use merged `namespace`s for types that …
cpcallen Jun 29, 2022
fc37011
chore(build): Suppress spurious warnings from closure-make-deps (#6253)
cpcallen Jun 29, 2022
5ca6273
fix: remaining enums that weren't properly exported (#6251)
BeksOmega Jun 29, 2022
20fa0d5
fix: properly export interfaces that were typedefs (#6250)
BeksOmega Jun 30, 2022
668c02f
fix: renamed protected parameter properties (#6252)
BeksOmega Jun 30, 2022
89bc4d0
refactor: Migrate `blockly.js` to TypeScript (#6261)
cpcallen Jul 6, 2022
dcbad5d
fix(build): Don't depend on execSync running bash (#6262)
cpcallen Jul 6, 2022
54e78b7
chore: use `import type` where possible (#6279)
BeksOmega Jul 20, 2022
a44c7b5
fix: add type information to blockly options (#6283)
BeksOmega Jul 26, 2022
e698f56
fix: bugs revealed by getting the built output working (#6282)
BeksOmega Jul 26, 2022
7f58f0c
fix(variables): Revert inadvertent change to allDeveloperVariables (#…
cpcallen Jul 28, 2022
8b01070
fix: circular dependencies (#6281)
BeksOmega Jul 28, 2022
5efe395
chore: revert changes to playground used for testing (#6292)
BeksOmega Jul 29, 2022
7d913e6
chore: get mocha tests to pass. (#6291)
BeksOmega Aug 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check_clang_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: DoozyX/clang-format-lint-action@v0.14
with:
source: 'core'
extensions: 'js'
extensions: 'js,ts'
# This should be as close as possible to the version that the npm
# package supports. This can be found by running:
# npx clang-format --version.
Expand Down
4 changes: 3 additions & 1 deletion blocks/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ const procedures = goog.require('Blockly.libraryBlocks.procedures');
const texts = goog.require('Blockly.libraryBlocks.texts');
const variables = goog.require('Blockly.libraryBlocks.variables');
const variablesDynamic = goog.require('Blockly.libraryBlocks.variablesDynamic');
// const {BlockDefinition} = goog.requireType('Blockly.blocks');
// TODO (6248): Properly import the BlockDefinition type.
/* eslint-disable-next-line no-unused-vars */
const {BlockDefinition} = goog.requireType('Blockly.blocks');
const BlockDefinition = Object;


exports.colour = colour;
Expand Down
4 changes: 3 additions & 1 deletion blocks/colour.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

goog.module('Blockly.libraryBlocks.colour');

// const {BlockDefinition} = goog.requireType('Blockly.blocks');
// TODO (6248): Properly import the BlockDefinition type.
/* eslint-disable-next-line no-unused-vars */
const {BlockDefinition} = goog.requireType('Blockly.blocks');
const BlockDefinition = Object;
const {createBlockDefinitionsFromJsonArray, defineBlocks} = goog.require('Blockly.common');
/** @suppress {extraRequire} */
goog.require('Blockly.FieldColour');
Expand Down
4 changes: 3 additions & 1 deletion blocks/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ const Xml = goog.require('Blockly.Xml');
const {Align} = goog.require('Blockly.Input');
/* eslint-disable-next-line no-unused-vars */
const {Block} = goog.requireType('Blockly.Block');
// const {BlockDefinition} = goog.requireType('Blockly.blocks');
// TODO (6248): Properly import the BlockDefinition type.
/* eslint-disable-next-line no-unused-vars */
const {BlockDefinition} = goog.requireType('Blockly.blocks');
const BlockDefinition = Object;
const {ConnectionType} = goog.require('Blockly.ConnectionType');
const {FieldDropdown} = goog.require('Blockly.FieldDropdown');
const {Msg} = goog.require('Blockly.Msg');
Expand Down
4 changes: 3 additions & 1 deletion blocks/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ const Extensions = goog.require('Blockly.Extensions');
const xmlUtils = goog.require('Blockly.utils.xml');
/* eslint-disable-next-line no-unused-vars */
const {Block} = goog.requireType('Blockly.Block');
// const {BlockDefinition} = goog.requireType('Blockly.blocks');
// TODO (6248): Properly import the BlockDefinition type.
/* eslint-disable-next-line no-unused-vars */
const {BlockDefinition} = goog.requireType('Blockly.blocks');
const BlockDefinition = Object;
const {Msg} = goog.require('Blockly.Msg');
const {Mutator} = goog.require('Blockly.Mutator');
/* eslint-disable-next-line no-unused-vars */
Expand Down
4 changes: 3 additions & 1 deletion blocks/loops.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ const Variables = goog.require('Blockly.Variables');
const xmlUtils = goog.require('Blockly.utils.xml');
/* eslint-disable-next-line no-unused-vars */
const {Block} = goog.requireType('Blockly.Block');
// const {BlockDefinition} = goog.requireType('Blockly.blocks');
// TODO (6248): Properly import the BlockDefinition type.
/* eslint-disable-next-line no-unused-vars */
const {BlockDefinition} = goog.requireType('Blockly.blocks');
const BlockDefinition = Object;
const {Msg} = goog.require('Blockly.Msg');
const {createBlockDefinitionsFromJsonArray, defineBlocks} = goog.require('Blockly.common');
/** @suppress {extraRequire} */
Expand Down
4 changes: 3 additions & 1 deletion blocks/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ const FieldDropdown = goog.require('Blockly.FieldDropdown');
const xmlUtils = goog.require('Blockly.utils.xml');
/* eslint-disable-next-line no-unused-vars */
const {Block} = goog.requireType('Blockly.Block');
// const {BlockDefinition} = goog.requireType('Blockly.blocks');
// TODO (6248): Properly import the BlockDefinition type.
/* eslint-disable-next-line no-unused-vars */
const {BlockDefinition} = goog.requireType('Blockly.blocks');
const BlockDefinition = Object;
const {createBlockDefinitionsFromJsonArray, defineBlocks} = goog.require('Blockly.common');
/** @suppress {extraRequire} */
goog.require('Blockly.FieldLabel');
Expand Down
4 changes: 3 additions & 1 deletion blocks/procedures.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ const xmlUtils = goog.require('Blockly.utils.xml');
const {Align} = goog.require('Blockly.Input');
/* eslint-disable-next-line no-unused-vars */
const {Block} = goog.requireType('Blockly.Block');
// const {BlockDefinition} = goog.requireType('Blockly.blocks');
// TODO (6248): Properly import the BlockDefinition type.
/* eslint-disable-next-line no-unused-vars */
const {BlockDefinition} = goog.requireType('Blockly.blocks');
const BlockDefinition = Object;
const {config} = goog.require('Blockly.config');
/* eslint-disable-next-line no-unused-vars */
const {FieldCheckbox} = goog.require('Blockly.FieldCheckbox');
Expand Down
4 changes: 3 additions & 1 deletion blocks/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ const xmlUtils = goog.require('Blockly.utils.xml');
const {Align} = goog.require('Blockly.Input');
/* eslint-disable-next-line no-unused-vars */
const {Block} = goog.requireType('Blockly.Block');
// const {BlockDefinition} = goog.requireType('Blockly.blocks');
// TODO (6248): Properly import the BlockDefinition type.
/* eslint-disable-next-line no-unused-vars */
const {BlockDefinition} = goog.requireType('Blockly.blocks');
const BlockDefinition = Object;
const {ConnectionType} = goog.require('Blockly.ConnectionType');
const {FieldDropdown} = goog.require('Blockly.FieldDropdown');
const {FieldImage} = goog.require('Blockly.FieldImage');
Expand Down
4 changes: 3 additions & 1 deletion blocks/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ const Variables = goog.require('Blockly.Variables');
const xmlUtils = goog.require('Blockly.utils.xml');
/* eslint-disable-next-line no-unused-vars */
const {Block} = goog.requireType('Blockly.Block');
// const {BlockDefinition} = goog.requireType('Blockly.blocks');
// TODO (6248): Properly import the BlockDefinition type.
/* eslint-disable-next-line no-unused-vars */
const {BlockDefinition} = goog.requireType('Blockly.blocks');
const BlockDefinition = Object;
const {Msg} = goog.require('Blockly.Msg');
const {createBlockDefinitionsFromJsonArray, defineBlocks} = goog.require('Blockly.common');
/** @suppress {extraRequire} */
Expand Down
4 changes: 3 additions & 1 deletion blocks/variables_dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ const Variables = goog.require('Blockly.Variables');
const xml = goog.require('Blockly.utils.xml');
/* eslint-disable-next-line no-unused-vars */
const {Block} = goog.requireType('Blockly.Block');
// const {BlockDefinition} = goog.requireType('Blockly.blocks');
// TODO (6248): Properly import the BlockDefinition type.
/* eslint-disable-next-line no-unused-vars */
const {BlockDefinition} = goog.requireType('Blockly.blocks');
const BlockDefinition = Object;
const {Msg} = goog.require('Blockly.Msg');
const {createBlockDefinitionsFromJsonArray, defineBlocks} = goog.require('Blockly.common');
/** @suppress {extraRequire} */
Expand Down
4 changes: 2 additions & 2 deletions closure/goog/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,8 @@ goog.declareModuleId = function(namespace) {
'within an ES6 module');
}
if (goog.moduleLoaderState_ && goog.moduleLoaderState_.moduleName) {
throw new Error(
'goog.declareModuleId may only be called once per module.');
// throw new Error(
// 'goog.declareModuleId may only be called once per module.');
}
if (namespace in goog.loadedModules_) {
throw new Error(
Expand Down
83 changes: 44 additions & 39 deletions closure/goog/goog.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,48 +36,53 @@
* goog.require calls.
*/

export const global = goog.global;
export const require = goog.require;
export const define = goog.define;
export const DEBUG = goog.DEBUG;
export const LOCALE = goog.LOCALE;
export const TRUSTED_SITE = goog.TRUSTED_SITE;
export const DISALLOW_TEST_ONLY_CODE = goog.DISALLOW_TEST_ONLY_CODE;
export const getGoogModule = goog.module.get;
export const setTestOnly = goog.setTestOnly;
export const forwardDeclare = goog.forwardDeclare;
export const getObjectByName = goog.getObjectByName;
export const basePath = goog.basePath;
export const addSingletonGetter = goog.addSingletonGetter;
export const typeOf = goog.typeOf;
export const isArrayLike = goog.isArrayLike;
export const isDateLike = goog.isDateLike;
export const isObject = goog.isObject;
export const getUid = goog.getUid;
export const hasUid = goog.hasUid;
export const removeUid = goog.removeUid;
export const now = Date.now;
export const globalEval = goog.globalEval;
export const getCssName = goog.getCssName;
export const setCssNameMapping = goog.setCssNameMapping;
export const getMsg = goog.getMsg;
export const getMsgWithFallback = goog.getMsgWithFallback;
export const exportSymbol = goog.exportSymbol;
export const exportProperty = goog.exportProperty;
export const abstractMethod = goog.abstractMethod;
export const cloneObject = goog.cloneObject;
export const bind = goog.bind;
export const partial = goog.partial;
export const inherits = goog.inherits;
export const scope = goog.scope;
export const defineClass = goog.defineClass;
export const declareModuleId = goog.declareModuleId;
export const global = globalThis;
// export const require = goog.require;
// export const define = goog.define;
// export const DEBUG = goog.DEBUG;
// export const LOCALE = goog.LOCALE;
// export const TRUSTED_SITE = goog.TRUSTED_SITE;
// export const DISALLOW_TEST_ONLY_CODE = goog.DISALLOW_TEST_ONLY_CODE;
// export const getGoogModule = goog.module.get;
// export const setTestOnly = goog.setTestOnly;
// export const forwardDeclare = goog.forwardDeclare;
// export const getObjectByName = goog.getObjectByName;
// export const basePath = goog.basePath;
// export const addSingletonGetter = goog.addSingletonGetter;
// export const typeOf = goog.typeOf;
// export const isArrayLike = goog.isArrayLike;
// export const isDateLike = goog.isDateLike;
// export const isObject = goog.isObject;
// export const getUid = goog.getUid;
// export const hasUid = goog.hasUid;
// export const removeUid = goog.removeUid;
// export const now = Date.now;
// export const globalEval = goog.globalEval;
// export const getCssName = goog.getCssName;
// export const setCssNameMapping = goog.setCssNameMapping;
// export const getMsg = goog.getMsg;
// export const getMsgWithFallback = goog.getMsgWithFallback;
// export const exportSymbol = goog.exportSymbol;
// export const exportProperty = goog.exportProperty;
// export const abstractMethod = goog.abstractMethod;
// export const cloneObject = goog.cloneObject;
// export const bind = goog.bind;
// export const partial = goog.partial;
// export const inherits = goog.inherits;
// export const scope = goog.scope;
// export const defineClass = goog.defineClass;
export const declareModuleId = function(namespace) {
if (window.goog && window.goog.declareModuleId) {
window.goog.declareModuleId.call(this, namespace);
}
};


// Export select properties of module. Do not export the function itself or
// goog.module.declareLegacyNamespace.
export const module = {
get: goog.module.get,
};
// export const module = {
// get: goog.module.get,
// };

// Omissions include:
// goog.ENABLE_DEBUG_LOADER - define only used in base.
Expand Down
1 change: 1 addition & 0 deletions core/any_aliases.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type AnyDuringMigration = any;
Loading