@geektech/tsone-cli 0.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.
@@ -0,0 +1,5 @@
1
+ export { defineConfig, resolveConfig } from './config';
2
+ export { build } from './build';
3
+ export { startDevServer } from './server';
4
+ export type { StartDevServerOptions } from './server';
5
+ export type { BuildOptions, BuildResult, BuildConfig, ProxyOptions, ResolveConfigOptions, ResolvedConfig, ServerConfig, UserConfig, } from './types';
package/dist/index.js ADDED
@@ -0,0 +1,16 @@
1
+ // @bun
2
+ import {
3
+ build,
4
+ defineConfig,
5
+ resolveConfig,
6
+ startDevServer
7
+ } from "./index-jmtdrrbw.js";
8
+ export {
9
+ startDevServer,
10
+ resolveConfig,
11
+ defineConfig,
12
+ build
13
+ };
14
+
15
+ //# debugId=120AB7058D9AA66E64756E2164756E21
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "120AB7058D9AA66E64756E2164756E21",
8
+ "names": []
9
+ }
@@ -0,0 +1,3 @@
1
+ import type { AppDocumentRenderOptions } from '@geektech/tsone';
2
+ import type { ResolvedConfig } from './types';
3
+ export declare function renderProjectHtml(config: ResolvedConfig, options: AppDocumentRenderOptions): Promise<string>;
@@ -0,0 +1,2 @@
1
+ import type { ServerConfig } from './types';
2
+ export declare function createProxyHandler(proxy: ServerConfig['proxy']): (request: Request) => Promise<Response | undefined>;
@@ -0,0 +1,2 @@
1
+ export declare function assertSafeSubdirectory(root: string, path: string, errorMessage: string): Promise<void>;
2
+ export declare function assertSafeSubdirectoryDoesNotContain(root: string, path: string, protectedPath: string, errorMessage: string): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { ResolveConfigOptions } from './types';
2
+ export type StartDevServerOptions = ResolveConfigOptions;
3
+ export declare function startDevServer(options?: StartDevServerOptions): Promise<ReturnType<typeof Bun.serve>>;
@@ -0,0 +1,45 @@
1
+ export interface ProxyOptions {
2
+ target: string;
3
+ changeOrigin?: boolean;
4
+ rewrite?: (path: string) => string;
5
+ }
6
+ export interface ServerConfig {
7
+ host?: string;
8
+ port?: number;
9
+ proxy?: Record<string, string | ProxyOptions>;
10
+ }
11
+ export interface BuildConfig {
12
+ outDir?: string;
13
+ }
14
+ export interface UserConfig {
15
+ entry?: string;
16
+ server?: ServerConfig;
17
+ build?: BuildConfig;
18
+ }
19
+ export interface ResolveConfigOptions {
20
+ root?: string;
21
+ config?: UserConfig;
22
+ host?: string;
23
+ port?: number;
24
+ outDir?: string;
25
+ }
26
+ export interface BuildOptions extends ResolveConfigOptions {
27
+ }
28
+ export interface BuildResult {
29
+ root: string;
30
+ outDir: string;
31
+ assetsBuilt: string[];
32
+ }
33
+ export interface ResolvedConfig {
34
+ root: string;
35
+ configFile?: string;
36
+ entry: string;
37
+ server: {
38
+ host: string;
39
+ port: number;
40
+ proxy: Record<string, string | ProxyOptions>;
41
+ };
42
+ build: {
43
+ outDir: string;
44
+ };
45
+ }
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@geektech/tsone-cli",
3
+ "version": "0.0.1",
4
+ "description": "Bun-native development and build CLI for TSone applications",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./dist/index.js",
9
+ "types": "./dist/index.d.ts"
10
+ }
11
+ },
12
+ "bin": {
13
+ "tsone": "bin/tsone.ts"
14
+ },
15
+ "scripts": {
16
+ "build": "bun scripts/build.ts",
17
+ "build:types": "bunx tsc --project tsconfig.build.json",
18
+ "lint": "eslint . --ext .ts",
19
+ "test": "bun test"
20
+ },
21
+ "dependencies": {
22
+ "@geektech/tsone": "workspace:*"
23
+ },
24
+ "devDependencies": {
25
+ "happy-dom": "^20.9.0"
26
+ },
27
+ "files": [
28
+ "bin",
29
+ "dist",
30
+ "README.md",
31
+ "LICENSE"
32
+ ],
33
+ "publishConfig": {
34
+ "access": "public",
35
+ "registry": "https://registry.npmjs.org/"
36
+ },
37
+ "engines": {
38
+ "bun": ">=1.3.0"
39
+ }
40
+ }