@appsemble/cli 0.20.27 → 0.20.29
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 +4 -4
- package/index.js +0 -0
- package/package.json +5 -5
- package/__fixtures__/getBlockConfigFromTypeScript/comments/index.ts +0 -40
- package/__fixtures__/getBlockConfigFromTypeScript/comments/tsconfig.json +0 -7
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateActions/index.ts +0 -34
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateActions/tsconfig.json +0 -7
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventEmitters/index.ts +0 -34
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventEmitters/tsconfig.json +0 -7
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventListeners/index.ts +0 -34
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventListeners/tsconfig.json +0 -7
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateParameters/index.ts +0 -34
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateParameters/tsconfig.json +0 -7
- package/__fixtures__/getBlockConfigFromTypeScript/fontawesomeParameters/index.ts +0 -11
- package/__fixtures__/getBlockConfigFromTypeScript/fontawesomeParameters/tsconfig.json +0 -7
- package/__fixtures__/getBlockConfigFromTypeScript/tsError/index.ts +0 -4
- package/__fixtures__/getBlockConfigFromTypeScript/tsError/tsconfig.json +0 -8
- package/__fixtures__/getBlockConfigFromTypeScript/valid/index.ts +0 -28
- package/__fixtures__/getBlockConfigFromTypeScript/valid/tsconfig.json +0 -7
- package/__fixtures__/makePayload/with-icon/icon.svg +0 -2
- package/assets/appsemblerc.schema.json +0 -150
- 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/commands/app/create.js.map +0 -1
- package/commands/app/create.ts +0 -104
- package/commands/app/extract-messages.js.map +0 -1
- package/commands/app/extract-messages.ts +0 -56
- package/commands/app/index.js.map +0 -1
- package/commands/app/index.ts +0 -18
- package/commands/app/update.js.map +0 -1
- package/commands/app/update.ts +0 -111
- package/commands/asset/create.js.map +0 -1
- package/commands/asset/create.ts +0 -84
- package/commands/asset/index.js.map +0 -1
- package/commands/asset/index.ts +0 -12
- package/commands/block/build.js.map +0 -1
- package/commands/block/build.ts +0 -32
- package/commands/block/extract-messages.js.map +0 -1
- package/commands/block/extract-messages.ts +0 -41
- package/commands/block/index.js.map +0 -1
- package/commands/block/index.ts +0 -18
- package/commands/block/publish.js.map +0 -1
- package/commands/block/publish.ts +0 -58
- package/commands/cleanupResources.js.map +0 -1
- package/commands/cleanupResources.ts +0 -45
- package/commands/config/get.js.map +0 -1
- package/commands/config/get.ts +0 -27
- package/commands/config/index.js.map +0 -1
- package/commands/config/index.ts +0 -16
- package/commands/config/set.js.map +0 -1
- package/commands/config/set.ts +0 -45
- package/commands/login.js.map +0 -1
- package/commands/login.ts +0 -5
- package/commands/logout.js.map +0 -1
- package/commands/logout.ts +0 -5
- package/commands/migrate.js.map +0 -1
- package/commands/migrate.ts +0 -50
- package/commands/organization/create.js.map +0 -1
- package/commands/organization/create.ts +0 -65
- package/commands/organization/index.js.map +0 -1
- package/commands/organization/index.ts +0 -16
- package/commands/organization/update.js.map +0 -1
- package/commands/organization/update.ts +0 -65
- package/commands/resource/create.js.map +0 -1
- package/commands/resource/create.ts +0 -78
- package/commands/resource/index.js.map +0 -1
- package/commands/resource/index.ts +0 -16
- package/commands/resource/update.js.map +0 -1
- package/commands/resource/update.ts +0 -77
- package/commands/runCronJobs.js.map +0 -1
- package/commands/runCronJobs.ts +0 -45
- package/commands/start.js.map +0 -1
- package/commands/start.ts +0 -140
- package/commands/team/create.js.map +0 -1
- package/commands/team/create.ts +0 -60
- package/commands/team/delete.js.map +0 -1
- package/commands/team/delete.ts +0 -54
- package/commands/team/index.js.map +0 -1
- package/commands/team/index.ts +0 -20
- package/commands/team/member/delete.js.map +0 -1
- package/commands/team/member/delete.ts +0 -61
- package/commands/team/member/index.js.map +0 -1
- package/commands/team/member/index.ts +0 -18
- package/commands/team/member/invite.js.map +0 -1
- package/commands/team/member/invite.ts +0 -61
- package/commands/team/member/update.js.map +0 -1
- package/commands/team/member/update.ts +0 -70
- package/commands/team/update.js.map +0 -1
- package/commands/team/update.ts +0 -60
- package/index.js.map +0 -1
- package/index.ts +0 -74
- package/jest.config.js +0 -3
- package/jest.setup.js.map +0 -1
- package/jest.setup.ts +0 -4
- package/lib/__snapshots__/getBlockConfigFromTypeScript.test.ts.snap +0 -4241
- package/lib/app.js.map +0 -1
- package/lib/app.ts +0 -795
- package/lib/asset.js.map +0 -1
- package/lib/asset.ts +0 -43
- package/lib/authentication.js.map +0 -1
- package/lib/authentication.ts +0 -194
- package/lib/block.js.map +0 -1
- package/lib/block.test.js.map +0 -1
- package/lib/block.test.ts +0 -103
- package/lib/block.ts +0 -384
- package/lib/coercers.js.map +0 -1
- package/lib/coercers.test.js.map +0 -1
- package/lib/coercers.test.ts +0 -27
- package/lib/coercers.ts +0 -58
- package/lib/getBlockConfigFromTypeScript.js.map +0 -1
- package/lib/getBlockConfigFromTypeScript.test.js.map +0 -1
- package/lib/getBlockConfigFromTypeScript.test.ts +0 -282
- package/lib/getBlockConfigFromTypeScript.ts +0 -356
- package/lib/initAxios.js.map +0 -1
- package/lib/initAxios.ts +0 -16
- package/lib/loadWebpackConfig.js.map +0 -1
- package/lib/loadWebpackConfig.ts +0 -52
- package/lib/organization.js.map +0 -1
- package/lib/organization.ts +0 -105
- package/lib/output.js.map +0 -1
- package/lib/output.ts +0 -19
- package/lib/processCss.js.map +0 -1
- package/lib/processCss.ts +0 -24
- package/lib/resource.js.map +0 -1
- package/lib/resource.ts +0 -128
- package/lib/serverImport.js.map +0 -1
- package/lib/serverImport.ts +0 -42
- package/lib/team.js.map +0 -1
- package/lib/team.ts +0 -152
- package/tsconfig.json +0 -9
- package/types.js.map +0 -1
- package/types.ts +0 -110
|
@@ -1,56 +0,0 @@
|
|
|
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 { writeAppMessages } from '../../lib/app.js';
|
|
7
|
-
import { BaseArguments } from '../../types.js';
|
|
8
|
-
|
|
9
|
-
interface BuildBlockArguments extends BaseArguments {
|
|
10
|
-
paths: string[];
|
|
11
|
-
languages: string;
|
|
12
|
-
verify: string;
|
|
13
|
-
format: 'json' | 'yaml';
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const command = 'extract-messages <paths...>';
|
|
17
|
-
export const description = 'Extract messages from a block.';
|
|
18
|
-
|
|
19
|
-
export function builder(yargs: Argv): Argv<any> {
|
|
20
|
-
return yargs
|
|
21
|
-
.positional('paths', {
|
|
22
|
-
describe: 'The paths to the apps to extract messages from.',
|
|
23
|
-
})
|
|
24
|
-
.option('languages', {
|
|
25
|
-
describe: 'The languages to extract as a comma separated list.',
|
|
26
|
-
})
|
|
27
|
-
.option('format', {
|
|
28
|
-
describe: 'The format that should be used for the output.',
|
|
29
|
-
type: 'string',
|
|
30
|
-
choices: ['yaml', 'json'],
|
|
31
|
-
default: 'json',
|
|
32
|
-
})
|
|
33
|
-
.option('verify', {
|
|
34
|
-
describe:
|
|
35
|
-
'A comma separated list of languages to verify. The CLI will fail if a message is missing for one of the given languages',
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export async function handler({
|
|
40
|
-
format = 'json',
|
|
41
|
-
languages = '',
|
|
42
|
-
paths,
|
|
43
|
-
verify = '',
|
|
44
|
-
}: BuildBlockArguments): Promise<void> {
|
|
45
|
-
const normalizedPaths = paths.map((path) => normalizePath(path));
|
|
46
|
-
const directories = await fg(normalizedPaths, { absolute: true, onlyDirectories: true });
|
|
47
|
-
logger.info(`Extracting messages from ${directories.length} apps`);
|
|
48
|
-
for (const dir of directories) {
|
|
49
|
-
await writeAppMessages(
|
|
50
|
-
dir,
|
|
51
|
-
languages.split(',').filter(Boolean),
|
|
52
|
-
verify.split(',').filter(Boolean),
|
|
53
|
-
format,
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC;AAC7B,MAAM,CAAC,MAAM,WAAW,GAAG,2BAA2B,CAAC;AAEvD,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,OAAO,CAAC,MAAkC,CAAC;SAC3C,OAAO,CAAC,eAA2C,CAAC;SACpD,OAAO,CAAC,MAAkC,CAAC;SAC3C,aAAa,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC"}
|
package/commands/app/index.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Argv, CommandModule } from 'yargs';
|
|
2
|
-
|
|
3
|
-
import * as create from './create.js';
|
|
4
|
-
import * as extractMessages from './extract-messages.js';
|
|
5
|
-
import * as update from './update.js';
|
|
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
|
|
14
|
-
.command(create as unknown as CommandModule)
|
|
15
|
-
.command(extractMessages as unknown as CommandModule)
|
|
16
|
-
.command(update as unknown as CommandModule)
|
|
17
|
-
.demandCommand(1);
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["update.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAG3C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAkBnD,MAAM,CAAC,MAAM,OAAO,GAAG,mBAAmB,CAAC;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAG,4DAA4D,CAAC;AAExF,MAAM,UAAU,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,UAAU;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,EAAE,UAAU;KACnB,CAAC;SACD,MAAM,CAAC,YAAY,EAAE;QACpB,QAAQ,EAAE,gDAAgD;QAC1D,OAAO,EA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W,EAAE;QAC7B,MAAM,SAAS,CAAC;YACd,GAAG,IAAI;YACP,iBAAiB;YACjB,EAAE;YACF,IAAI,EAAE,GAAG;YACT,MAAM;SACP,CAAC,CAAC;KACJ;AACH,CAAC"}
|
package/commands/app/update.ts
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { ReadStream } from 'node: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.js';
|
|
10
|
-
import { authenticate } from '../../lib/authentication.js';
|
|
11
|
-
import { coerceFile } from '../../lib/coercers.js';
|
|
12
|
-
import { BaseArguments } from '../../types.js';
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAG3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAY3D,MAAM,CAAC,MAAM,OAAO,GAAG,mBAAmB,CAAC;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAG,oCAAoC,CAAC;AAEhE,MAAM,UAAU,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,EAA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AC,EAAE,CAAC,CAAC;QAChB,MAAM,WAAW,CAAC;YAChB,IAAI,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,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"}
|
package/commands/asset/create.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { parse } from 'node: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.js';
|
|
9
|
-
import { createAsset } from '../../lib/asset.js';
|
|
10
|
-
import { authenticate } from '../../lib/authentication.js';
|
|
11
|
-
import { BaseArguments } from '../../types.js';
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAC/B,MAAM,CAAC,MAAM,WAAW,GAAG,iCAAiC,CAAC;AAE7D,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,MAAkC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC"}
|
package/commands/asset/index.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Argv, CommandModule } from 'yargs';
|
|
2
|
-
|
|
3
|
-
import * as create from './create.js';
|
|
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 as unknown as CommandModule).demandCommand(1);
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAG3C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOhE,MAAM,CAAC,MAAM,OAAO,GAAG,kBAAkB,CAAC;AAC1C,MAAM,CAAC,MAAM,WAAW,GAAG,mCAAmC,CAAC;AAE/D,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE;QAC/B,QAAQ,EAAE,mCAAmC;KAC9C,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAAE,KAAK,EAAuB;IAC1D,MAAM,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IACzF,MAAM,CAAC,IAAI,CAAC,YAAY,WAAW,CAAC,MAAM,SAAS,CAAC,CAAC;IACrD,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE;QAC7B,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChB,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,CAAC;QAEzC,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC;KAC1B;AACH,CAAC"}
|
package/commands/block/build.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
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.js';
|
|
7
|
-
import { BaseArguments } from '../../types.js';
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extract-messages.js","sourceRoot":"","sources":["extract-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAG3C,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAQ1E,MAAM,CAAC,MAAM,OAAO,GAAG,6BAA6B,CAAC;AACrD,MAAM,CAAC,MAAM,WAAW,GAAG,gCAAgC,CAAC;AAE5D,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,UAAU,CAAC,OAAO,EAAE;QACnB,QAAQ,EAAE,mDAAmD;KAC9D,CAAC;SACD,MAAM,CAAC,WAAW,EAAE;QACnB,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,2BAA2B;QACrC,OAAO,EAAE,EAAE;KACZ,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,EAAuB;IACrE,MAAM,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IACzF,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3F,MAAM,CAAC,IAAI,CAAC,4BAA4B,WAAW,CAAC,MAAM,SAAS,CAAC,CAAC;IACrE,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE;QAC7B,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChB,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC,cAAc,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAEzC,MAAM,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KAC3C;AACH,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
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.js';
|
|
7
|
-
import { BaseArguments } from '../../types.js';
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAC/B,MAAM,CAAC,MAAM,WAAW,GAAG,6BAA6B,CAAC;AAEzD,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,OAAO,CAAC,KAAiC,CAAC;SAC1C,OAAO,CAAC,eAA2C,CAAC;SACpD,OAAO,CAAC,OAAmC,CAAC;SAC5C,aAAa,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC"}
|
package/commands/block/index.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Argv, CommandModule } from 'yargs';
|
|
2
|
-
|
|
3
|
-
import * as build from './build.js';
|
|
4
|
-
import * as extractMessages from './extract-messages.js';
|
|
5
|
-
import * as publish from './publish.js';
|
|
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
|
|
14
|
-
.command(build as unknown as CommandModule)
|
|
15
|
-
.command(extractMessages as unknown as CommandModule)
|
|
16
|
-
.command(publish as unknown as CommandModule)
|
|
17
|
-
.demandCommand(1);
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publish.js","sourceRoot":"","sources":["publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAG3C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAS9E,MAAM,CAAC,MAAM,OAAO,GAAG,oBAAoB,CAAC;AAC5C,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAE9C,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,UAAU,CAAC,OAAO,EAAE;QACnB,QAAQ,EAAE,qCAAqC;KAChD,CAAC;SACD,MAAM,CAAC,OAAO,EAAE;QACf,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,mEAAmE;QAC7E,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;KACd,CAAC;SACD,MAAM,CAAC,iBAAiB,EAAE;QACzB,QAAQ,EAAE,qEAAqE;QAC/E,IAAI,EAAE,SAAS;KAChB,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAC5B,KAAK,EACL,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,MAAM,GACgB;IACtB,MAAM,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,iBAAiB,CAAC,CAAC;IAE9D,MAAM,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IACzF,MAAM,CAAC,IAAI,CAAC,cAAc,WAAW,CAAC,MAAM,SAAS,CAAC,CAAC;IACvD,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE;QAC7B,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChB,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,CAAC;QAEzC,IAAI,KAAK,EAAE;YACT,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC;SAC1B;QAED,MAAM,YAAY,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;KAC5C;AACH,CAAC"}
|
|
@@ -1,58 +0,0 @@
|
|
|
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.js';
|
|
7
|
-
import { buildBlock, getBlockConfig, publishBlock } from '../../lib/block.js';
|
|
8
|
-
import { BaseArguments } from '../../types.js';
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cleanupResources.js","sourceRoot":"","sources":["cleanupResources.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,MAAM,CAAC,MAAM,OAAO,GAAG,mBAAmB,CAAC;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAG,kDAAkD,CAAC;AAE9E,MAAM,UAAU,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;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAmB;IAC/C,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,GAAG,MAAM,YAAY,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;IACxF,OAAO,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,gBAAgB,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Argv } from 'yargs';
|
|
2
|
-
|
|
3
|
-
import { serverImport } from '../lib/serverImport.js';
|
|
4
|
-
import { BaseArguments } from '../types.js';
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAS5C,MAAM,CAAC,MAAM,OAAO,GAAG,WAAW,CAAC;AACnC,MAAM,CAAC,MAAM,WAAW,GAAG,0DAA0D,CAAC;AAEtF,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE;QAC7B,QAAQ,EAAE,4BAA4B;KACvC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAAE,GAAG,EAAsB;IACvD,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,aAAa,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAClE,MAAM,GAAG,GAAG,WAAkC,CAAC;IAC/C,IAAI,GAAG,CAAC,GAAG,EAAE,iBAAiB,CAAC,EAAE;QAC/B,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;KACvC;AACH,CAAC"}
|
package/commands/config/get.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { has } from '@appsemble/utils';
|
|
2
|
-
import { readPackageUp } from 'read-pkg-up';
|
|
3
|
-
import { Argv } from 'yargs';
|
|
4
|
-
|
|
5
|
-
import { BaseArguments, MonoRepoPackageJson } from '../../types.js';
|
|
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 readPackageUp({ normalize: false });
|
|
22
|
-
const pkg = packageJson as MonoRepoPackageJson;
|
|
23
|
-
if (has(pkg, 'appsembleServer')) {
|
|
24
|
-
// eslint-disable-next-line no-console
|
|
25
|
-
console.log(pkg.appsembleServer[key]);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAChC,MAAM,CAAC,MAAM,WAAW,GAAG,2CAA2C,CAAC;AAEvE,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,OAAO,CAAC,GAA+B,CAAC;SACxC,OAAO,CAAC,GAA+B,CAAC;SACxC,aAAa,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC"}
|
package/commands/config/index.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Argv, CommandModule } from 'yargs';
|
|
2
|
-
|
|
3
|
-
import * as get from './get.js';
|
|
4
|
-
import * as set from './set.js';
|
|
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
|
|
13
|
-
.command(get as unknown as CommandModule)
|
|
14
|
-
.command(set as unknown as CommandModule)
|
|
15
|
-
.demandCommand(1);
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set.js","sourceRoot":"","sources":["set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,GAAG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
-
import { logger, writeData } from '@appsemble/node-utils';
|
|
4
|
-
import { has } from '@appsemble/utils';
|
|
5
|
-
import { readPackageUp } from 'read-pkg-up';
|
|
6
|
-
import { Argv } from 'yargs';
|
|
7
|
-
|
|
8
|
-
import { BaseArguments, MonoRepoPackageJson } from '../../types.js';
|
|
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 readPackageUp({ normalize: false });
|
|
30
|
-
const pkg = packageJson as MonoRepoPackageJson;
|
|
31
|
-
if (!has(pkg, 'appsembleServer')) {
|
|
32
|
-
pkg.appsembleServer = {};
|
|
33
|
-
}
|
|
34
|
-
let parsed;
|
|
35
|
-
try {
|
|
36
|
-
parsed = JSON.parse(value);
|
|
37
|
-
} catch {
|
|
38
|
-
parsed = value;
|
|
39
|
-
}
|
|
40
|
-
pkg.appsembleServer[key] = parsed;
|
|
41
|
-
await writeData(path, packageJson);
|
|
42
|
-
logger.info(
|
|
43
|
-
`Set option appsembleServer.${key} to ${inspect(parsed, { colors: true })} in ${path}`,
|
|
44
|
-
);
|
|
45
|
-
}
|
package/commands/login.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAC/B,MAAM,CAAC,MAAM,WAAW,GACtB,sFAAsF,CAAC"}
|
package/commands/login.ts
DELETED
package/commands/logout.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logout.js","sourceRoot":"","sources":["logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAChC,MAAM,CAAC,MAAM,WAAW,GACtB,oHAAoH,CAAC"}
|
package/commands/logout.ts
DELETED