@appsemble/cli 0.36.5-test.6 → 0.36.5
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/commands/restoreDataFromBackup.js +0 -3
- package/lib/config.d.ts +8 -0
- package/lib/config.js +24 -0
- package/lib/project.js +2 -1
- package/package.json +7 -7
- 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.5)
|
|
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.5
|
|
326
|
+
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.36.5/LICENSE.md) ©
|
|
327
327
|
[Appsemble](https://appsemble.com)
|
|
@@ -3,9 +3,6 @@ export const command = 'restore-data-from-backup';
|
|
|
3
3
|
export const description = 'Restore appsemble data from a specified backup for the main database and app databases';
|
|
4
4
|
export function builder(yargs) {
|
|
5
5
|
return yargs
|
|
6
|
-
.option('aesSecret', {
|
|
7
|
-
desc: 'Aes Secret used for encrypting DB password in the backup DB',
|
|
8
|
-
})
|
|
9
6
|
.option('database-host', {
|
|
10
7
|
desc: 'The host of the database to connect to. This defaults to the connected database container.',
|
|
11
8
|
})
|
package/lib/config.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { type ProjectBuildConfig, type ProjectImplementations } from '@appsemble/types';
|
|
2
|
+
import { type PackageJson } from 'type-fest';
|
|
2
3
|
import { type Configuration } from 'webpack';
|
|
4
|
+
/**
|
|
5
|
+
* Extract a repository URL from package.json's repository field.
|
|
6
|
+
*
|
|
7
|
+
* @param pkg The package.json content.
|
|
8
|
+
* @returns A URL to the repository, or undefined if not available.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getRepositoryUrl(pkg: PackageJson): string | undefined;
|
|
3
11
|
/**
|
|
4
12
|
* Get the build configuration from a project directory.
|
|
5
13
|
*
|
package/lib/config.js
CHANGED
|
@@ -9,6 +9,29 @@ import { parse } from 'comment-parser';
|
|
|
9
9
|
import { cosmiconfig } from 'cosmiconfig';
|
|
10
10
|
import normalizePath from 'normalize-path';
|
|
11
11
|
import { createFormatter, createParser, SchemaGenerator, ts } from 'ts-json-schema-generator';
|
|
12
|
+
/**
|
|
13
|
+
* Extract a repository URL from package.json's repository field.
|
|
14
|
+
*
|
|
15
|
+
* @param pkg The package.json content.
|
|
16
|
+
* @returns A URL to the repository, or undefined if not available.
|
|
17
|
+
*/
|
|
18
|
+
export function getRepositoryUrl(pkg) {
|
|
19
|
+
const repo = pkg.repository;
|
|
20
|
+
if (!repo) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
if (typeof repo === 'string') {
|
|
24
|
+
return repo;
|
|
25
|
+
}
|
|
26
|
+
if (!repo.url) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
const baseUrl = repo.url.replace(/\.git$/, '');
|
|
30
|
+
if (!repo.directory) {
|
|
31
|
+
return baseUrl;
|
|
32
|
+
}
|
|
33
|
+
return `${baseUrl}/-/tree/main/${repo.directory}`;
|
|
34
|
+
}
|
|
12
35
|
/**
|
|
13
36
|
* Get the build configuration from a project directory.
|
|
14
37
|
*
|
|
@@ -36,6 +59,7 @@ export async function getProjectBuildConfig(dir) {
|
|
|
36
59
|
longDescription,
|
|
37
60
|
name: pkg.name,
|
|
38
61
|
version: pkg.version,
|
|
62
|
+
repositoryUrl: getRepositoryUrl(pkg),
|
|
39
63
|
dir,
|
|
40
64
|
...config,
|
|
41
65
|
};
|
package/lib/project.js
CHANGED
|
@@ -43,7 +43,7 @@ export async function makeProjectPayload(buildConfig) {
|
|
|
43
43
|
const distPath = output ? resolvePath(dir, output) : undefined;
|
|
44
44
|
const form = new FormData();
|
|
45
45
|
const gatheredData = {};
|
|
46
|
-
const { description, layout, longDescription, name, version, visibility, wildcardActions } = buildConfig;
|
|
46
|
+
const { description, layout, longDescription, name, repositoryUrl, version, visibility, wildcardActions, } = buildConfig;
|
|
47
47
|
const { actions, events, messages, parameters } = getProjectImplementations(buildConfig);
|
|
48
48
|
const files = await readdir(dir);
|
|
49
49
|
const icon = files.find((entry) => entry.match(/^icon\.(png|svg)$/));
|
|
@@ -64,6 +64,7 @@ export async function makeProjectPayload(buildConfig) {
|
|
|
64
64
|
append('actions', actions);
|
|
65
65
|
append('description', description);
|
|
66
66
|
append('longDescription', longDescription);
|
|
67
|
+
append('repositoryUrl', repositoryUrl);
|
|
67
68
|
append('events', events);
|
|
68
69
|
append('layout', layout);
|
|
69
70
|
append('name', name);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/cli",
|
|
3
|
-
"version": "0.36.5
|
|
3
|
+
"version": "0.36.5",
|
|
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.5
|
|
48
|
-
"@appsemble/types": "0.36.5
|
|
49
|
-
"@appsemble/lang-sdk": "0.36.5
|
|
50
|
-
"@appsemble/utils": "0.36.5
|
|
47
|
+
"@appsemble/node-utils": "0.36.5",
|
|
48
|
+
"@appsemble/types": "0.36.5",
|
|
49
|
+
"@appsemble/lang-sdk": "0.36.5",
|
|
50
|
+
"@appsemble/utils": "0.36.5",
|
|
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.5
|
|
93
|
-
"@appsemble/server": "0.36.5
|
|
92
|
+
"@appsemble/types": "0.36.5",
|
|
93
|
+
"@appsemble/server": "0.36.5",
|
|
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.5
|
|
9
|
+
version: 0.36.5
|
|
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.5
|
|
20
|
+
version: 0.36.5
|
|
21
21
|
parameters:
|
|
22
22
|
icon: arrow-left
|
|
23
23
|
actions:
|