@appsemble/cli 0.36.6-test.0 → 0.36.7-test.0
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/README.md +3 -3
- package/__fixtures__/makeProjectPayload/with-i18n/output/block.js +1 -0
- package/lib/project.js +6 -5
- package/package.json +8 -8
- package/templates/apps/empty/app-definition.yaml +2 -2
- package/templates/blocks/mini-jsx/package.json +1 -1
- package/templates/blocks/preact/package.json +2 -2
- package/templates/blocks/vanilla/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#  Appsemble CLI
|
|
2
2
|
|
|
3
3
|
> Manage apps and blocks from the command line.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@appsemble/cli)
|
|
6
|
-
[](https://gitlab.com/appsemble/appsemble/-/releases/0.36.7-test.0)
|
|
7
7
|
[](https://prettier.io)
|
|
8
8
|
|
|
9
9
|
## Table of Contents
|
|
@@ -323,5 +323,5 @@ appsemble run-cronjobs --interval 30
|
|
|
323
323
|
|
|
324
324
|
## License
|
|
325
325
|
|
|
326
|
-
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.36.
|
|
326
|
+
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.36.7-test.0/LICENSE.md) ©
|
|
327
327
|
[Appsemble](https://appsemble.com)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const string = 'with-i18n';
|
package/lib/project.js
CHANGED
|
@@ -3,7 +3,7 @@ import { readdir, readFile } from 'node:fs/promises';
|
|
|
3
3
|
import { basename, extname, join, relative, resolve as resolvePath } from 'node:path';
|
|
4
4
|
import { inspect } from 'node:util';
|
|
5
5
|
import { AppsembleError, logger, opendirSafe, readData } from '@appsemble/node-utils';
|
|
6
|
-
import { compareStrings } from '@appsemble/utils';
|
|
6
|
+
import { compareStrings, normalizeLocale } from '@appsemble/utils';
|
|
7
7
|
import axios from 'axios';
|
|
8
8
|
import { build } from 'esbuild';
|
|
9
9
|
import FormData from 'form-data';
|
|
@@ -84,16 +84,17 @@ export async function makeProjectPayload(buildConfig) {
|
|
|
84
84
|
const messageKeys = Object.keys(messages).sort(compareStrings);
|
|
85
85
|
const messagesResult = {};
|
|
86
86
|
const messagesPath = join(dir, 'i18n');
|
|
87
|
-
const
|
|
88
|
-
|
|
87
|
+
const translationFiles = (await readdir(messagesPath)).filter((filename) => filename.endsWith('.json'));
|
|
88
|
+
const translations = translationFiles.map((filename) => normalizeLocale(basename(filename, '.json')));
|
|
89
|
+
if (!translations.includes('en')) {
|
|
89
90
|
throw new AppsembleError('Could not find ‘en.json’. Try running extract-messages');
|
|
90
91
|
}
|
|
91
92
|
const duplicates = translations.filter((language, index) => translations.indexOf(language) !== index);
|
|
92
93
|
if (duplicates.length) {
|
|
93
94
|
throw new AppsembleError(`Found duplicate language codes: ‘${duplicates.join('’, ')}`);
|
|
94
95
|
}
|
|
95
|
-
for (const languageFile of
|
|
96
|
-
const language = basename(languageFile, '.json');
|
|
96
|
+
for (const languageFile of translationFiles) {
|
|
97
|
+
const language = normalizeLocale(basename(languageFile, '.json'));
|
|
97
98
|
const languagePath = join(messagesPath, languageFile);
|
|
98
99
|
const [m] = await readData(languagePath);
|
|
99
100
|
const languageKeys = Object.keys(m).sort(compareStrings);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/cli",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.7-test.0",
|
|
4
4
|
"description": "The CLI for developing with Appsemble apps and blocks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"test": "vitest"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@appsemble/node-utils": "0.36.
|
|
48
|
-
"@appsemble/types": "0.36.
|
|
49
|
-
"@appsemble/lang-sdk": "0.36.
|
|
50
|
-
"@appsemble/utils": "0.36.
|
|
47
|
+
"@appsemble/node-utils": "0.36.7-test.0",
|
|
48
|
+
"@appsemble/types": "0.36.7-test.0",
|
|
49
|
+
"@appsemble/lang-sdk": "0.36.7-test.0",
|
|
50
|
+
"@appsemble/utils": "0.36.7-test.0",
|
|
51
51
|
"@fortawesome/fontawesome-common-types": "^6.0.0",
|
|
52
52
|
"@inquirer/prompts": "^8.0.0",
|
|
53
53
|
"@koa/cors": "^5.0.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"comment-parser": "^1.0.0",
|
|
58
58
|
"cosmiconfig": "^7.0.0",
|
|
59
59
|
"csvtojson": "^2.0.0",
|
|
60
|
-
"esbuild": "^0.
|
|
60
|
+
"esbuild": "^0.27.0",
|
|
61
61
|
"fast-glob": "^3.0.0",
|
|
62
62
|
"form-data": "^4.0.4",
|
|
63
63
|
"global-cache-dir": "^6.0.0",
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
"yargs": "^17.0.0"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
|
-
"@appsemble/types": "0.36.
|
|
93
|
-
"@appsemble/server": "0.36.
|
|
92
|
+
"@appsemble/types": "0.36.7-test.0",
|
|
93
|
+
"@appsemble/server": "0.36.7-test.0",
|
|
94
94
|
"@types/concat-stream": "2.0.3",
|
|
95
95
|
"@types/koa__cors": "5.0.1",
|
|
96
96
|
"@types/koa-compress": "4.0.7",
|
|
@@ -6,7 +6,7 @@ pages:
|
|
|
6
6
|
- name: Example Page A
|
|
7
7
|
blocks:
|
|
8
8
|
- type: action-button
|
|
9
|
-
version: 0.36.
|
|
9
|
+
version: 0.36.7-test.0
|
|
10
10
|
parameters:
|
|
11
11
|
icon: arrow-right
|
|
12
12
|
actions:
|
|
@@ -17,7 +17,7 @@ pages:
|
|
|
17
17
|
- name: Example Page B
|
|
18
18
|
blocks:
|
|
19
19
|
- type: action-button
|
|
20
|
-
version: 0.36.
|
|
20
|
+
version: 0.36.7-test.0
|
|
21
21
|
parameters:
|
|
22
22
|
icon: arrow-left
|
|
23
23
|
actions:
|