@freeappstore/cli 0.4.16 → 0.4.18
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/dist/commands/logs.d.ts.map +1 -1
- package/dist/commands/logs.js +7 -9
- package/dist/commands/logs.js.map +1 -1
- package/dist/lib/app-id.js +1 -1
- package/dist/lib/apps.d.ts +2 -15
- package/dist/lib/apps.d.ts.map +1 -1
- package/dist/lib/apps.js +8 -19
- package/dist/lib/apps.js.map +1 -1
- package/dist/lib/apps.test.js +2 -18
- package/dist/lib/apps.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/commands/logs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/commands/logs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,WAAW,SA6BpB,CAAC"}
|
package/dist/commands/logs.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import { assertValidAppId } from '../lib/app-id.js';
|
|
4
|
-
import { cfProjectFor } from '../lib/apps.js';
|
|
5
4
|
export const logsCommand = new Command('logs')
|
|
6
|
-
.description("
|
|
5
|
+
.description("Show recent GitHub Actions workflow runs for an app.")
|
|
7
6
|
.argument('<app-id>', 'Short app id (e.g. "calculator")')
|
|
8
|
-
.
|
|
9
|
-
.action(async (appId, opts) => {
|
|
7
|
+
.action(async (appId) => {
|
|
10
8
|
assertValidAppId(appId);
|
|
11
|
-
const
|
|
12
|
-
process.stdout.write(`
|
|
9
|
+
const repo = `freeappstore-online/${appId}`;
|
|
10
|
+
process.stdout.write(`Fetching workflow runs for ${repo}...\n`);
|
|
13
11
|
await new Promise((resolveFn, rejectFn) => {
|
|
14
|
-
const child = spawn('
|
|
12
|
+
const child = spawn('gh', ['run', 'list', '--repo', repo, '--limit', '10'], {
|
|
15
13
|
stdio: 'inherit',
|
|
16
14
|
});
|
|
17
15
|
child.on('error', (err) => {
|
|
18
16
|
if (err.code === 'ENOENT') {
|
|
19
|
-
rejectFn(new Error('
|
|
17
|
+
rejectFn(new Error('gh CLI is not installed. Install it: https://cli.github.com'));
|
|
20
18
|
}
|
|
21
19
|
else {
|
|
22
20
|
rejectFn(err);
|
|
@@ -26,7 +24,7 @@ export const logsCommand = new Command('logs')
|
|
|
26
24
|
if (code === 0 || code === null)
|
|
27
25
|
resolveFn();
|
|
28
26
|
else
|
|
29
|
-
rejectFn(new Error(`
|
|
27
|
+
rejectFn(new Error(`gh exited with code ${code}`));
|
|
30
28
|
});
|
|
31
29
|
});
|
|
32
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../src/commands/logs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../src/commands/logs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;KAC3C,WAAW,CAAC,sDAAsD,CAAC;KACnE,QAAQ,CAAC,UAAU,EAAE,kCAAkC,CAAC;KACxD,MAAM,CAAC,KAAK,EAAE,KAAa,EAAE,EAAE;IAC9B,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAExB,MAAM,IAAI,GAAG,uBAAuB,KAAK,EAAE,CAAC;IAC5C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,8BAA8B,IAAI,OAAO,CAAC,CAAC;IAEhE,MAAM,IAAI,OAAO,CAAO,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE;QAC9C,MAAM,KAAK,GAAG,KAAK,CACjB,IAAI,EACJ,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,EAChD;YACE,KAAK,EAAE,SAAS;SACjB,CACF,CAAC;QACF,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACxB,IAAK,GAA6B,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACrD,QAAQ,CAAC,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC,CAAC;YACrF,CAAC;iBAAM,CAAC;gBACN,QAAQ,CAAC,GAAG,CAAC,CAAC;YAChB,CAAC;QACH,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YACxB,IAAI,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,IAAI;gBAAE,SAAS,EAAE,CAAC;;gBACxC,QAAQ,CAAC,IAAI,KAAK,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/lib/app-id.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Validates an app id. The same shape is enforced by the publisher portal
|
|
3
|
-
* and used for DNS subdomains
|
|
3
|
+
* and used for DNS subdomains and repo names.
|
|
4
4
|
*
|
|
5
5
|
* Rules: lowercase letter first, then 1-30 of [a-z0-9-]. Total length 2-31.
|
|
6
6
|
*/
|
package/dist/lib/apps.d.ts
CHANGED
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Canonical mapping for apps published on freeappstore.online.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* projects use ad-hoc names (music, puzzle, freeappstore itself) and CF
|
|
7
|
-
* Pages project names cannot be renamed after creation, so we have to keep
|
|
8
|
-
* a hand-maintained override list.
|
|
9
|
-
*
|
|
10
|
-
* This is the registry the audit recommended (P2 in the original review),
|
|
11
|
-
* scoped to just the dev tooling for now. Long-term it should live in the
|
|
12
|
-
* storefront repo and be fetched at runtime so it never goes stale.
|
|
4
|
+
* Each entry maps an app ID to its public subdomain. Used by CLI commands
|
|
5
|
+
* that need to resolve an app's URL (e.g. `fas open`, `fas audit`).
|
|
13
6
|
*/
|
|
14
7
|
export interface AppRecord {
|
|
15
|
-
cfProject: string;
|
|
16
8
|
subdomain: string;
|
|
17
9
|
}
|
|
18
10
|
export declare const APPS: Record<string, AppRecord>;
|
|
19
|
-
/**
|
|
20
|
-
* Returns the CF Pages project name for an app id. Prefers the registry,
|
|
21
|
-
* falls back to the `free<id>app` convention.
|
|
22
|
-
*/
|
|
23
|
-
export declare function cfProjectFor(appId: string): string;
|
|
24
11
|
/**
|
|
25
12
|
* Returns the public URL for an app id.
|
|
26
13
|
*/
|
package/dist/lib/apps.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/lib/apps.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/lib/apps.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAS1C,CAAC;AAEF;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG5C"}
|
package/dist/lib/apps.js
CHANGED
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
export const APPS = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// Legacy / non-conventional names — cannot be renamed.
|
|
11
|
-
music: { cfProject: 'freemusic', subdomain: 'music.freeappstore.online' },
|
|
12
|
-
puzzle: { cfProject: 'freepuzzle', subdomain: 'puzzle.freeappstore.online' },
|
|
13
|
-
freeappstore: { cfProject: 'freeappstore', subdomain: 'freeappstore.online' },
|
|
2
|
+
chess: { subdomain: 'chess.freeappstore.online' },
|
|
3
|
+
language: { subdomain: 'language.freeappstore.online' },
|
|
4
|
+
math: { subdomain: 'math.freeappstore.online' },
|
|
5
|
+
quiz: { subdomain: 'quiz.freeappstore.online' },
|
|
6
|
+
books: { subdomain: 'books.freeappstore.online' },
|
|
7
|
+
music: { subdomain: 'music.freeappstore.online' },
|
|
8
|
+
puzzle: { subdomain: 'puzzle.freeappstore.online' },
|
|
9
|
+
freeappstore: { subdomain: 'freeappstore.online' },
|
|
14
10
|
};
|
|
15
|
-
/**
|
|
16
|
-
* Returns the CF Pages project name for an app id. Prefers the registry,
|
|
17
|
-
* falls back to the `free<id>app` convention.
|
|
18
|
-
*/
|
|
19
|
-
export function cfProjectFor(appId) {
|
|
20
|
-
return APPS[appId]?.cfProject ?? `free${appId}app`;
|
|
21
|
-
}
|
|
22
11
|
/**
|
|
23
12
|
* Returns the public URL for an app id.
|
|
24
13
|
*/
|
package/dist/lib/apps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../../src/lib/apps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../../src/lib/apps.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,IAAI,GAA8B;IAC7C,KAAK,EAAE,EAAE,SAAS,EAAE,2BAA2B,EAAE;IACjD,QAAQ,EAAE,EAAE,SAAS,EAAE,8BAA8B,EAAE;IACvD,IAAI,EAAE,EAAE,SAAS,EAAE,0BAA0B,EAAE;IAC/C,IAAI,EAAE,EAAE,SAAS,EAAE,0BAA0B,EAAE;IAC/C,KAAK,EAAE,EAAE,SAAS,EAAE,2BAA2B,EAAE;IACjD,KAAK,EAAE,EAAE,SAAS,EAAE,2BAA2B,EAAE;IACjD,MAAM,EAAE,EAAE,SAAS,EAAE,4BAA4B,EAAE;IACnD,YAAY,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE;CACnD,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,KAAa;IAClC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,SAAS,IAAI,GAAG,KAAK,sBAAsB,CAAC;IAC3E,OAAO,WAAW,SAAS,EAAE,CAAC;AAChC,CAAC"}
|
package/dist/lib/apps.test.js
CHANGED
|
@@ -1,20 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { APPS,
|
|
3
|
-
describe('cfProjectFor', () => {
|
|
4
|
-
it('returns the registered cfProject for known legacy names', () => {
|
|
5
|
-
expect(cfProjectFor('music')).toBe('freemusic');
|
|
6
|
-
expect(cfProjectFor('puzzle')).toBe('freepuzzle');
|
|
7
|
-
expect(cfProjectFor('freeappstore')).toBe('freeappstore');
|
|
8
|
-
});
|
|
9
|
-
it('returns the registered cfProject for known convention-following names', () => {
|
|
10
|
-
expect(cfProjectFor('chess')).toBe('freechessapp');
|
|
11
|
-
expect(cfProjectFor('quiz')).toBe('freequizapp');
|
|
12
|
-
});
|
|
13
|
-
it('falls back to free<id>app convention for unknown apps', () => {
|
|
14
|
-
expect(cfProjectFor('whateverapp')).toBe('freewhateverappapp');
|
|
15
|
-
expect(cfProjectFor('todo')).toBe('freetodoapp');
|
|
16
|
-
});
|
|
17
|
-
});
|
|
2
|
+
import { APPS, urlFor } from './apps.js';
|
|
18
3
|
describe('urlFor', () => {
|
|
19
4
|
it('returns the registered subdomain for known apps', () => {
|
|
20
5
|
expect(urlFor('music')).toBe('https://music.freeappstore.online');
|
|
@@ -25,9 +10,8 @@ describe('urlFor', () => {
|
|
|
25
10
|
});
|
|
26
11
|
});
|
|
27
12
|
describe('APPS registry', () => {
|
|
28
|
-
it('all entries have non-empty
|
|
13
|
+
it('all entries have non-empty subdomain', () => {
|
|
29
14
|
for (const [id, record] of Object.entries(APPS)) {
|
|
30
|
-
expect(record.cfProject, `cfProject for ${id}`).toBeTruthy();
|
|
31
15
|
expect(record.subdomain, `subdomain for ${id}`).toBeTruthy();
|
|
32
16
|
}
|
|
33
17
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.test.js","sourceRoot":"","sources":["../../src/lib/apps.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"apps.test.js","sourceRoot":"","sources":["../../src/lib/apps.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEzC,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;QAClE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,KAAK,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAChD,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC;QAC/D,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|