@appsemble/cli 0.36.6 → 0.36.7

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 CHANGED
@@ -1,9 +1,9 @@
1
- # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.36.6/config/assets/logo.svg) Appsemble CLI
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.36.7/config/assets/logo.svg) Appsemble CLI
2
2
 
3
3
  > Manage apps and blocks from the command line.
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@appsemble/cli)](https://www.npmjs.com/package/@appsemble/cli)
6
- [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.36.6/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.36.6)
6
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.36.7/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.36.7)
7
7
  [![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io)
8
8
 
9
9
  ## Table of Contents
@@ -18,6 +18,7 @@
18
18
  - [Groups](#groups)
19
19
  - [Assets](#assets)
20
20
  - [Resources](#resources)
21
+ - [Backup restore](#backup-restore)
21
22
  - [Cronjobs](#cronjobs)
22
23
  - [License](#license)
23
24
 
@@ -305,6 +306,24 @@ And resources can also be updated when they contain an id in the JSON file.
305
306
  appsemble resource update --app-id 1 --context development --app path/to/my-app my-resource path/to/resources/*
306
307
  ```
307
308
 
309
+ ### Backup restore
310
+
311
+ The Appsemble CLI can be used to restore app and database data from a backup file created by
312
+ `backup-production-data` (for example, `npm run appsemble -- backup-production-data`). Backup files
313
+ use the format `<backupsFilename>_<YYYYMMDDHHmmssSSS>.sql.gz` (for example,
314
+ `appsemble_prod_backup_20250101093045123.sql.gz`). Use the latest backup filename (for example by
315
+ checking it with `rclone`) and your object storage credentials:
316
+
317
+ ```sh
318
+ npm run appsemble -- restore-data-from-backup --restoreBackupFilename <backupsFilename_YYYYMMDDHHmmssSSS.sql.gz> --backupsHost <your-object-storage-host> --backupsAccessKey <your-backups-access-key> --backupsSecretKey <your-backups-secret-key>
319
+ ```
320
+
321
+ After restoring the backup, run the re-encryption command:
322
+
323
+ ```sh
324
+ npm run appsemble -- reencrypt-secrets --old-aes-secret <old-aes-secret>
325
+ ```
326
+
308
327
  ### Cronjobs
309
328
 
310
329
  The Appsemble CLI can be used to run app cronjobs. The following command runs all cronjobs that were
@@ -323,5 +342,5 @@ appsemble run-cronjobs --interval 30
323
342
 
324
343
  ## License
325
344
 
326
- [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.36.6/LICENSE.md) ©
345
+ [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.36.7/LICENSE.md) ©
327
346
  [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 translations = (await readdir(messagesPath)).map((language) => language.toLowerCase());
88
- if (!translations.includes('en.json')) {
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 translations.filter((t) => t.endsWith('.json'))) {
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.6",
3
+ "version": "0.36.7",
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.6",
48
- "@appsemble/types": "0.36.6",
49
- "@appsemble/lang-sdk": "0.36.6",
50
- "@appsemble/utils": "0.36.6",
47
+ "@appsemble/node-utils": "0.36.7",
48
+ "@appsemble/types": "0.36.7",
49
+ "@appsemble/lang-sdk": "0.36.7",
50
+ "@appsemble/utils": "0.36.7",
51
51
  "@fortawesome/fontawesome-common-types": "^6.0.0",
52
52
  "@inquirer/prompts": "^8.0.0",
53
53
  "@koa/cors": "^5.0.0",
@@ -89,8 +89,8 @@
89
89
  "yargs": "^17.0.0"
90
90
  },
91
91
  "devDependencies": {
92
- "@appsemble/types": "0.36.6",
93
- "@appsemble/server": "0.36.6",
92
+ "@appsemble/types": "0.36.7",
93
+ "@appsemble/server": "0.36.7",
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.6
9
+ version: 0.36.7
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.6
20
+ version: 0.36.7
21
21
  parameters:
22
22
  icon: arrow-left
23
23
  actions:
@@ -5,7 +5,7 @@
5
5
  "*.css"
6
6
  ],
7
7
  "dependencies": {
8
- "@appsemble/sdk": "0.36.6",
8
+ "@appsemble/sdk": "0.36.7",
9
9
  "mini-jsx": "^4.0.0"
10
10
  }
11
11
  }
@@ -5,8 +5,8 @@
5
5
  "*.css"
6
6
  ],
7
7
  "dependencies": {
8
- "@appsemble/preact": "0.36.6",
9
- "@appsemble/sdk": "0.36.6",
8
+ "@appsemble/preact": "0.36.7",
9
+ "@appsemble/sdk": "0.36.7",
10
10
  "preact": "^10.0.0"
11
11
  }
12
12
  }
@@ -5,6 +5,6 @@
5
5
  "*.css"
6
6
  ],
7
7
  "dependencies": {
8
- "@appsemble/sdk": "0.36.6"
8
+ "@appsemble/sdk": "0.36.7"
9
9
  }
10
10
  }