@baskerhq/localstage 1.0.1-beta.8 → 1.0.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@baskerhq/localstage",
3
3
  "type": "module",
4
- "version": "1.0.1-beta.8",
4
+ "version": "1.0.1",
5
5
  "description": "Local development server for Basker themes - CLI tool for theme development",
6
6
  "author": "Basker Ltd.",
7
7
  "license": "UNLICENSED",
@@ -30,7 +30,6 @@
30
30
  },
31
31
  "exports": {
32
32
  ".": {
33
- "types": "./dist/index.d.ts",
34
33
  "import": "./dist/index.js",
35
34
  "default": "./dist/index.js"
36
35
  }
@@ -45,7 +44,6 @@
45
44
  "README.md",
46
45
  "bin/**/*",
47
46
  "dist/**/*.js",
48
- "dist/**/*.d.ts",
49
47
  "dist/config/defaults.json",
50
48
  "package.json"
51
49
  ],
package/dist/basker.d.ts DELETED
@@ -1 +0,0 @@
1
- #!/usr/bin/env node
package/dist/cli.d.ts DELETED
@@ -1 +0,0 @@
1
- #!/usr/bin/env node
@@ -1,16 +0,0 @@
1
- import * as _oclif_core_interfaces from '@oclif/core/interfaces';
2
- import { Command } from '@oclif/core';
3
-
4
- declare class AuthLogin extends Command {
5
- static description: string;
6
- static args: {
7
- themePath: _oclif_core_interfaces.Arg<string | undefined, Record<string, unknown>>;
8
- };
9
- static flags: {
10
- theme: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
11
- "payload-url": _oclif_core_interfaces.OptionFlag<string, _oclif_core_interfaces.CustomOptions>;
12
- };
13
- run(): Promise<void>;
14
- }
15
-
16
- export { AuthLogin as default };
@@ -1,15 +0,0 @@
1
- import * as _oclif_core_interfaces from '@oclif/core/interfaces';
2
- import { Command } from '@oclif/core';
3
-
4
- declare class AuthLogout extends Command {
5
- static description: string;
6
- static args: {
7
- themePath: _oclif_core_interfaces.Arg<string | undefined, Record<string, unknown>>;
8
- };
9
- static flags: {
10
- theme: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
11
- };
12
- run(): Promise<void>;
13
- }
14
-
15
- export { AuthLogout as default };
@@ -1,16 +0,0 @@
1
- import * as _oclif_core_interfaces from '@oclif/core/interfaces';
2
- import { Command } from '@oclif/core';
3
-
4
- declare class AuthTenant extends Command {
5
- static description: string;
6
- static args: {
7
- themePath: _oclif_core_interfaces.Arg<string | undefined, Record<string, unknown>>;
8
- };
9
- static flags: {
10
- theme: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
11
- "payload-url": _oclif_core_interfaces.OptionFlag<string, _oclif_core_interfaces.CustomOptions>;
12
- };
13
- run(): Promise<void>;
14
- }
15
-
16
- export { AuthTenant as default };
@@ -1,19 +0,0 @@
1
- import * as _oclif_core_interfaces from '@oclif/core/interfaces';
2
- import { Command } from '@oclif/core';
3
-
4
- declare class ThemeCheck extends Command {
5
- static aliases: string[];
6
- static description: string;
7
- static args: {
8
- themePath: _oclif_core_interfaces.Arg<string | undefined, Record<string, unknown>>;
9
- };
10
- static flags: {
11
- theme: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
12
- format: _oclif_core_interfaces.OptionFlag<string, _oclif_core_interfaces.CustomOptions>;
13
- json: _oclif_core_interfaces.BooleanFlag<boolean>;
14
- "fail-level": _oclif_core_interfaces.OptionFlag<string, _oclif_core_interfaces.CustomOptions>;
15
- };
16
- run(): Promise<void>;
17
- }
18
-
19
- export { ThemeCheck as default };
@@ -1,28 +0,0 @@
1
- import * as _oclif_core_interfaces from '@oclif/core/interfaces';
2
- import { Command } from '@oclif/core';
3
-
4
- declare class ThemeDev extends Command {
5
- static aliases: string[];
6
- static description: string;
7
- static args: {
8
- themePath: _oclif_core_interfaces.Arg<string | undefined, Record<string, unknown>>;
9
- };
10
- static flags: {
11
- port: _oclif_core_interfaces.OptionFlag<number, _oclif_core_interfaces.CustomOptions>;
12
- theme: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
13
- "payload-url": _oclif_core_interfaces.OptionFlag<string, _oclif_core_interfaces.CustomOptions>;
14
- livereload: _oclif_core_interfaces.BooleanFlag<boolean>;
15
- debug: _oclif_core_interfaces.BooleanFlag<boolean>;
16
- };
17
- private shuttingDown;
18
- private keypressStop;
19
- private promptActive;
20
- run(): Promise<void>;
21
- private registerSignalHandlers;
22
- private startKeypressLoop;
23
- private openInBrowser;
24
- private runThemeCheck;
25
- private promptForThemeId;
26
- }
27
-
28
- export { ThemeDev as default };
@@ -1,10 +0,0 @@
1
- import ThemeSet from './set.js';
2
- import '@oclif/core/interfaces';
3
- import '@oclif/core';
4
-
5
- declare class ThemePull extends ThemeSet {
6
- static description: string;
7
- static hidden: boolean;
8
- }
9
-
10
- export { ThemePull as default };
@@ -1,19 +0,0 @@
1
- import * as _oclif_core_interfaces from '@oclif/core/interfaces';
2
- import { Command } from '@oclif/core';
3
-
4
- declare class ThemeSet extends Command {
5
- static description: string;
6
- static args: {
7
- themePath: _oclif_core_interfaces.Arg<string | undefined, Record<string, unknown>>;
8
- };
9
- static flags: {
10
- theme: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
11
- "payload-url": _oclif_core_interfaces.OptionFlag<string, _oclif_core_interfaces.CustomOptions>;
12
- "theme-id": _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
13
- "theme-key": _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
14
- "tenant-id": _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
15
- };
16
- run(): Promise<void>;
17
- }
18
-
19
- export { ThemeSet as default };
package/dist/index.d.ts DELETED
@@ -1,123 +0,0 @@
1
- import { RequestCache } from '@baskerhq/frontstage';
2
- import { Hono } from 'hono';
3
- import { CustomAttributeRelationResolverContract } from '@baskerhq/liquidjs';
4
- import { User, Tenant, Theme } from '@baskerhq/shared/payload-types';
5
- import { PayloadSDK } from '@payloadcms/sdk';
6
- import { PayloadTypesShape, GeneratedTypes } from 'payload';
7
-
8
- type SDKGeneratedTypes = PayloadTypesShape & {
9
- auth: {
10
- [slug: string]: {
11
- forgotPassword: {
12
- email: string;
13
- };
14
- login: {
15
- email: string;
16
- password: string;
17
- };
18
- registerFirstUser: {
19
- email: string;
20
- password: string;
21
- };
22
- unlock: {
23
- email: string;
24
- };
25
- };
26
- };
27
- collections: GeneratedTypes["collections"];
28
- collectionsJoins: GeneratedTypes["collectionsJoins"];
29
- collectionsSelect: GeneratedTypes["collectionsSelect"];
30
- db: GeneratedTypes["db"];
31
- globals: GeneratedTypes["globals"];
32
- globalsSelect: GeneratedTypes["globalsSelect"];
33
- locale: GeneratedTypes["locale"];
34
- };
35
- type PayloadSDKTypes = SDKGeneratedTypes;
36
-
37
- type PayloadClient = PayloadSDK<PayloadSDKTypes>;
38
- type Variables = {
39
- payload: PayloadClient;
40
- user: User | null;
41
- tenant: Tenant | null;
42
- payload_url: string;
43
- theme_path: string;
44
- theme: Theme | null;
45
- resource: unknown;
46
- context: unknown;
47
- template: string;
48
- custom_attribute_relation_resolver: CustomAttributeRelationResolverContract | null;
49
- };
50
- type Env = {
51
- Variables: Variables;
52
- };
53
-
54
- declare function getCachedAuthToken(): string | null;
55
- declare function getCachedTenantId(): string | null;
56
- declare function getCachedThemeId(): string | null;
57
- declare function configureAuthSession(themePath: string): string;
58
- declare function setCachedAuth(token: string, tenantId: string, tenant?: unknown): void;
59
- declare function setCachedThemeId(themeId: string): void;
60
- declare function clearCachedThemeId(): void;
61
- declare function clearCachedAuth(): void;
62
-
63
- type CreateLocalstageAppOptions = {
64
- /**
65
- * Base URL of the Payload CMS server
66
- * Defaults to "http://localhost:3000".
67
- */
68
- payloadUrl?: string;
69
- /**
70
- * Path to the local theme directory
71
- */
72
- themePath: string;
73
- /**
74
- * Enable livereload functionality
75
- * Defaults to true.
76
- */
77
- enableLivereload?: boolean;
78
- /**
79
- * Optional Payload request cache. When omitted, a session-lifetime cache is
80
- * created internally. Supply an external instance to share cache state with
81
- * other subsystems (e.g. the dev server's "clear cache" keypress).
82
- */
83
- payloadCache?: RequestCache | null;
84
- };
85
- /**
86
- * Create a LocalStage application that uses frontstage with local adapters
87
- *
88
- * This provides the same theme rendering as production frontstage,
89
- * but with local filesystem access for themes and SDK access for Payload.
90
- */
91
- declare function createLocalstageApp(options: CreateLocalstageAppOptions): Hono<Env>;
92
-
93
- type AuthSession = {
94
- authToken?: string;
95
- tenantId?: string;
96
- tenant?: unknown;
97
- themeId?: string;
98
- timestamp: number;
99
- };
100
- declare class AuthManager {
101
- private authToken;
102
- private tenantId;
103
- private tenant;
104
- private themeId;
105
- private sessionFile;
106
- constructor(sessionFile?: string);
107
- getSessionFile(): string;
108
- setSessionFile(sessionFile: string): void;
109
- getToken(): string | null;
110
- getTenantId(): string | null;
111
- getTenant(): unknown | null;
112
- getThemeId(): string | null;
113
- setAuth(token: string, tenantId: string, tenant?: unknown): void;
114
- setThemeId(themeId: string): void;
115
- clearThemeId(): void;
116
- clear(): void;
117
- persistToFile(): void;
118
- loadFromFile(): void;
119
- private resetState;
120
- }
121
- declare const authManager: AuthManager;
122
-
123
- export { AuthManager, type AuthSession, type CreateLocalstageAppOptions, authManager, clearCachedAuth, clearCachedThemeId, configureAuthSession, createLocalstageApp, getCachedAuthToken, getCachedTenantId, getCachedThemeId, setCachedAuth, setCachedThemeId };