@juuno-sdk/cli 1.0.11 → 1.0.13

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.
Files changed (56) hide show
  1. package/README.md +61 -11
  2. package/bin/cli-router.js +18 -4
  3. package/bin/cli.js +40 -15
  4. package/dist/cli/src/auth/index.js +128 -39
  5. package/dist/cli/src/deploy/index.js +11 -6
  6. package/dist/cli/src/info/index.js +3 -3
  7. package/dist/cli/src/list/index.js +3 -3
  8. package/dist/cli/src/login/index.js +11 -8
  9. package/dist/cli/src/logout/index.js +29 -8
  10. package/dist/cli/src/whoami/index.js +31 -10
  11. package/dist/cli/tsconfig.build.tsbuildinfo +1 -1
  12. package/dist/types/src/auth/index.d.ts +84 -0
  13. package/dist/types/src/auth/index.d.ts.map +1 -0
  14. package/dist/{cli → types}/src/deploy/index.d.ts +6 -0
  15. package/dist/{cli → types}/src/deploy/index.d.ts.map +1 -1
  16. package/dist/{cli → types}/src/info/index.d.ts.map +1 -1
  17. package/dist/{cli → types}/src/list/index.d.ts.map +1 -1
  18. package/dist/{cli → types}/src/login/index.d.ts +3 -1
  19. package/dist/types/src/login/index.d.ts.map +1 -0
  20. package/dist/types/src/logout/index.d.ts +12 -0
  21. package/dist/types/src/logout/index.d.ts.map +1 -0
  22. package/dist/types/src/whoami/index.d.ts +12 -0
  23. package/dist/types/src/whoami/index.d.ts.map +1 -0
  24. package/package.json +2 -2
  25. package/dist/assets/main-B8xiNI5_.js +0 -1
  26. package/dist/assets/main-Bf2N9gBQ.js +0 -1
  27. package/dist/assets/main-Bo8Yyr87.js +0 -1
  28. package/dist/assets/main-C3hW0d-b.css +0 -1
  29. package/dist/assets/main-C6ZAJydH.js +0 -1
  30. package/dist/assets/main-CCYNXtGp.css +0 -1
  31. package/dist/assets/main-COSZCfRq.css +0 -1
  32. package/dist/assets/main-CnpUG-52.js +0 -1
  33. package/dist/assets/main-D0353jp3.js +0 -1
  34. package/dist/assets/main-D7UD6CXw.css +0 -1
  35. package/dist/assets/main-DC3n4QV-.css +0 -1
  36. package/dist/assets/main-DWrNgA-L.js +0 -1
  37. package/dist/assets/main-HbFBqUMx.js +0 -1
  38. package/dist/assets/main-jQYqLcLk.js +0 -1
  39. package/dist/cli/src/auth/index.d.ts +0 -51
  40. package/dist/cli/src/auth/index.d.ts.map +0 -1
  41. package/dist/cli/src/login/index.d.ts.map +0 -1
  42. package/dist/cli/src/logout/index.d.ts +0 -5
  43. package/dist/cli/src/logout/index.d.ts.map +0 -1
  44. package/dist/cli/src/monorepo/index.d.ts +0 -37
  45. package/dist/cli/src/monorepo/index.d.ts.map +0 -1
  46. package/dist/cli/src/monorepo/index.js +0 -94
  47. package/dist/cli/src/whoami/index.d.ts +0 -5
  48. package/dist/cli/src/whoami/index.d.ts.map +0 -1
  49. /package/dist/{cli → types}/src/dev/index.d.ts +0 -0
  50. /package/dist/{cli → types}/src/dev/index.d.ts.map +0 -0
  51. /package/dist/{cli → types}/src/info/index.d.ts +0 -0
  52. /package/dist/{cli → types}/src/list/index.d.ts +0 -0
  53. /package/dist/{cli → types}/src/simulator/index.d.ts +0 -0
  54. /package/dist/{cli → types}/src/simulator/index.d.ts.map +0 -0
  55. /package/dist/{cli → types}/src/utils/fs.d.ts +0 -0
  56. /package/dist/{cli → types}/src/utils/fs.d.ts.map +0 -0
@@ -1,51 +0,0 @@
1
- /**
2
- * Authentication credentials for the developer API.
3
- */
4
- export interface AuthCredentials {
5
- email: string;
6
- password: string;
7
- }
8
- /**
9
- * Authentication token response from the API.
10
- */
11
- export interface AuthTokenResponse {
12
- success: boolean;
13
- token: string;
14
- }
15
- /**
16
- * Options for authentication.
17
- */
18
- export interface AuthOptions {
19
- email?: string;
20
- password?: string;
21
- token?: string;
22
- }
23
- /**
24
- * Saves authentication token to local credentials file.
25
- */
26
- export declare function saveToken(token: string): void;
27
- /**
28
- * Loads authentication token from local credentials file.
29
- */
30
- export declare function loadToken(): string | null;
31
- /**
32
- * Removes stored credentials file.
33
- */
34
- export declare function removeToken(): void;
35
- /**
36
- * Checks if user is currently logged in.
37
- */
38
- export declare function isLoggedIn(): boolean;
39
- /**
40
- * Gets the API URL from environment or uses default.
41
- */
42
- export declare function getApiUrl(): string;
43
- /**
44
- * Gets the authentication token from options, environment, or stored credentials.
45
- */
46
- export declare function getAuthToken(options: AuthOptions): Promise<string>;
47
- /**
48
- * Authenticates with the developer API using email and password.
49
- */
50
- export declare function loginWithCredentials(credentials: AuthCredentials): Promise<string>;
51
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/auth/index.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA6BD;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAa7C;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,MAAM,GAAG,IAAI,CAczC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAMlC;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAuBxE;AAiCD;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,eAAe,GAC3B,OAAO,CAAC,MAAM,CAAC,CAoCjB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/login/index.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAoEhE"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Logs out of Juuno by removing stored credentials.
3
- */
4
- export declare function logout(): Promise<void>;
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/logout/index.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAwB5C"}
@@ -1,37 +0,0 @@
1
- /**
2
- * Monorepo detection and Vite dev server launcher for internal app development.
3
- *
4
- * When running in the Juuno monorepo, this uses Vite's dev server instead of
5
- * the built simulator, allowing local @juuno/* packages to be resolved from
6
- * the workspace.
7
- */
8
- import { type ChildProcess } from 'child_process';
9
- /**
10
- * Detect if we're running in the Juuno monorepo.
11
- */
12
- export declare function detectMonorepo(cwd: string): {
13
- isMonorepo: boolean;
14
- workspaceRoot: string | null;
15
- cliPath: string | null;
16
- };
17
- /**
18
- * Options for launching the simulator in monorepo mode.
19
- */
20
- export interface MonorepoSimulatorOptions {
21
- /** URL of the external app to load. */
22
- appUrl: string;
23
- /** Port for the simulator service (default: 5004). */
24
- port: string;
25
- /** Path to the monorepo workspace root. */
26
- workspaceRoot: string;
27
- /** Directory to watch for live reload. */
28
- watchDir?: string;
29
- }
30
- /**
31
- * Launch the simulator service (monorepo mode).
32
- *
33
- * This uses the internal simulator service which has full monorepo support
34
- * for @juuno/* packages, GraphQL, Sass, etc.
35
- */
36
- export declare function launchMonorepoSimulator(options: MonorepoSimulatorOptions): Promise<ChildProcess>;
37
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/monorepo/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAKzD;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG;IAC3C,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAyBA;AA2BD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,YAAY,CAAC,CAgDvB"}
@@ -1,94 +0,0 @@
1
- /**
2
- * Monorepo detection and Vite dev server launcher for internal app development.
3
- *
4
- * When running in the Juuno monorepo, this uses Vite's dev server instead of
5
- * the built simulator, allowing local @juuno/* packages to be resolved from
6
- * the workspace.
7
- */
8
- import { spawn } from 'child_process';
9
- import { existsSync } from 'fs';
10
- import { join, resolve } from 'path';
11
- import { findFileUpward } from '../utils/fs.js';
12
- /**
13
- * Detect if we're running in the Juuno monorepo.
14
- */
15
- export function detectMonorepo(cwd) {
16
- // Look for pnpm-workspace.yaml which indicates monorepo root.
17
- const workspaceFile = findFileUpward(cwd, 'pnpm-workspace.yaml');
18
- if (!workspaceFile) {
19
- return { isMonorepo: false, workspaceRoot: null, cliPath: null };
20
- }
21
- const workspaceRoot = resolve(workspaceFile, '..');
22
- // Check if the CLI package exists in the expected location.
23
- const cliPath = join(workspaceRoot, 'external', 'cli');
24
- if (!existsSync(join(cliPath, 'package.json'))) {
25
- return { isMonorepo: false, workspaceRoot: null, cliPath: null };
26
- }
27
- // Check for key monorepo packages to confirm it's the Juuno monorepo.
28
- const hasCore = existsSync(join(workspaceRoot, 'packages', 'core'));
29
- const hasCommon = existsSync(join(workspaceRoot, 'packages', 'common'));
30
- if (!hasCore || !hasCommon) {
31
- return { isMonorepo: false, workspaceRoot: null, cliPath: null };
32
- }
33
- return { isMonorepo: true, workspaceRoot, cliPath };
34
- }
35
- /**
36
- * Fetch the app manifest to get actual resource paths.
37
- */
38
- async function fetchManifest(appUrl) {
39
- try {
40
- const response = await fetch(`${appUrl}/manifest.json`);
41
- if (!response.ok) {
42
- return null;
43
- }
44
- return await response.json();
45
- }
46
- catch {
47
- return null;
48
- }
49
- }
50
- /**
51
- * Launch the simulator service (monorepo mode).
52
- *
53
- * This uses the internal simulator service which has full monorepo support
54
- * for @juuno/* packages, GraphQL, Sass, etc.
55
- */
56
- export async function launchMonorepoSimulator(options) {
57
- const { appUrl, port, workspaceRoot, watchDir } = options;
58
- // Fetch manifest to get actual resource paths.
59
- console.log('📦 Fetching app manifest...');
60
- const manifest = await fetchManifest(appUrl);
61
- const playerPath = manifest?.resources?.player?.[0] || '/player/index.js';
62
- const configPath = manifest?.resources?.config?.[0] || '/config/index.js';
63
- console.log(`
64
- 🚀 Juuno App Simulator (Monorepo Mode)
65
-
66
- External App: ${appUrl}
67
- Player: ${appUrl}${playerPath}
68
- Config: ${appUrl}${configPath}
69
- Simulator: http://localhost:${port}
70
- Watching: ${watchDir || 'disabled'}
71
- Mode: Internal simulator service (full @juuno/* support)
72
-
73
- Press Ctrl+C to stop
74
- `);
75
- // Set environment variables for the simulator service.
76
- const env = {
77
- ...process.env,
78
- VITE_EXTERNAL_APP_URL: appUrl,
79
- VITE_EXTERNAL_PLAYER_PATH: playerPath,
80
- VITE_EXTERNAL_CONFIG_PATH: configPath,
81
- VITE_WATCH_DIR: watchDir || '',
82
- };
83
- // Run the simulator service from the workspace root.
84
- const simulatorProcess = spawn('pnpm', ['--filter', '@juuno/simulator', 'run', 'dev', '--port', port], {
85
- cwd: workspaceRoot,
86
- stdio: 'inherit',
87
- shell: false,
88
- env,
89
- });
90
- simulatorProcess.on('error', (err) => {
91
- console.error(`[simulator] Error: ${err.message}`);
92
- });
93
- return simulatorProcess;
94
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * Shows current authentication status.
3
- */
4
- export declare function whoami(): Promise<void>;
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/whoami/index.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAoB5C"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes