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
|
|
36
|
+
process.stdout.write(`v${projectJson.version}\n`);
|
|
36
37
|
process.exit(0);
|
|
37
38
|
}
|
|
38
39
|
|
package/package.json
CHANGED
package/template/dot_gitignore
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
/
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
node_modules/
|
|
2
|
+
|
|
3
|
+
src/vm/*
|
|
4
|
+
!src/vm/extensions/
|
package/template/package.json
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"name": "<<repo>>",
|
|
3
3
|
"version": "0.0.0",
|
|
4
4
|
"scripts": {
|
|
5
|
-
"register": "npx xcratch-register --
|
|
6
|
-
"build": "npx xcratch-build --module=<<extensionID>> --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.
|
|
10
|
-
"xcratch-register": "^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
|
-
|
|
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>>';
|