@appsemble/cli 0.20.9 → 0.20.12
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/__fixtures__/getBlockConfigFromTypeScript/comments/index.ts +40 -0
- package/__fixtures__/getBlockConfigFromTypeScript/comments/tsconfig.json +7 -0
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateActions/index.ts +34 -0
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateActions/tsconfig.json +7 -0
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventEmitters/index.ts +34 -0
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventEmitters/tsconfig.json +7 -0
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventListeners/index.ts +34 -0
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventListeners/tsconfig.json +7 -0
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateParameters/index.ts +34 -0
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateParameters/tsconfig.json +7 -0
- package/__fixtures__/getBlockConfigFromTypeScript/fontawesomeParameters/index.ts +11 -0
- package/__fixtures__/getBlockConfigFromTypeScript/fontawesomeParameters/tsconfig.json +7 -0
- package/__fixtures__/getBlockConfigFromTypeScript/tsError/index.ts +4 -0
- package/__fixtures__/getBlockConfigFromTypeScript/tsError/tsconfig.json +8 -0
- package/__fixtures__/getBlockConfigFromTypeScript/valid/index.ts +28 -0
- package/__fixtures__/getBlockConfigFromTypeScript/valid/tsconfig.json +7 -0
- package/__fixtures__/makePayload/no-icon/output/block.js +1 -0
- package/__fixtures__/makePayload/with-icon/icon.svg +2 -0
- package/__fixtures__/makePayload/with-icon/output/block.js +1 -0
- package/assets/appsemblerc.schema.json +150 -0
- package/changed/added/.gitkeep +0 -0
- package/changed/changed/.gitkeep +0 -0
- package/changed/deprecated/.gitkeep +0 -0
- package/changed/fixed/.gitkeep +0 -0
- package/changed/removed/.gitkeep +0 -0
- package/changed/security/.gitkeep +0 -0
- package/{dist/commands → commands}/app/create.d.ts +0 -0
- package/{dist/commands → commands}/app/create.js +0 -0
- package/commands/app/create.js.map +1 -0
- package/commands/app/create.ts +104 -0
- package/{dist/commands → commands}/app/extract-messages.d.ts +0 -0
- package/{dist/commands → commands}/app/extract-messages.js +0 -0
- package/commands/app/extract-messages.js.map +1 -0
- package/commands/app/extract-messages.ts +56 -0
- package/{dist/commands → commands}/app/index.d.ts +0 -0
- package/{dist/commands → commands}/app/index.js +0 -0
- package/commands/app/index.js.map +1 -0
- package/commands/app/index.ts +14 -0
- package/{dist/commands → commands}/app/update.d.ts +0 -0
- package/{dist/commands → commands}/app/update.js +0 -0
- package/commands/app/update.js.map +1 -0
- package/commands/app/update.ts +111 -0
- package/{dist/commands → commands}/asset/create.d.ts +0 -0
- package/{dist/commands → commands}/asset/create.js +0 -0
- package/commands/asset/create.js.map +1 -0
- package/commands/asset/create.ts +84 -0
- package/{dist/commands → commands}/asset/index.d.ts +0 -0
- package/{dist/commands → commands}/asset/index.js +0 -0
- package/commands/asset/index.js.map +1 -0
- package/commands/asset/index.ts +12 -0
- package/{dist/commands → commands}/block/build.d.ts +0 -0
- package/{dist/commands → commands}/block/build.js +0 -0
- package/commands/block/build.js.map +1 -0
- package/commands/block/build.ts +32 -0
- package/{dist/commands → commands}/block/extract-messages.d.ts +0 -0
- package/{dist/commands → commands}/block/extract-messages.js +0 -0
- package/commands/block/extract-messages.js.map +1 -0
- package/commands/block/extract-messages.ts +41 -0
- package/{dist/commands → commands}/block/index.d.ts +0 -0
- package/{dist/commands → commands}/block/index.js +0 -0
- package/commands/block/index.js.map +1 -0
- package/commands/block/index.ts +14 -0
- package/{dist/commands → commands}/block/publish.d.ts +0 -0
- package/{dist/commands → commands}/block/publish.js +0 -0
- package/commands/block/publish.js.map +1 -0
- package/commands/block/publish.ts +58 -0
- package/{dist/commands → commands}/cleanupResources.d.ts +0 -0
- package/{dist/commands → commands}/cleanupResources.js +0 -0
- package/commands/cleanupResources.js.map +1 -0
- package/commands/cleanupResources.ts +45 -0
- package/{dist/commands → commands}/config/get.d.ts +0 -0
- package/{dist/commands → commands}/config/get.js +0 -0
- package/commands/config/get.js.map +1 -0
- package/commands/config/get.ts +26 -0
- package/{dist/commands → commands}/config/index.d.ts +0 -0
- package/{dist/commands → commands}/config/index.js +0 -0
- package/commands/config/index.js.map +1 -0
- package/commands/config/index.ts +13 -0
- package/{dist/commands → commands}/config/set.d.ts +0 -0
- package/{dist/commands → commands}/config/set.js +0 -0
- package/commands/config/set.js.map +1 -0
- package/commands/config/set.ts +44 -0
- package/{dist/commands → commands}/login.d.ts +0 -0
- package/{dist/commands → commands}/login.js +0 -0
- package/commands/login.js.map +1 -0
- package/commands/login.ts +5 -0
- package/{dist/commands → commands}/logout.d.ts +0 -0
- package/{dist/commands → commands}/logout.js +0 -0
- package/commands/logout.js.map +1 -0
- package/commands/logout.ts +5 -0
- package/{dist/commands → commands}/migrate.d.ts +0 -0
- package/{dist/commands → commands}/migrate.js +5 -2
- package/commands/migrate.js.map +1 -0
- package/commands/migrate.ts +50 -0
- package/{dist/commands → commands}/organization/create.d.ts +0 -0
- package/{dist/commands → commands}/organization/create.js +0 -0
- package/commands/organization/create.js.map +1 -0
- package/commands/organization/create.ts +65 -0
- package/{dist/commands → commands}/organization/index.d.ts +0 -0
- package/{dist/commands → commands}/organization/index.js +0 -0
- package/commands/organization/index.js.map +1 -0
- package/commands/organization/index.ts +13 -0
- package/{dist/commands → commands}/organization/update.d.ts +0 -0
- package/{dist/commands → commands}/organization/update.js +0 -0
- package/commands/organization/update.js.map +1 -0
- package/commands/organization/update.ts +65 -0
- package/{dist/commands → commands}/resource/create.d.ts +0 -0
- package/{dist/commands → commands}/resource/create.js +0 -0
- package/commands/resource/create.js.map +1 -0
- package/commands/resource/create.ts +78 -0
- package/{dist/commands → commands}/resource/index.d.ts +0 -0
- package/{dist/commands → commands}/resource/index.js +0 -0
- package/commands/resource/index.js.map +1 -0
- package/commands/resource/index.ts +13 -0
- package/{dist/commands → commands}/resource/update.d.ts +0 -0
- package/{dist/commands → commands}/resource/update.js +0 -0
- package/commands/resource/update.js.map +1 -0
- package/commands/resource/update.ts +77 -0
- package/{dist/commands → commands}/runCronJobs.d.ts +0 -0
- package/{dist/commands → commands}/runCronJobs.js +0 -0
- package/commands/runCronJobs.js.map +1 -0
- package/commands/runCronJobs.ts +45 -0
- package/{dist/commands → commands}/start.d.ts +0 -0
- package/{dist/commands → commands}/start.js +4 -0
- package/commands/start.js.map +1 -0
- package/commands/start.ts +140 -0
- package/{dist/commands → commands}/team/create.d.ts +0 -0
- package/{dist/commands → commands}/team/create.js +0 -0
- package/commands/team/create.js.map +1 -0
- package/commands/team/create.ts +60 -0
- package/{dist/commands → commands}/team/delete.d.ts +0 -0
- package/{dist/commands → commands}/team/delete.js +0 -0
- package/commands/team/delete.js.map +1 -0
- package/commands/team/delete.ts +54 -0
- package/{dist/commands → commands}/team/index.d.ts +0 -0
- package/{dist/commands → commands}/team/index.js +0 -0
- package/commands/team/index.js.map +1 -0
- package/commands/team/index.ts +15 -0
- package/{dist/commands → commands}/team/member/delete.d.ts +0 -0
- package/{dist/commands → commands}/team/member/delete.js +0 -0
- package/commands/team/member/delete.js.map +1 -0
- package/commands/team/member/delete.ts +61 -0
- package/{dist/commands → commands}/team/member/index.d.ts +0 -0
- package/{dist/commands → commands}/team/member/index.js +0 -0
- package/commands/team/member/index.js.map +1 -0
- package/commands/team/member/index.ts +14 -0
- package/{dist/commands → commands}/team/member/invite.d.ts +0 -0
- package/{dist/commands → commands}/team/member/invite.js +0 -0
- package/commands/team/member/invite.js.map +1 -0
- package/commands/team/member/invite.ts +61 -0
- package/{dist/commands → commands}/team/member/update.d.ts +0 -0
- package/{dist/commands → commands}/team/member/update.js +0 -0
- package/commands/team/member/update.js.map +1 -0
- package/commands/team/member/update.ts +70 -0
- package/{dist/commands → commands}/team/update.d.ts +0 -0
- package/{dist/commands → commands}/team/update.js +0 -0
- package/commands/team/update.js.map +1 -0
- package/commands/team/update.ts +60 -0
- package/index.d.ts +2 -0
- package/{dist/index.js → index.js} +2 -6
- package/index.js.map +1 -0
- package/index.ts +74 -0
- package/jest.config.js +1 -0
- package/jest.setup.d.ts +1 -0
- package/jest.setup.js +6 -0
- package/jest.setup.js.map +1 -0
- package/jest.setup.ts +4 -0
- package/lib/__snapshots__/getBlockConfigFromTypeScript.test.ts.snap +3872 -0
- package/{dist/lib → lib}/app.d.ts +17 -17
- package/{dist/lib → lib}/app.js +29 -29
- package/lib/app.js.map +1 -0
- package/lib/app.ts +797 -0
- package/{dist/lib → lib}/asset.d.ts +0 -0
- package/{dist/lib → lib}/asset.js +0 -0
- package/lib/asset.js.map +1 -0
- package/lib/asset.ts +43 -0
- package/{dist/lib → lib}/authentication.d.ts +3 -3
- package/{dist/lib → lib}/authentication.js +47 -15
- package/lib/authentication.js.map +1 -0
- package/lib/authentication.ts +193 -0
- package/{dist/lib → lib}/block.d.ts +16 -16
- package/{dist/lib → lib}/block.js +35 -26
- package/lib/block.js.map +1 -0
- package/lib/block.test.d.ts +1 -0
- package/lib/block.test.js +106 -0
- package/lib/block.test.js.map +1 -0
- package/lib/block.test.ts +103 -0
- package/lib/block.ts +384 -0
- package/{dist/lib → lib}/coercers.d.ts +2 -2
- package/{dist/lib → lib}/coercers.js +2 -2
- package/lib/coercers.js.map +1 -0
- package/lib/coercers.test.d.ts +1 -0
- package/lib/coercers.test.js +28 -0
- package/lib/coercers.test.js.map +1 -0
- package/lib/coercers.test.ts +27 -0
- package/lib/coercers.ts +57 -0
- package/{dist/lib → lib}/getBlockConfigFromTypeScript.d.ts +1 -1
- package/{dist/lib → lib}/getBlockConfigFromTypeScript.js +38 -36
- package/lib/getBlockConfigFromTypeScript.js.map +1 -0
- package/lib/getBlockConfigFromTypeScript.test.d.ts +1 -0
- package/lib/getBlockConfigFromTypeScript.test.js +238 -0
- package/lib/getBlockConfigFromTypeScript.test.js.map +1 -0
- package/lib/getBlockConfigFromTypeScript.test.ts +281 -0
- package/lib/getBlockConfigFromTypeScript.ts +354 -0
- package/{dist/lib → lib}/initAxios.d.ts +1 -1
- package/{dist/lib → lib}/initAxios.js +3 -4
- package/lib/initAxios.js.map +1 -0
- package/lib/initAxios.ts +16 -0
- package/{dist/lib → lib}/loadWebpackConfig.d.ts +3 -3
- package/{dist/lib → lib}/loadWebpackConfig.js +3 -3
- package/lib/loadWebpackConfig.js.map +1 -0
- package/lib/loadWebpackConfig.ts +59 -0
- package/{dist/lib → lib}/organization.d.ts +1 -1
- package/{dist/lib → lib}/organization.js +0 -0
- package/lib/organization.js.map +1 -0
- package/lib/organization.ts +105 -0
- package/{dist/lib → lib}/output.d.ts +0 -0
- package/{dist/lib → lib}/output.js +0 -0
- package/lib/output.js.map +1 -0
- package/lib/output.ts +19 -0
- package/{dist/lib → lib}/processCss.d.ts +1 -1
- package/{dist/lib → lib}/processCss.js +3 -3
- package/lib/processCss.js.map +1 -0
- package/lib/processCss.ts +24 -0
- package/{dist/lib → lib}/resource.d.ts +0 -0
- package/{dist/lib → lib}/resource.js +1 -1
- package/lib/resource.js.map +1 -0
- package/lib/resource.ts +128 -0
- package/{dist/lib → lib}/serverImport.d.ts +1 -1
- package/{dist/lib → lib}/serverImport.js +2 -2
- package/lib/serverImport.js.map +1 -0
- package/lib/serverImport.ts +43 -0
- package/{dist/lib → lib}/team.d.ts +0 -0
- package/{dist/lib → lib}/team.js +0 -0
- package/lib/team.js.map +1 -0
- package/lib/team.ts +152 -0
- package/package.json +14 -12
- package/tsconfig.json +10 -0
- package/{dist/types.d.ts → types.d.ts} +0 -0
- package/{dist/types.js → types.js} +0 -0
- package/types.js.map +1 -0
- package/types.ts +110 -0
- package/dist/commands/app/create.js.map +0 -1
- package/dist/commands/app/extract-messages.js.map +0 -1
- package/dist/commands/app/index.js.map +0 -1
- package/dist/commands/app/update.js.map +0 -1
- package/dist/commands/asset/create.js.map +0 -1
- package/dist/commands/asset/index.js.map +0 -1
- package/dist/commands/block/build.js.map +0 -1
- package/dist/commands/block/extract-messages.js.map +0 -1
- package/dist/commands/block/index.js.map +0 -1
- package/dist/commands/block/publish.js.map +0 -1
- package/dist/commands/cleanupResources.js.map +0 -1
- package/dist/commands/config/get.js.map +0 -1
- package/dist/commands/config/index.js.map +0 -1
- package/dist/commands/config/set.js.map +0 -1
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/migrate.js.map +0 -1
- package/dist/commands/organization/create.js.map +0 -1
- package/dist/commands/organization/index.js.map +0 -1
- package/dist/commands/organization/update.js.map +0 -1
- package/dist/commands/resource/create.js.map +0 -1
- package/dist/commands/resource/index.js.map +0 -1
- package/dist/commands/resource/update.js.map +0 -1
- package/dist/commands/runCronJobs.js.map +0 -1
- package/dist/commands/start.js.map +0 -1
- package/dist/commands/team/create.js.map +0 -1
- package/dist/commands/team/delete.js.map +0 -1
- package/dist/commands/team/index.js.map +0 -1
- package/dist/commands/team/member/delete.js.map +0 -1
- package/dist/commands/team/member/index.js.map +0 -1
- package/dist/commands/team/member/invite.js.map +0 -1
- package/dist/commands/team/member/update.js.map +0 -1
- package/dist/commands/team/update.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js.map +0 -1
- package/dist/lib/app.js.map +0 -1
- package/dist/lib/asset.js.map +0 -1
- package/dist/lib/authentication.js.map +0 -1
- package/dist/lib/block.js.map +0 -1
- package/dist/lib/coercers.js.map +0 -1
- package/dist/lib/getBlockConfigFromTypeScript.js.map +0 -1
- package/dist/lib/initAxios.js.map +0 -1
- package/dist/lib/loadWebpackConfig.js.map +0 -1
- package/dist/lib/organization.js.map +0 -1
- package/dist/lib/output.js.map +0 -1
- package/dist/lib/processCss.js.map +0 -1
- package/dist/lib/readPackageJson.d.ts +0 -9
- package/dist/lib/readPackageJson.js +0 -16
- package/dist/lib/readPackageJson.js.map +0 -1
- package/dist/lib/resource.js.map +0 -1
- package/dist/lib/serverImport.js.map +0 -1
- package/dist/lib/team.js.map +0 -1
- package/dist/types.js.map +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
|
|
3
|
+
import * as create from './create';
|
|
4
|
+
import * as extractMessages from './extract-messages';
|
|
5
|
+
import * as update from './update';
|
|
6
|
+
|
|
7
|
+
export { noop as handler } from '@appsemble/utils';
|
|
8
|
+
|
|
9
|
+
export const command = 'app';
|
|
10
|
+
export const description = 'Commands related to apps.';
|
|
11
|
+
|
|
12
|
+
export function builder(yargs: Argv): Argv {
|
|
13
|
+
return yargs.command(create).command(extractMessages).command(update).demandCommand(1);
|
|
14
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["update.ts"],"names":[],"mappings":";;;;;;AAEA,sDAA+D;AAE/D,0DAA2B;AAC3B,oEAA2C;AAG3C,uCAA0C;AAC1C,6DAAwD;AACxD,iDAAgD;AAkBnC,QAAA,OAAO,GAAG,mBAAmB,CAAC;AAC9B,QAAA,WAAW,GAAG,4DAA4D,CAAC;AAExF,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,UAAU,CAAC,OAAO,EAAE;QACnB,QAAQ,EAAE,iCAAiC;QAC3C,SAAS,EAAE,IAAI;KAChB,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,QAAQ,EAAE,gEAAgE;KAC3E,CAAC;SACD,MAAM,CAAC,IAAI,EAAE;QACZ,QAAQ,EAAE,8BAA8B;QACxC,IAAI,EAAE,QAAQ;KACf,CAAC;SACD,MAAM,CAAC,MAAM,EAAE;QACd,QAAQ,EAAE,yEAAyE;QACnF,MAAM,EAAE,qBAAU;KACnB,CAAC;SACD,MAAM,CAAC,iBAAiB,EAAE;QACzB,QAAQ,EAAE,8DAA8D;QACxE,OAAO,EAAE,SAAS;KACnB,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,QAAQ,EACN,2FAA2F;QAC7F,MAAM,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AAiB,CAAC,CAAC;IAE5D,mBAAM,CAAC,IAAI,CAAC,YAAY,WAAW,CAAC,MAAM,OAAO,CAAC,CAAC;IACnD,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE;QAC7B,MAAM,IAAA,eAAS,EAAC;YACd,GAAG,IAAI;YACP,iBAAiB;YACjB,EAAE;YACF,IAAI,EAAE,GAAG;YACT,MAAM;SACP,CAAC,CAAC;KACJ;AACH,CAAC;AA1BD,0BA0BC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { ReadStream } from 'fs';
|
|
2
|
+
|
|
3
|
+
import { AppsembleError, logger } from '@appsemble/node-utils';
|
|
4
|
+
import { AppVisibility } from '@appsemble/types';
|
|
5
|
+
import fg from 'fast-glob';
|
|
6
|
+
import normalizePath from 'normalize-path';
|
|
7
|
+
import { Argv } from 'yargs';
|
|
8
|
+
|
|
9
|
+
import { updateApp } from '../../lib/app';
|
|
10
|
+
import { authenticate } from '../../lib/authentication';
|
|
11
|
+
import { coerceFile } from '../../lib/coercers';
|
|
12
|
+
import { BaseArguments } from '../../types';
|
|
13
|
+
|
|
14
|
+
interface UpdateAppArguments extends BaseArguments {
|
|
15
|
+
context: string;
|
|
16
|
+
paths: string[];
|
|
17
|
+
icon: NodeJS.ReadStream | ReadStream;
|
|
18
|
+
iconBackground: string;
|
|
19
|
+
maskableIcon: NodeJS.ReadStream | ReadStream;
|
|
20
|
+
id: number;
|
|
21
|
+
template: boolean;
|
|
22
|
+
force: boolean;
|
|
23
|
+
visibility: AppVisibility;
|
|
24
|
+
sentryDsn: string;
|
|
25
|
+
sentryEnvironment: string;
|
|
26
|
+
googleAnalyticsId: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const command = 'update <paths...>';
|
|
30
|
+
export const description = 'Update an app based on a specified YAML file or directory.';
|
|
31
|
+
|
|
32
|
+
export function builder(yargs: Argv): Argv<any> {
|
|
33
|
+
return yargs
|
|
34
|
+
.positional('paths', {
|
|
35
|
+
describe: 'The path to the app to register',
|
|
36
|
+
normalize: true,
|
|
37
|
+
})
|
|
38
|
+
.option('context', {
|
|
39
|
+
describe: 'If specified, use the specified context from .appsemblerc.yaml',
|
|
40
|
+
})
|
|
41
|
+
.option('id', {
|
|
42
|
+
describe: 'The ID of the app to update.',
|
|
43
|
+
type: 'number',
|
|
44
|
+
})
|
|
45
|
+
.option('icon', {
|
|
46
|
+
describe: 'The icon to upload. By default "icon.png" in the app directory is used.',
|
|
47
|
+
coerce: coerceFile,
|
|
48
|
+
})
|
|
49
|
+
.option('icon-background', {
|
|
50
|
+
describe: 'The background color to use for the icon in opaque contexts.',
|
|
51
|
+
default: '#ffffff',
|
|
52
|
+
})
|
|
53
|
+
.option('maskable-icon', {
|
|
54
|
+
describe:
|
|
55
|
+
'The maskable icon to upload. By default "maskable-icon.png" in the app directory is used.',
|
|
56
|
+
coerce: coerceFile,
|
|
57
|
+
})
|
|
58
|
+
.option('visibility', {
|
|
59
|
+
describe: 'Visibility of the app in the public app store.',
|
|
60
|
+
default: 'unlisted',
|
|
61
|
+
choices: ['public', 'unlisted', 'private'],
|
|
62
|
+
})
|
|
63
|
+
.option('template', {
|
|
64
|
+
describe: 'Whether the app should be marked as a template.',
|
|
65
|
+
type: 'boolean',
|
|
66
|
+
default: false,
|
|
67
|
+
})
|
|
68
|
+
.option('force', {
|
|
69
|
+
describe: 'Whether the lock property should be ignored.',
|
|
70
|
+
type: 'boolean',
|
|
71
|
+
default: false,
|
|
72
|
+
})
|
|
73
|
+
.option('google-analytics-id', {
|
|
74
|
+
describe: 'The ID for Google Analytics for the app.',
|
|
75
|
+
})
|
|
76
|
+
.option('sentry-dsn', {
|
|
77
|
+
describe: 'The custom Sentry DSN for the app.',
|
|
78
|
+
})
|
|
79
|
+
.option('sentry-environment', {
|
|
80
|
+
describe: 'The environment for the custom Sentry DSN for the app.',
|
|
81
|
+
implies: ['sentry-dsn'],
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export async function handler({
|
|
86
|
+
clientCredentials,
|
|
87
|
+
id,
|
|
88
|
+
paths,
|
|
89
|
+
remote,
|
|
90
|
+
...args
|
|
91
|
+
}: UpdateAppArguments): Promise<void> {
|
|
92
|
+
if (id != null && paths.length > 1) {
|
|
93
|
+
throw new AppsembleError('Only one path may be specified when specifying an app id');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const normalizedPaths = paths.map((path) => normalizePath(path));
|
|
97
|
+
const directories = await fg(normalizedPaths, { absolute: true, onlyDirectories: true });
|
|
98
|
+
|
|
99
|
+
await authenticate(remote, 'apps:write', clientCredentials);
|
|
100
|
+
|
|
101
|
+
logger.info(`Updating ${directories.length} apps`);
|
|
102
|
+
for (const dir of directories) {
|
|
103
|
+
await updateApp({
|
|
104
|
+
...args,
|
|
105
|
+
clientCredentials,
|
|
106
|
+
id,
|
|
107
|
+
path: dir,
|
|
108
|
+
remote,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["create.ts"],"names":[],"mappings":";;;;;;AAAA,+BAA6B;AAE7B,sDAA+D;AAC/D,0DAA2B;AAC3B,oEAA2C;AAG3C,uCAAsD;AACtD,2CAA8C;AAC9C,6DAAwD;AAY3C,QAAA,OAAO,GAAG,mBAAmB,CAAC;AAC9B,QAAA,WAAW,GAAG,oCAAoC,CAAC;AAEhE,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,UAAU,CAAC,OAAO,EAAE;QACnB,QAAQ,EAAE,qCAAqC;QAC/C,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,MAAM,EAAE;QACd,QAAQ,EACN,uGAAuG;KAC1G,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,QAAQ,EACN,oJAAoJ;QACtJ,IAAI,EAAE,SAAS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AC,WAAW,CAAC,CAAC,CAAC,IAAA,YAAK,EAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YACrD,KAAK,EAAE,aAAa;YACpB,IAAI;YACJ,MAAM,EAAE,cAAc;SACvB,CAAC,CAAC;KACJ;AACH,CAAC;AA9BD,0BA8BC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { parse } from 'path';
|
|
2
|
+
|
|
3
|
+
import { AppsembleError, logger } from '@appsemble/node-utils';
|
|
4
|
+
import fg from 'fast-glob';
|
|
5
|
+
import normalizePath from 'normalize-path';
|
|
6
|
+
import { Argv } from 'yargs';
|
|
7
|
+
|
|
8
|
+
import { resolveAppIdAndRemote } from '../../lib/app';
|
|
9
|
+
import { createAsset } from '../../lib/asset';
|
|
10
|
+
import { authenticate } from '../../lib/authentication';
|
|
11
|
+
import { BaseArguments } from '../../types';
|
|
12
|
+
|
|
13
|
+
interface CreateAssetArguments extends BaseArguments {
|
|
14
|
+
name: string;
|
|
15
|
+
useFileName: boolean;
|
|
16
|
+
paths: string[];
|
|
17
|
+
appId: number;
|
|
18
|
+
context: string;
|
|
19
|
+
app: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const command = 'create <paths...>';
|
|
23
|
+
export const description = 'Create assets for an existing app.';
|
|
24
|
+
|
|
25
|
+
export function builder(yargs: Argv): Argv<any> {
|
|
26
|
+
return yargs
|
|
27
|
+
.positional('paths', {
|
|
28
|
+
describe: 'The path to the resources to create',
|
|
29
|
+
normalize: true,
|
|
30
|
+
demandOption: true,
|
|
31
|
+
})
|
|
32
|
+
.option('name', {
|
|
33
|
+
describe:
|
|
34
|
+
'The name that should be assigned to the asset. These must be unique. Will override `--use-file-name`.',
|
|
35
|
+
})
|
|
36
|
+
.option('use-file-name', {
|
|
37
|
+
describe:
|
|
38
|
+
'Whether the filename should be used as the name to refer the asset to. If this is set to false and `--name` is not specified, no name will be set.',
|
|
39
|
+
type: 'boolean',
|
|
40
|
+
default: true,
|
|
41
|
+
})
|
|
42
|
+
.option('app-id', {
|
|
43
|
+
describe: 'The ID of the app to create the resources for.',
|
|
44
|
+
type: 'number',
|
|
45
|
+
})
|
|
46
|
+
.option('app', {
|
|
47
|
+
describe: 'The path to the app.',
|
|
48
|
+
})
|
|
49
|
+
.option('context', {
|
|
50
|
+
describe: 'If specified, use the specified context from .appsemblerc.yaml',
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export async function handler({
|
|
55
|
+
app,
|
|
56
|
+
appId,
|
|
57
|
+
clientCredentials,
|
|
58
|
+
context,
|
|
59
|
+
name,
|
|
60
|
+
paths,
|
|
61
|
+
remote,
|
|
62
|
+
useFileName,
|
|
63
|
+
}: CreateAssetArguments): Promise<void> {
|
|
64
|
+
const [resolvedAppId, resolvedRemote] = await resolveAppIdAndRemote(app, context, remote, appId);
|
|
65
|
+
await authenticate(resolvedRemote, 'assets:write', clientCredentials);
|
|
66
|
+
|
|
67
|
+
const normalizedPaths = paths.map((path) => normalizePath(path));
|
|
68
|
+
const files = await fg(normalizedPaths, { absolute: true, onlyFiles: true });
|
|
69
|
+
|
|
70
|
+
if (name && files.length > 1) {
|
|
71
|
+
throw new AppsembleError('--name was specified but multiple files were found.');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
logger.info(`Creating ${files.length} asset(s)`);
|
|
75
|
+
for (const path of files) {
|
|
76
|
+
logger.info('');
|
|
77
|
+
await createAsset({
|
|
78
|
+
name: name || (useFileName ? parse(path).name : null),
|
|
79
|
+
appId: resolvedAppId,
|
|
80
|
+
path,
|
|
81
|
+
remote: resolvedRemote,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,iDAAmC;AAEnC,0CAAmD;AAA1C,gGAAA,IAAI,OAAW;AAEX,QAAA,OAAO,GAAG,OAAO,CAAC;AAClB,QAAA,WAAW,GAAG,iCAAiC,CAAC;AAE7D,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC;AAFD,0BAEC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
|
|
3
|
+
import * as create from './create';
|
|
4
|
+
|
|
5
|
+
export { noop as handler } from '@appsemble/utils';
|
|
6
|
+
|
|
7
|
+
export const command = 'asset';
|
|
8
|
+
export const description = 'Commands related to app assets.';
|
|
9
|
+
|
|
10
|
+
export function builder(yargs: Argv): Argv {
|
|
11
|
+
return yargs.command(create).demandCommand(1);
|
|
12
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["build.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA+C;AAC/C,0DAA2B;AAC3B,oEAA2C;AAG3C,2CAA6D;AAOhD,QAAA,OAAO,GAAG,kBAAkB,CAAC;AAC7B,QAAA,WAAW,GAAG,mCAAmC,CAAC;AAE/D,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE;QAC/B,QAAQ,EAAE,mCAAmC;KAC9C,CAAC,CAAC;AACL,CAAC;AAJD,0BAIC;AAEM,KAAK,UAAU,OAAO,CAAC,EAAE,KAAK,EAAuB;IAC1D,MAAM,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,wBAAa,EAAC,IAAI,CAAC,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,MAAM,IAAA,mBAAE,EAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IACzF,mBAAM,CAAC,IAAI,CAAC,YAAY,WAAW,CAAC,MAAM,SAAS,CAAC,CAAC;IACrD,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE;QAC7B,mBAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChB,MAAM,MAAM,GAAG,MAAM,IAAA,sBAAc,EAAC,GAAG,CAAC,CAAC;QAEzC,MAAM,IAAA,kBAAU,EAAC,MAAM,CAAC,CAAC;KAC1B;AACH,CAAC;AAVD,0BAUC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { logger } from '@appsemble/node-utils';
|
|
2
|
+
import fg from 'fast-glob';
|
|
3
|
+
import normalizePath from 'normalize-path';
|
|
4
|
+
import { Argv } from 'yargs';
|
|
5
|
+
|
|
6
|
+
import { buildBlock, getBlockConfig } from '../../lib/block';
|
|
7
|
+
import { BaseArguments } from '../../types';
|
|
8
|
+
|
|
9
|
+
interface BuildBlockArguments extends BaseArguments {
|
|
10
|
+
paths: string[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const command = 'build <paths...>';
|
|
14
|
+
export const description = 'Build a block without publishing.';
|
|
15
|
+
|
|
16
|
+
export function builder(yargs: Argv): Argv<any> {
|
|
17
|
+
return yargs.positional('paths', {
|
|
18
|
+
describe: 'The paths to the blocks to build.',
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export async function handler({ paths }: BuildBlockArguments): Promise<void> {
|
|
23
|
+
const normalizedPaths = paths.map((path) => normalizePath(path));
|
|
24
|
+
const directories = await fg(normalizedPaths, { absolute: true, onlyDirectories: true });
|
|
25
|
+
logger.info(`Building ${directories.length} Blocks`);
|
|
26
|
+
for (const dir of directories) {
|
|
27
|
+
logger.info('');
|
|
28
|
+
const config = await getBlockConfig(dir);
|
|
29
|
+
|
|
30
|
+
await buildBlock(config);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
File without changes
|
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,EAAC,GAAG,CAAC,CAAC;QACzC,mBAAM,CAAC,IAAI,CAAC,cAAc,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAEzC,MAAM,IAAA,4BAAoB,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KAC3C;AACH,CAAC;AAZD,0BAYC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { logger } from '@appsemble/node-utils';
|
|
2
|
+
import fg from 'fast-glob';
|
|
3
|
+
import normalizePath from 'normalize-path';
|
|
4
|
+
import { Argv } from 'yargs';
|
|
5
|
+
|
|
6
|
+
import { getBlockConfig, processBlockMessages } from '../../lib/block';
|
|
7
|
+
import { BaseArguments } from '../../types';
|
|
8
|
+
|
|
9
|
+
interface BuildBlockArguments extends BaseArguments {
|
|
10
|
+
paths: string[];
|
|
11
|
+
languages: string[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const command = 'extract-messages <paths...>';
|
|
15
|
+
export const description = 'Extract messages from a block.';
|
|
16
|
+
|
|
17
|
+
export function builder(yargs: Argv): Argv<any> {
|
|
18
|
+
return yargs
|
|
19
|
+
.positional('paths', {
|
|
20
|
+
describe: 'The paths to the blocks to extract messages from.',
|
|
21
|
+
})
|
|
22
|
+
.option('languages', {
|
|
23
|
+
type: 'array',
|
|
24
|
+
describe: 'The languages to extract.',
|
|
25
|
+
default: [],
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function handler({ languages, paths }: BuildBlockArguments): Promise<void> {
|
|
30
|
+
const normalizedPaths = paths.map((path) => normalizePath(path));
|
|
31
|
+
const directories = await fg(normalizedPaths, { absolute: true, onlyDirectories: true });
|
|
32
|
+
const langs = [...new Set(['en', ...languages.map((language) => language.toLowerCase())])];
|
|
33
|
+
logger.info(`Extracting messages from ${directories.length} Blocks`);
|
|
34
|
+
for (const dir of directories) {
|
|
35
|
+
logger.info('');
|
|
36
|
+
const config = await getBlockConfig(dir);
|
|
37
|
+
logger.info(`Processing ${config.name}`);
|
|
38
|
+
|
|
39
|
+
await processBlockMessages(config, langs);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,+CAAiC;AACjC,oEAAsD;AACtD,mDAAqC;AAErC,0CAAmD;AAA1C,gGAAA,IAAI,OAAW;AAEX,QAAA,OAAO,GAAG,OAAO,CAAC;AAClB,QAAA,WAAW,GAAG,6BAA6B,CAAC;AAEzD,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AACzF,CAAC;AAFD,0BAEC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
|
|
3
|
+
import * as build from './build';
|
|
4
|
+
import * as extractMessages from './extract-messages';
|
|
5
|
+
import * as publish from './publish';
|
|
6
|
+
|
|
7
|
+
export { noop as handler } from '@appsemble/utils';
|
|
8
|
+
|
|
9
|
+
export const command = 'block';
|
|
10
|
+
export const description = 'Commands related to blocks.';
|
|
11
|
+
|
|
12
|
+
export function builder(yargs: Argv): Argv {
|
|
13
|
+
return yargs.command(build).command(extractMessages).command(publish).demandCommand(1);
|
|
14
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.js","sourceRoot":"","sources":["publish.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA+C;AAC/C,0DAA2B;AAC3B,oEAA2C;AAG3C,6DAAwD;AACxD,2CAA2E;AAS9D,QAAA,OAAO,GAAG,oBAAoB,CAAC;AAC/B,QAAA,WAAW,GAAG,kBAAkB,C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,0 +1,58 @@
|
|
|
1
|
+
import { logger } from '@appsemble/node-utils';
|
|
2
|
+
import fg from 'fast-glob';
|
|
3
|
+
import normalizePath from 'normalize-path';
|
|
4
|
+
import { Argv } from 'yargs';
|
|
5
|
+
|
|
6
|
+
import { authenticate } from '../../lib/authentication';
|
|
7
|
+
import { buildBlock, getBlockConfig, publishBlock } from '../../lib/block';
|
|
8
|
+
import { BaseArguments } from '../../types';
|
|
9
|
+
|
|
10
|
+
interface PublishBlockArguments extends BaseArguments {
|
|
11
|
+
paths: string[];
|
|
12
|
+
build: boolean;
|
|
13
|
+
ignoreConflict: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const command = 'publish <paths...>';
|
|
17
|
+
export const description = 'Publish a block.';
|
|
18
|
+
|
|
19
|
+
export function builder(yargs: Argv): Argv<any> {
|
|
20
|
+
return yargs
|
|
21
|
+
.positional('paths', {
|
|
22
|
+
describe: 'The paths to the blocks to publish.',
|
|
23
|
+
})
|
|
24
|
+
.option('build', {
|
|
25
|
+
alias: 'b',
|
|
26
|
+
describe: 'If specified, builds the block with webpack before publishing it.',
|
|
27
|
+
type: 'boolean',
|
|
28
|
+
default: true,
|
|
29
|
+
})
|
|
30
|
+
.option('ignore-conflict', {
|
|
31
|
+
describe: 'If specified, conflicts with an existing block version are ignored.',
|
|
32
|
+
type: 'boolean',
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export async function handler({
|
|
37
|
+
build,
|
|
38
|
+
clientCredentials,
|
|
39
|
+
ignoreConflict,
|
|
40
|
+
paths,
|
|
41
|
+
remote,
|
|
42
|
+
}: PublishBlockArguments): Promise<void> {
|
|
43
|
+
await authenticate(remote, 'blocks:write', clientCredentials);
|
|
44
|
+
|
|
45
|
+
const normalizedPaths = paths.map((path) => normalizePath(path));
|
|
46
|
+
const directories = await fg(normalizedPaths, { absolute: true, onlyDirectories: true });
|
|
47
|
+
logger.info(`Publishing ${directories.length} Blocks`);
|
|
48
|
+
for (const dir of directories) {
|
|
49
|
+
logger.info('');
|
|
50
|
+
const config = await getBlockConfig(dir);
|
|
51
|
+
|
|
52
|
+
if (build) {
|
|
53
|
+
await buildBlock(config);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
await publishBlock(config, ignoreConflict);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanupResources.js","sourceRoot":"","sources":["cleanupResources.ts"],"names":[],"mappings":";;;AAEA,sDAAmD;AAGtC,QAAA,OAAO,GAAG,mBAAmB,CAAC;AAC9B,QAAA,WAAW,GAAG,kDAAkD,CAAC;AAE9E,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,4FAA4F;KACnG,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,yCAAyC;QAC/C,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,IAAI;KACd,CAAC;SACD,MAAM,CAAC,cAAc,EAAE;QACtB,IAAI,EAAE,qCAAqC;QAC3C,IAAI,EAAE,SAAS;KAChB,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,yCAAyC;QAC/C,OAAO,EAAE,CAAC,eAAe,EAAE,mBAAmB,CAAC;KAChD,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,2CAA2C;QACjD,OAAO,EAAE,CAAC,eAAe,EAAE,mBAAmB,CAAC;KAChD,CAAC;SACD,MAAM,CAAC,mBAAmB,EAAE;QAC3B,IAAI,EAAE,+CAA+C;QACrD,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;KAC5C,CAAC;SACD,MAAM,CAAC,cAAc,EAAE;QACtB,IAAI,EAAE,wHAAwH;QAC9H,SAAS,EAAE,CAAC,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,mBAAmB,CAAC;KACpF,CAAC,CAAC;AACP,CAAC;AA9BD,0BA8BC;AAEM,KAAK,UAAU,OAAO,CAAC,IAAmB;IAC/C,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,GAAG,MAAM,IAAA,2BAAY,EAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;IACxF,OAAO,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,gBAAgB,EAAE,CAAC;AAC5B,CAAC;AAJD,0BAIC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
|
|
3
|
+
import { serverImport } from '../lib/serverImport';
|
|
4
|
+
import { BaseArguments } from '../types';
|
|
5
|
+
|
|
6
|
+
export const command = 'cleanup-resources';
|
|
7
|
+
export const description = 'Deletes all expired resources from the database.';
|
|
8
|
+
|
|
9
|
+
export function builder(yargs: Argv): Argv<any> {
|
|
10
|
+
return yargs
|
|
11
|
+
.option('database-host', {
|
|
12
|
+
desc: 'The host of the database to connect to. This defaults to the connected database container.',
|
|
13
|
+
})
|
|
14
|
+
.option('database-port', {
|
|
15
|
+
desc: 'The port of the database to connect to.',
|
|
16
|
+
type: 'number',
|
|
17
|
+
default: 5432,
|
|
18
|
+
})
|
|
19
|
+
.option('database-ssl', {
|
|
20
|
+
desc: 'Use SSL to connect to the database.',
|
|
21
|
+
type: 'boolean',
|
|
22
|
+
})
|
|
23
|
+
.option('database-name', {
|
|
24
|
+
desc: 'The name of the database to connect to.',
|
|
25
|
+
implies: ['database-user', 'database-password'],
|
|
26
|
+
})
|
|
27
|
+
.option('database-user', {
|
|
28
|
+
desc: 'The user to use to login to the database.',
|
|
29
|
+
implies: ['database-name', 'database-password'],
|
|
30
|
+
})
|
|
31
|
+
.option('database-password', {
|
|
32
|
+
desc: 'The password to use to login to the database.',
|
|
33
|
+
implies: ['database-name', 'database-user'],
|
|
34
|
+
})
|
|
35
|
+
.option('database-url', {
|
|
36
|
+
desc: 'A connection string for the database to connect to. This is an alternative to the separate database related variables.',
|
|
37
|
+
conflicts: ['database-host', 'database-name', 'database-user', 'database-password'],
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export async function handler(argv: BaseArguments): Promise<void> {
|
|
42
|
+
const { cleanupResources, setArgv } = await serverImport('setArgv', 'cleanupResources');
|
|
43
|
+
setArgv(argv);
|
|
44
|
+
return cleanupResources();
|
|
45
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["get.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAuC;AACvC,8DAAoC;AASvB,QAAA,OAAO,GAAG,WAAW,CAAC;AACtB,QAAA,WAAW,GAAG,0DAA0D,CAAC;AAEtF,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE;QAC7B,QAAQ,EAAE,4BAA4B;KACvC,CAAC,CAAC;AACL,CAAC;AAJD,0BAIC;AAEM,KAAK,UAAU,OAAO,CAAC,EAAE,GAAG,EAAsB;IACvD,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,IAAA,qBAAS,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9D,IAAI,IAAA,WAAG,EAAC,WAAW,EAAE,iBAAiB,CAAC,EAAE;QACvC,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAE,WAAmC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;KACxE;AACH,CAAC;AAND,0BAMC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { has } from '@appsemble/utils';
|
|
2
|
+
import readPkgUp from 'read-pkg-up';
|
|
3
|
+
import { Argv } from 'yargs';
|
|
4
|
+
|
|
5
|
+
import { BaseArguments, MonoRepoPackageJson } from '../../types';
|
|
6
|
+
|
|
7
|
+
interface ConfigGetArguments extends BaseArguments {
|
|
8
|
+
key: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const command = 'get <key>';
|
|
12
|
+
export const description = 'Get an Appsemble configuration option from package.json.';
|
|
13
|
+
|
|
14
|
+
export function builder(yargs: Argv): Argv<any> {
|
|
15
|
+
return yargs.positional('key', {
|
|
16
|
+
describe: 'The key whose value to get',
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export async function handler({ key }: ConfigGetArguments): Promise<void> {
|
|
21
|
+
const { packageJson } = await readPkgUp({ normalize: false });
|
|
22
|
+
if (has(packageJson, 'appsembleServer')) {
|
|
23
|
+
// eslint-disable-next-line no-console
|
|
24
|
+
console.log((packageJson as MonoRepoPackageJson).appsembleServer[key]);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2CAA6B;AAC7B,2CAA6B;AAE7B,0CAAmD;AAA1C,gGAAA,IAAI,OAAW;AAEX,QAAA,OAAO,GAAG,QAAQ,CAAC;AACnB,QAAA,WAAW,GAAG,2CAA2C,CAAC;AAEvE,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC;AAFD,0BAEC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
|
|
3
|
+
import * as get from './get';
|
|
4
|
+
import * as set from './set';
|
|
5
|
+
|
|
6
|
+
export { noop as handler } from '@appsemble/utils';
|
|
7
|
+
|
|
8
|
+
export const command = 'config';
|
|
9
|
+
export const description = 'Commands related to local configurations.';
|
|
10
|
+
|
|
11
|
+
export function builder(yargs: Argv): Argv {
|
|
12
|
+
return yargs.command(get).command(set).demandCommand(1);
|
|
13
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.js","sourceRoot":"","sources":["set.ts"],"names":[],"mappings":";;;;;;AAAA,+BAA+B;AAE/B,sDAA0D;AAC1D,4CAAuC;AACvC,8DAAoC;AAUvB,QAAA,OAAO,GAAG,mBAAmB,CAAC;AAC9B,QAAA,WAAW,GAAG,wDAAwD,CAAC;AAEpF,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,UAAU,CAAC,KAAK,EAAE;QACjB,QAAQ,EAAE,4BAA4B;KACvC,CAAC;SACD,UAAU,CAAC,OAAO,EAAE;QACnB,QAAQ,EAAE,kBAAkB;KAC7B,CAAC,CAAC;AACP,CAAC;AARD,0BAQC;AAEM,KAAK,UAAU,OAAO,CAAC,EAAE,GAAG,EAAE,KAAK,EAAsB;IAC9D,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,qBAAS,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IACpE,IAAI,CAAC,IAAA,WAAG,EAAC,WAAW,EAAE,iBAAiB,CAAC,EAAE;QACxC,WAAW,CAAC,eAAe,GAAG,EAAE,CAAC;KAClC;IACD,IAAI,MAAM,CAAC;IACX,IAAI;QACF,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC5B;IAAC,MAAM;QACN,MAAM,GAAG,KAAK,CAAC;KAChB;IACA,WAAmC,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;IACnE,MAAM,IAAA,sBAAS,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACnC,mBAAM,CAAC,IAAI,CACT,8BAA8B,GAAG,OAAO,IAAA,cAAO,EAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,OAAO,IAAI,EAAE,CACvF,CAAC;AACJ,CAAC;AAhBD,0BAgBC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { inspect } from 'util';
|
|
2
|
+
|
|
3
|
+
import { logger, writeData } from '@appsemble/node-utils';
|
|
4
|
+
import { has } from '@appsemble/utils';
|
|
5
|
+
import readPkgUp from 'read-pkg-up';
|
|
6
|
+
import { Argv } from 'yargs';
|
|
7
|
+
|
|
8
|
+
import { BaseArguments, MonoRepoPackageJson } from '../../types';
|
|
9
|
+
|
|
10
|
+
interface ConfigSetArguments extends BaseArguments {
|
|
11
|
+
key: string;
|
|
12
|
+
value: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const command = 'set <key> <value>';
|
|
16
|
+
export const description = 'Set an Appsemble configuration option in package.json.';
|
|
17
|
+
|
|
18
|
+
export function builder(yargs: Argv): Argv<any> {
|
|
19
|
+
return yargs
|
|
20
|
+
.positional('key', {
|
|
21
|
+
describe: 'The key whose value to set',
|
|
22
|
+
})
|
|
23
|
+
.positional('value', {
|
|
24
|
+
describe: 'The value to set',
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export async function handler({ key, value }: ConfigSetArguments): Promise<void> {
|
|
29
|
+
const { packageJson, path } = await readPkgUp({ normalize: false });
|
|
30
|
+
if (!has(packageJson, 'appsembleServer')) {
|
|
31
|
+
packageJson.appsembleServer = {};
|
|
32
|
+
}
|
|
33
|
+
let parsed;
|
|
34
|
+
try {
|
|
35
|
+
parsed = JSON.parse(value);
|
|
36
|
+
} catch {
|
|
37
|
+
parsed = value;
|
|
38
|
+
}
|
|
39
|
+
(packageJson as MonoRepoPackageJson).appsembleServer[key] = parsed;
|
|
40
|
+
await writeData(path, packageJson);
|
|
41
|
+
logger.info(
|
|
42
|
+
`Set option appsembleServer.${key} to ${inspect(parsed, { colors: true })} in ${path}`,
|
|
43
|
+
);
|
|
44
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["login.ts"],"names":[],"mappings":";;;AAAA,wDAAyD;AAAhD,yGAAA,KAAK,OAAW;AAEZ,QAAA,OAAO,GAAG,OAAO,CAAC;AAClB,QAAA,WAAW,GACtB,sFAAsF,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logout.js","sourceRoot":"","sources":["logout.ts"],"names":[],"mappings":";;;AAAA,wDAA0D;AAAjD,yGAAA,MAAM,OAAW;AAEb,QAAA,OAAO,GAAG,QAAQ,CAAC;AACnB,QAAA,WAAW,GACtB,oHAAoH,CAAC"}
|
|
File without changes
|