@kithinji/pod 1.0.0
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/build.js +22 -0
- package/dist/main.js +4464 -0
- package/dist/main.js.map +7 -0
- package/dist/types/add/component/component.d.ts +5 -0
- package/dist/types/add/component/component.d.ts.map +1 -0
- package/dist/types/add/component/index.d.ts +2 -0
- package/dist/types/add/component/index.d.ts.map +1 -0
- package/dist/types/add/index.d.ts +4 -0
- package/dist/types/add/index.d.ts.map +1 -0
- package/dist/types/add/module/index.d.ts +2 -0
- package/dist/types/add/module/index.d.ts.map +1 -0
- package/dist/types/add/module/module.d.ts +3 -0
- package/dist/types/add/module/module.d.ts.map +1 -0
- package/dist/types/add/new/index.d.ts +2 -0
- package/dist/types/add/new/index.d.ts.map +1 -0
- package/dist/types/config/config.d.ts +18 -0
- package/dist/types/config/config.d.ts.map +1 -0
- package/dist/types/config/index.d.ts +2 -0
- package/dist/types/config/index.d.ts.map +1 -0
- package/dist/types/dev/index.d.ts +2 -0
- package/dist/types/dev/index.d.ts.map +1 -0
- package/dist/types/dev/project.d.ts +9 -0
- package/dist/types/dev/project.d.ts.map +1 -0
- package/dist/types/dev/server.d.ts +2 -0
- package/dist/types/dev/server.d.ts.map +1 -0
- package/dist/types/docker/docker.d.ts +2 -0
- package/dist/types/docker/docker.d.ts.map +1 -0
- package/dist/types/docker/index.d.ts +2 -0
- package/dist/types/docker/index.d.ts.map +1 -0
- package/dist/types/macros/expand_macros.d.ts +48 -0
- package/dist/types/macros/expand_macros.d.ts.map +1 -0
- package/dist/types/macros/index.d.ts +3 -0
- package/dist/types/macros/index.d.ts.map +1 -0
- package/dist/types/macros/macro_executer.d.ts +12 -0
- package/dist/types/macros/macro_executer.d.ts.map +1 -0
- package/dist/types/main.d.ts +13 -0
- package/dist/types/main.d.ts.map +1 -0
- package/dist/types/plugins/analyzers/graph.d.ts +25 -0
- package/dist/types/plugins/analyzers/graph.d.ts.map +1 -0
- package/dist/types/plugins/css/index.d.ts +7 -0
- package/dist/types/plugins/css/index.d.ts.map +1 -0
- package/dist/types/plugins/generators/generate_controller.d.ts +2 -0
- package/dist/types/plugins/generators/generate_controller.d.ts.map +1 -0
- package/dist/types/plugins/generators/generate_rsc.d.ts +2 -0
- package/dist/types/plugins/generators/generate_rsc.d.ts.map +1 -0
- package/dist/types/plugins/generators/generate_server_component.d.ts +2 -0
- package/dist/types/plugins/generators/generate_server_component.d.ts.map +1 -0
- package/dist/types/plugins/generators/tsx_server_stub.d.ts +2 -0
- package/dist/types/plugins/generators/tsx_server_stub.d.ts.map +1 -0
- package/dist/types/plugins/index.d.ts +4 -0
- package/dist/types/plugins/index.d.ts.map +1 -0
- package/dist/types/plugins/my.d.ts +10 -0
- package/dist/types/plugins/my.d.ts.map +1 -0
- package/dist/types/plugins/transformers/j2d.d.ts +11 -0
- package/dist/types/plugins/transformers/j2d.d.ts.map +1 -0
- package/dist/types/store/index.d.ts +2 -0
- package/dist/types/store/index.d.ts.map +1 -0
- package/dist/types/store/store.d.ts +14 -0
- package/dist/types/store/store.d.ts.map +1 -0
- package/dist/types/utils/cases.d.ts +4 -0
- package/dist/types/utils/cases.d.ts.map +1 -0
- package/dist/types/utils/create.d.ts +12 -0
- package/dist/types/utils/create.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/package.json +44 -0
- package/src/add/component/component.ts +496 -0
- package/src/add/component/index.ts +1 -0
- package/src/add/index.ts +3 -0
- package/src/add/module/index.ts +1 -0
- package/src/add/module/module.ts +521 -0
- package/src/add/new/index.ts +135 -0
- package/src/config/config.ts +141 -0
- package/src/config/index.ts +1 -0
- package/src/dev/index.ts +1 -0
- package/src/dev/project.ts +45 -0
- package/src/dev/server.ts +190 -0
- package/src/docker/docker.ts +452 -0
- package/src/docker/index.ts +1 -0
- package/src/macros/expand_macros.ts +791 -0
- package/src/macros/index.ts +2 -0
- package/src/macros/macro_executer.ts +189 -0
- package/src/main.ts +95 -0
- package/src/plugins/analyzers/graph.ts +291 -0
- package/src/plugins/css/index.ts +25 -0
- package/src/plugins/generators/generate_controller.ts +308 -0
- package/src/plugins/generators/generate_rsc.ts +274 -0
- package/src/plugins/generators/generate_server_component.ts +279 -0
- package/src/plugins/generators/tsx_server_stub.ts +295 -0
- package/src/plugins/index.ts +3 -0
- package/src/plugins/my.ts +274 -0
- package/src/plugins/transformers/j2d.ts +1014 -0
- package/src/store/index.ts +1 -0
- package/src/store/store.ts +44 -0
- package/src/utils/cases.ts +15 -0
- package/src/utils/create.ts +26 -0
- package/src/utils/index.ts +2 -0
- package/tsconfig.json +27 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./store";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export class Store {
|
|
2
|
+
private static instance: Store;
|
|
3
|
+
private containers: Map<string, unknown[]> = new Map();
|
|
4
|
+
|
|
5
|
+
private constructor() {}
|
|
6
|
+
|
|
7
|
+
public static getInstance(): Store {
|
|
8
|
+
if (!Store.instance) {
|
|
9
|
+
Store.instance = new Store();
|
|
10
|
+
}
|
|
11
|
+
return Store.instance;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public set<T>(key: string, value: T): void {
|
|
15
|
+
const existing = this.containers.get(key) || [];
|
|
16
|
+
existing.push(value);
|
|
17
|
+
this.containers.set(key, existing);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public get<T>(key: string): T[] | undefined {
|
|
21
|
+
const values = this.containers.get(key);
|
|
22
|
+
return values as T[] | undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public has(key: string): boolean {
|
|
26
|
+
return this.containers.has(key);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public delete(key: string): boolean {
|
|
30
|
+
return this.containers.delete(key);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public clear(): void {
|
|
34
|
+
this.containers.clear();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public keys(): IterableIterator<string> {
|
|
38
|
+
return this.containers.keys();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public get size(): number {
|
|
42
|
+
return this.containers.size;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function toCamelCase(str: string): string {
|
|
2
|
+
return str
|
|
3
|
+
.replace(/[-_](.)/g, (_, char) => char.toUpperCase())
|
|
4
|
+
.replace(/^./, (char) => char.toLowerCase());
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function toPascalCase(str: string): string {
|
|
8
|
+
return str
|
|
9
|
+
.replace(/[-_](.)/g, (_, char) => char.toUpperCase())
|
|
10
|
+
.replace(/^./, (char) => char.toUpperCase());
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function toSnakeCase(str: string): string {
|
|
14
|
+
return str.replace(/[-\s]/g, "_").toLowerCase();
|
|
15
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as fs from "fs";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
|
|
4
|
+
interface FileEntry {
|
|
5
|
+
name: string;
|
|
6
|
+
content: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface DirEntry {
|
|
10
|
+
name?: string;
|
|
11
|
+
files?: FileEntry[];
|
|
12
|
+
dirs?: DirEntry[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function createStructure(basePath: string, entry: DirEntry) {
|
|
16
|
+
fs.mkdirSync(basePath, { recursive: true });
|
|
17
|
+
|
|
18
|
+
entry.files?.forEach((file) => {
|
|
19
|
+
fs.writeFileSync(path.join(basePath, file.name), file.content);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
entry.dirs?.forEach((dir) => {
|
|
23
|
+
const dirPath = path.join(basePath, dir.name || "");
|
|
24
|
+
createStructure(dirPath, dir);
|
|
25
|
+
});
|
|
26
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"lib": ["ES2020", "DOM"],
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"resolveJsonModule": true,
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"declarationMap": true,
|
|
10
|
+
"emitDeclarationOnly": false,
|
|
11
|
+
"outDir": "./dist/types",
|
|
12
|
+
"rootDir": "./src",
|
|
13
|
+
"strict": true,
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"forceConsistentCasingInFileNames": true,
|
|
17
|
+
"experimentalDecorators": true,
|
|
18
|
+
"emitDecoratorMetadata": true,
|
|
19
|
+
"baseUrl": ".",
|
|
20
|
+
"paths": {
|
|
21
|
+
"@/*": ["src/*"]
|
|
22
|
+
},
|
|
23
|
+
"typeRoots": ["./node_modules/@types", "./src/types"]
|
|
24
|
+
},
|
|
25
|
+
"include": ["src/**/*"],
|
|
26
|
+
"exclude": ["node_modules", "dist"]
|
|
27
|
+
}
|