@youcan/app 2.3.1 → 2.3.2
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/cli/commands/app/dev.js +4 -4
- package/dist/cli/commands/app/env/show.js +1 -1
- package/dist/cli/commands/app/generate/extension.js +2 -2
- package/dist/cli/commands/app/install.js +2 -2
- package/dist/cli/services/dev/workers/app-worker.d.ts +2 -2
- package/dist/cli/services/dev/workers/app-worker.js +1 -1
- package/dist/cli/services/dev/workers/index.d.ts +4 -4
- package/dist/cli/services/dev/workers/index.js +2 -2
- package/dist/cli/services/dev/workers/theme-extension-worker.d.ts +1 -1
- package/dist/cli/services/dev/workers/tunnel-worker.d.ts +2 -2
- package/dist/cli/services/dev/workers/tunnel-worker.js +1 -0
- package/dist/cli/services/dev/workers/web-worker.d.ts +1 -1
- package/dist/cli/services/generate/generate.js +1 -1
- package/dist/util/app-command.d.ts +1 -1
- package/dist/util/app-command.js +2 -2
- package/dist/util/app-loader.js +1 -1
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Session, Tasks, UI, System, Services, Filesystem, Path, Env, Http } from '@youcan/cli-kit';
|
|
2
1
|
import { bootTunnelWorker, bootAppWorker, bootWebWorker, bootExtensionWorker } from '../../services/dev/workers/index.js';
|
|
2
|
+
import { APP_CONFIG_FILENAME } from '../../../constants.js';
|
|
3
3
|
import { AppCommand } from '../../../util/app-command.js';
|
|
4
4
|
import { load } from '../../../util/app-loader.js';
|
|
5
|
-
import {
|
|
5
|
+
import { Session, Tasks, UI, System, Services, Filesystem, Path, Env, Http } from '@youcan/cli-kit';
|
|
6
6
|
|
|
7
7
|
class Dev extends AppCommand {
|
|
8
8
|
static description = 'Run the app in dev mode';
|
|
@@ -46,7 +46,7 @@ class Dev extends AppCommand {
|
|
|
46
46
|
const port = await System.getNextAvailablePort(3000);
|
|
47
47
|
this.app.network_config = {
|
|
48
48
|
app_port: port,
|
|
49
|
-
app_url: `http://localhost:${port}
|
|
49
|
+
app_url: `http://localhost:${port}`,
|
|
50
50
|
};
|
|
51
51
|
const worker = await bootTunnelWorker(this, this.app, new Services.Cloudflared());
|
|
52
52
|
this.app.config = {
|
|
@@ -54,7 +54,7 @@ class Dev extends AppCommand {
|
|
|
54
54
|
app_url: worker.getUrl(),
|
|
55
55
|
redirect_urls: this.app.config.redirect_urls?.length > 0
|
|
56
56
|
? this.app.config.redirect_urls.map(r => new URL(new URL(r).pathname, worker.getUrl()).toString())
|
|
57
|
-
: [new URL('/auth/callback', worker.getUrl()).toString()]
|
|
57
|
+
: [new URL('/auth/callback', worker.getUrl()).toString()],
|
|
58
58
|
};
|
|
59
59
|
await Filesystem.writeJsonFile(Path.join(this.app.root, APP_CONFIG_FILENAME), this.app.config);
|
|
60
60
|
return worker;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Session, Tasks, Color } from '@youcan/cli-kit';
|
|
2
1
|
import { AppCommand } from '../../../../util/app-command.js';
|
|
3
2
|
import { load } from '../../../../util/app-loader.js';
|
|
3
|
+
import { Session, Tasks, Color } from '@youcan/cli-kit';
|
|
4
4
|
|
|
5
5
|
class EnvShow extends AppCommand {
|
|
6
6
|
static description = 'Display app environment variables';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Path, Filesystem, String, Tasks } from '@youcan/cli-kit';
|
|
2
|
-
import { AppCommand } from '../../../../util/app-command.js';
|
|
3
1
|
import extensions from '../../../services/generate/extensions/index.js';
|
|
4
2
|
import { ensureExtensionDirectoryExists, initThemeExtension } from '../../../services/generate/generate.js';
|
|
5
3
|
import { APP_CONFIG_FILENAME } from '../../../../constants.js';
|
|
4
|
+
import { AppCommand } from '../../../../util/app-command.js';
|
|
5
|
+
import { Path, Filesystem, String, Tasks } from '@youcan/cli-kit';
|
|
6
6
|
|
|
7
7
|
class GenerateExtension extends AppCommand {
|
|
8
8
|
static description = 'Generate an app extension';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Session, Tasks, Http, Env, System } from '@youcan/cli-kit';
|
|
2
|
-
import { load } from '../../../util/app-loader.js';
|
|
3
1
|
import { AppCommand } from '../../../util/app-command.js';
|
|
2
|
+
import { load } from '../../../util/app-loader.js';
|
|
3
|
+
import { Session, Tasks, Http, Env, System } from '@youcan/cli-kit';
|
|
4
4
|
|
|
5
5
|
class Install extends AppCommand {
|
|
6
6
|
static description = 'Generate an app installation URL';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Worker } from '@youcan/cli-kit';
|
|
2
|
-
import type { App } from '@/types';
|
|
3
1
|
import type DevCommand from '@/cli/commands/app/dev';
|
|
2
|
+
import type { App } from '@/types';
|
|
3
|
+
import { Worker } from '@youcan/cli-kit';
|
|
4
4
|
export default class AppWorker extends Worker.Abstract {
|
|
5
5
|
private command;
|
|
6
6
|
private app;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type DevCommand from '@/cli/commands/app/dev';
|
|
2
|
+
import type { App, Extension, Web } from '@/types';
|
|
3
|
+
import type { AppCommand } from '@/util/app-command';
|
|
1
4
|
import type { Cli, Services, Worker } from '@youcan/cli-kit';
|
|
2
|
-
import WebWorker from './web-worker';
|
|
3
5
|
import AppWorker from './app-worker';
|
|
4
6
|
import TunnelWorker from './tunnel-worker';
|
|
5
|
-
import
|
|
6
|
-
import type DevCommand from '@/cli/commands/app/dev';
|
|
7
|
-
import type { AppCommand } from '@/util/app-command';
|
|
7
|
+
import WebWorker from './web-worker';
|
|
8
8
|
export interface ExtensionWorkerCtor {
|
|
9
9
|
new (command: Cli.Command, app: App, extension: Extension): Worker.Interface;
|
|
10
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import ThemeExtensionWorker from './theme-extension-worker.js';
|
|
2
|
-
import WebWorker from './web-worker.js';
|
|
3
1
|
import AppWorker from './app-worker.js';
|
|
2
|
+
import ThemeExtensionWorker from './theme-extension-worker.js';
|
|
4
3
|
import TunnelWorker from './tunnel-worker.js';
|
|
4
|
+
import WebWorker from './web-worker.js';
|
|
5
5
|
|
|
6
6
|
const EXTENSION_WORKERS = {
|
|
7
7
|
theme: ThemeExtensionWorker,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { App, Extension } from '@/types';
|
|
1
2
|
import type { Cli } from '@youcan/cli-kit';
|
|
2
3
|
import { Worker } from '@youcan/cli-kit';
|
|
3
|
-
import type { App, Extension } from '@/types';
|
|
4
4
|
export default class ThemeExtensionWorker extends Worker.Abstract {
|
|
5
5
|
private command;
|
|
6
6
|
private app;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Worker } from '@youcan/cli-kit';
|
|
2
|
-
import type { Services } from '@youcan/cli-kit';
|
|
3
1
|
import type { App } from '@/types';
|
|
4
2
|
import type { AppCommand } from '@/util/app-command';
|
|
3
|
+
import type { Services } from '@youcan/cli-kit';
|
|
4
|
+
import { Worker } from '@youcan/cli-kit';
|
|
5
5
|
export default class TunnelWorker extends Worker.Abstract {
|
|
6
6
|
private command;
|
|
7
7
|
private app;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Path, Filesystem, Git } from '@youcan/cli-kit';
|
|
2
1
|
import { EXTENSION_CONFIG_FILENAME } from '../../../constants.js';
|
|
2
|
+
import { Path, Filesystem, Git } from '@youcan/cli-kit';
|
|
3
3
|
|
|
4
4
|
async function ensureExtensionDirectoryExists(name) {
|
|
5
5
|
const dir = Path.join(Path.cwd(), 'extensions', name);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { App } from '@/types';
|
|
1
2
|
import type { Session } from '@youcan/cli-kit';
|
|
2
3
|
import { Cli } from '@youcan/cli-kit';
|
|
3
|
-
import type { App } from '@/types';
|
|
4
4
|
export declare abstract class AppCommand extends Cli.Command {
|
|
5
5
|
protected app: App;
|
|
6
6
|
protected session: Session.StoreSession;
|
package/dist/util/app-command.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Cli, Env, Http, Filesystem, Path } from '@youcan/cli-kit';
|
|
2
1
|
import { APP_CONFIG_FILENAME } from '../constants.js';
|
|
2
|
+
import { Cli, Env, Http, Filesystem, Path } from '@youcan/cli-kit';
|
|
3
3
|
|
|
4
4
|
class AppCommand extends Cli.Command {
|
|
5
5
|
app;
|
|
@@ -13,7 +13,7 @@ class AppCommand extends Cli.Command {
|
|
|
13
13
|
body: JSON.stringify({
|
|
14
14
|
name: this.app.config.name,
|
|
15
15
|
app_url: this.app.config.app_url,
|
|
16
|
-
redirect_urls: this.app.config.redirect_urls
|
|
16
|
+
redirect_urls: this.app.config.redirect_urls,
|
|
17
17
|
}),
|
|
18
18
|
});
|
|
19
19
|
this.app.config = {
|
package/dist/util/app-loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Path, Filesystem } from '@youcan/cli-kit';
|
|
2
1
|
import { APP_CONFIG_FILENAME, DEFAULT_EXTENSIONS_DIR, EXTENSION_CONFIG_FILENAME, DEFAULT_WEBS_DIR, WEB_CONFIG_FILENAME } from '../constants.js';
|
|
2
|
+
import { Path, Filesystem } from '@youcan/cli-kit';
|
|
3
3
|
|
|
4
4
|
async function load() {
|
|
5
5
|
const path = Path.resolve(Path.cwd(), APP_CONFIG_FILENAME);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youcan/app",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.3.
|
|
4
|
+
"version": "2.3.2",
|
|
5
5
|
"description": "OCLIF plugin for building apps",
|
|
6
6
|
"author": "YouCan <contact@youcan.shop> (https://youcan.shop)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@oclif/core": "^2.15.0",
|
|
19
19
|
"dayjs": "^1.11.10",
|
|
20
|
-
"@youcan/cli-kit": "2.3.
|
|
20
|
+
"@youcan/cli-kit": "2.3.2"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@oclif/plugin-legacy": "^1.3.0",
|