xcratch-create 0.5.0 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/create.js CHANGED
@@ -5,6 +5,7 @@ const path = require('path');
5
5
  const replace = require('replace-in-file');
6
6
  const fs = require('fs-extra');
7
7
  const admZip = require('adm-zip');
8
+ const projectJson = require('../package.json');
8
9
 
9
10
  function getArgs() {
10
11
  const args = {};
@@ -32,7 +33,7 @@ function getArgs() {
32
33
  const args = getArgs();
33
34
 
34
35
  if (args['version'] || args['V']) {
35
- process.stdout.write(`v.${process.env.npm_package_version}\n`);
36
+ process.stdout.write(`v${projectJson.version}\n`);
36
37
  process.exit(0);
37
38
  }
38
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xcratch-create",
3
- "version": "0.5.0",
3
+ "version": "0.5.4",
4
4
  "description": "Support tool to create new extension for Xcratch",
5
5
  "bin": {
6
6
  "xcratch-create": "./bin/create.js"
@@ -1,3 +1,4 @@
1
- /node_modules
2
- /src/vm/extension-support
3
- /src/vm/util
1
+ node_modules/
2
+
3
+ src/vm/*
4
+ !src/vm/extensions/
@@ -2,11 +2,11 @@
2
2
  "name": "<<repo>>",
3
3
  "version": "0.0.0",
4
4
  "scripts": {
5
- "register": "npx xcratch-register --link -C --id=<<extensionID>> --gui=\"../scratch-gui\"",
6
- "build": "npx xcratch-build --module=<<extensionID>> --gui=\"../scratch-gui\""
5
+ "register": "npx xcratch-register --id=<<extensionID>> --gui=../scratch-gui --block=./src/vm/extensions/block --entry=./src/gui/lib/libraries/extensions/entry -core --link --use=extension-support util",
6
+ "build": "npx xcratch-build --module=<<extensionID>> --gui=../scratch-gui --block=./src/vm/extensions/block --entry=./src/gui/lib/libraries/extensions/entry"
7
7
  },
8
8
  "devDependencies": {
9
- "xcratch-build": "^0.2.0",
10
- "xcratch-register": "^0.2.0"
9
+ "xcratch-build": "^0.3.0",
10
+ "xcratch-register": "^0.4.0"
11
11
  }
12
12
  }
@@ -16,9 +16,13 @@ let formatMessage = messageData => messageData.defaultMessage;
16
16
  * Setup format-message for this extension.
17
17
  */
18
18
  const setupTranslations = () => {
19
- formatMessage.setup({
20
- translations: translations
21
- });
19
+ const localeSetup = formatMessage.setup();
20
+ if (localeSetup && localeSetup.translations[localeSetup.locale]) {
21
+ Object.assign(
22
+ localeSetup.translations[localeSetup.locale],
23
+ translations[localeSetup.locale]
24
+ );
25
+ }
22
26
  };
23
27
 
24
28
  const EXTENSION_ID = '<<extensionID>>';