Files
blockly/package.json
Christopher Allen 2ebdc0b7f9 feat(build)!: Introduce ESM entrypoints (#8091)
* feat(build)!: Introduce ESM entrypoints for chunks

  Introduce an "import" conditional export for each of the chunk
  entrypoints (blockly/core, blockly/blocks, blockly/javascript
  etc.), and point these at wrappers created by build_tasks.js
  that import the corresponding <chunk>_compressed.js file and
  export its named exports.

  BREAKING CHANGE:

  Importing Blockly via

      import Blockly from 'blockly/core';

  (and similarly for the other chunk entrypoints) has worked until
  now because most build tools (including Webpack in particular)
  fuilfil the request for the default export of a CJS module by
  providing the module.exports object, rather than an
  explicitly-named default export as they would for an ES module.

  Since core/blockly.ts (the notional entrypoint for blockly/core)
  does not provide a default export, the wrappers created by this
  PR do not either.

  Code of the above form will therefore break, and should be updated
  to use a wildcard:

      import * as Blockly from 'blockly/core';

* feat(build)!: Introduce main package ESM entrypoint

  Introduce an "import" conditional export for the top-level
  package entrypoint (blockly), and point it at a wrappers
  created by build_tasks.js that imports the existing index.js
  file.

  BREAKING CHANGE:

  Importing Blockly via

      import Blockly from 'blockly';

  has worked until now because most build tools (including Webpack
  in particular) fuilfil the request for the default export of a
  CJS module by providing the module.exports object, rather than an
  explicitly-named default export as they would for an ES module.

  Since core/blockly.ts does not provide a default export, the
  wrapper created by this PR does not either.

  Code of the above form will therefore break, and should be updated
  to use a wildcard:

      import * as Blockly from 'blockly';

* feat(build)!: Introduce ESM entrypoints for langfiles

  Introduce an "import" conditional export for each of the
  langfile entrypoints (msg/en, msg/fr, etc.),, and point them
  at wrappers created by build_tasks.js that import the
  existing <lang>.js file.

  BREAKING CHANGE:

  Importing languages via

      import en from 'blockly/msg/en';

  has worked until now because most build tools (including Webpack
  in particular) fuilfil the request for the default export of a
  CJS module by providing the module.exports object, rather than an
  explicitly-named default export as they would for an ES module.

  Code of the above form will therefore break, and should be updated
  to use a wildcard:

      import * as en from 'blockly/msg/en';

* fix(typings): Remove bogus .d.ts file.

  For some reason we had a typings/msg/yue.d.ts that did not
  correxpond to any msg/json/yue.json.  Delete it.
2024-05-10 22:42:35 +01:00

154 lines
5.0 KiB
JSON

{
"name": "blockly",
"version": "11.0.0-beta.10",
"description": "Blockly is a library for building visual programming editors.",
"keywords": [
"blockly"
],
"repository": {
"type": "git",
"url": "https://github.com/google/blockly.git"
},
"bugs": {
"url": "https://github.com/google/blockly/issues"
},
"homepage": "https://developers.google.com/blockly/",
"author": {
"name": "Neil Fraser"
},
"scripts": {
"build": "gulp build",
"build-debug": "gulp build --verbose --debug",
"build-debug-log": "npm run build:debug > build-debug.log 2>&1 && tail -3 build-debug.log",
"build-strict": "gulp build --verbose --strict",
"build-strict-log": "npm run build:strict > build-debug.log 2>&1 && tail -3 build-debug.log",
"build:compiled": "exit 1 # Deprecated; use \"npm run minify\" instead.",
"build:compressed": "exit 1 # Deprecated; use \"npm run minify\" instead.",
"build:js": "exit 1 # Deprecated; use \"npm run tsc\" instead.",
"build:langfiles": "exit 1 # Deprecated; use \"npm run langfiles\" instead.",
"clean": "gulp clean",
"deployDemos": "npm ci && gulp deployDemos",
"deployDemos:beta": "npm ci && gulp deployDemosBeta",
"docs": "gulp docs",
"format": "prettier --write .",
"format:check": "prettier --check .",
"generate:langfiles": "exit 1 # Deprecated; use \"npm run messages\" instead.",
"messages": "gulp messages",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"langfiles": "gulp langfiles",
"minify": "gulp minify",
"package": "gulp package",
"postinstall": "patch-package",
"prepareDemos": "gulp prepareDemos",
"publish": "npm ci && gulp publish",
"publish:beta": "npm ci && gulp publishBeta",
"recompile": "gulp recompile",
"release": "gulp gitCreateRC",
"start": "npm run build && concurrently -n tsc,server \"tsc --watch --preserveWatchOutput --outDir \"build/src\" --declarationDir \"build/declarations\"\" \"http-server ./ -s -o /tests/playground.html -c-1\"",
"tsc": "gulp tsc",
"test": "gulp test",
"test:browser": "cd tests/browser && npx mocha",
"test:generators": "gulp testGenerators",
"test:mocha:interactive": "npm run build && concurrently -n tsc,server \"tsc --watch --preserveWatchOutput --outDir \"build/src\" --declarationDir \"build/declarations\"\" \"http-server ./ -o /tests/mocha/index.html -c-1\"",
"test:compile:advanced": "gulp buildAdvancedCompilationTest --debug",
"updateGithubPages": "npm ci && gulp gitUpdateGithubPages"
},
"exports": {
".": {
"types": "./index.d.ts",
"import": "./index.mjs",
"umd": "./blockly.min.js",
"default": "./index.js"
},
"./core": {
"types": "./core.d.ts",
"node": "./core-node.js",
"import": "./blockly.mjs",
"default": "./blockly_compressed.js"
},
"./blocks": {
"types": "./blocks.d.ts",
"import": "./blocks.mjs",
"default": "./blocks_compressed.js"
},
"./dart": {
"types": "./dart.d.ts",
"import": "./dart.mjs",
"default": "./dart_compressed.js"
},
"./lua": {
"types": "./lua.d.ts",
"import": "./lua.mjs",
"default": "./lua_compressed.js"
},
"./javascript": {
"types": "./javascript.d.ts",
"import": "./javascript.mjs",
"default": "./javascript_compressed.js"
},
"./php": {
"types": "./php.d.ts",
"import": "./php.mjs",
"default": "./php_compressed.js"
},
"./python": {
"types": "./python.d.ts",
"import": "./python.mjs",
"default": "./python_compressed.js"
},
"./msg/*": {
"types": "./msg/*.d.ts",
"import": "./msg/*.mjs",
"default": "./msg/*.js"
}
},
"license": "Apache-2.0",
"devDependencies": {
"@blockly/block-test": "^5.0.0",
"@blockly/dev-tools": "^7.0.2",
"@blockly/theme-modern": "^5.0.0",
"@hyperjump/json-schema": "^1.5.0",
"@microsoft/api-documenter": "^7.22.4",
"@microsoft/api-extractor": "^7.29.5",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"async-done": "^2.0.0",
"chai": "^4.2.0",
"concurrently": "^8.0.1",
"eslint": "^8.4.1",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-jsdoc": "^48.0.2",
"glob": "^10.3.4",
"google-closure-compiler": "^20230802.0.0",
"gulp": "^4.0.2",
"gulp-concat": "^2.6.1",
"gulp-gzip": "^1.4.2",
"gulp-header": "^2.0.9",
"gulp-insert": "^0.5.0",
"gulp-rename": "^2.0.0",
"gulp-replace": "^1.0.0",
"gulp-series": "^1.0.2",
"gulp-shell": "^0.8.0",
"gulp-sourcemaps": "^3.0.0",
"gulp-umd": "^2.0.0",
"http-server": "^14.0.0",
"json5": "^2.2.0",
"markdown-tables-to-json": "^0.1.7",
"mocha": "^10.0.0",
"patch-package": "^8.0.0",
"prettier": "3.2.5",
"readline-sync": "^1.4.10",
"rimraf": "^5.0.0",
"typescript": "^5.3.3",
"webdriverio": "^8.32.2",
"yargs": "^17.2.1"
},
"dependencies": {
"jsdom": "23.0.0"
},
"engines": {
"node": ">=18"
}
}