@akanjs/cli 0.0.84 → 0.0.86
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/index.js +26 -6
- package/package.json +2 -2
- package/pkgs/@akanjs/config/index.d.ts +1 -130
- package/pkgs/@akanjs/config/src/types.d.ts +130 -0
- package/src/templates/app/app/[lang]/(__appName__)/styles.css.template +1 -1
- package/src/templates/app/capacitor.config.ts.template +1 -1
- package/src/templates/app/playwright.config.ts.template +1 -1
- package/src/templates/app/postcss.config.js.template +1 -1
package/index.js
CHANGED
|
@@ -614,6 +614,14 @@ var withBase = (appName, config, libs, routes = []) => {
|
|
|
614
614
|
config2.resolve.alias["@akanjs/config"] = import_path.default.resolve(__dirname, "../../../../pkgs/@akanjs/config");
|
|
615
615
|
return config2;
|
|
616
616
|
},
|
|
617
|
+
turbopack: {
|
|
618
|
+
resolveAlias: {
|
|
619
|
+
// canvas: false,
|
|
620
|
+
// encoding: false,
|
|
621
|
+
...process.env.USE_AKANJS_PKGS === "true" ? { "@akanjs/config": import_path.default.resolve(__dirname, "../../../../pkgs/@akanjs/config") } : {},
|
|
622
|
+
...config.turbopack?.resolveAlias ?? {}
|
|
623
|
+
}
|
|
624
|
+
},
|
|
617
625
|
redirects() {
|
|
618
626
|
return routes.map(({ basePath: basePath2, domains }) => [
|
|
619
627
|
{ basePath: basePath2, domain: `${basePath2}-debug.${devDomain}` },
|
|
@@ -755,7 +763,7 @@ var getLibConfig = async (libRoot, props) => {
|
|
|
755
763
|
return makeLibConfig(config, props);
|
|
756
764
|
};
|
|
757
765
|
|
|
758
|
-
// pkgs/@akanjs/config/
|
|
766
|
+
// pkgs/@akanjs/config/src/types.ts
|
|
759
767
|
var getDefaultFileScan = () => ({
|
|
760
768
|
constants: {
|
|
761
769
|
databases: [],
|
|
@@ -1042,7 +1050,7 @@ var Executor = class {
|
|
|
1042
1050
|
return this;
|
|
1043
1051
|
}
|
|
1044
1052
|
writeJson(filePath, content) {
|
|
1045
|
-
this.writeFile(filePath, JSON.stringify(content, null, 2));
|
|
1053
|
+
this.writeFile(filePath, JSON.stringify(content, null, 2) + "\n");
|
|
1046
1054
|
return this;
|
|
1047
1055
|
}
|
|
1048
1056
|
getLocalFile(filePath) {
|
|
@@ -4025,15 +4033,27 @@ var PackageRunner = class {
|
|
|
4025
4033
|
if (pkg.name === "@akanjs/config") {
|
|
4026
4034
|
buildResult = await esbuild2.build({
|
|
4027
4035
|
write: false,
|
|
4028
|
-
entryPoints: [`${pkg.cwdPath}
|
|
4029
|
-
bundle:
|
|
4036
|
+
entryPoints: [`${pkg.cwdPath}/**/*.ts`],
|
|
4037
|
+
bundle: false,
|
|
4030
4038
|
packages: "external",
|
|
4031
4039
|
format: "cjs",
|
|
4032
4040
|
outdir: distPkg.cwdPath,
|
|
4033
4041
|
logLevel: "error",
|
|
4042
|
+
outExtension: { ".js": pkgJson.type === "module" ? ".cjs" : ".js" },
|
|
4034
4043
|
plugins: [(0, import_esbuild_plugin_d.dtsPlugin)({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })]
|
|
4035
4044
|
});
|
|
4036
|
-
await
|
|
4045
|
+
await esbuild2.build({
|
|
4046
|
+
write: true,
|
|
4047
|
+
entryPoints: [`${pkg.cwdPath}/**/*.ts`, `${pkg.cwdPath}/**/*.css`, `${pkg.cwdPath}/**/*.js`],
|
|
4048
|
+
bundle: false,
|
|
4049
|
+
packages: "external",
|
|
4050
|
+
format: "esm",
|
|
4051
|
+
outdir: distPkg.cwdPath,
|
|
4052
|
+
logLevel: "error",
|
|
4053
|
+
outExtension: { ".js": pkgJson.type === "module" ? ".js" : ".mjs" },
|
|
4054
|
+
// copy css files
|
|
4055
|
+
loader: { ".css": "copy", ".js": "copy" }
|
|
4056
|
+
});
|
|
4037
4057
|
} else if (pkg.name === "@akanjs/cli") {
|
|
4038
4058
|
buildResult = await esbuild2.build({
|
|
4039
4059
|
write: false,
|
|
@@ -4100,7 +4120,7 @@ var PackageRunner = class {
|
|
|
4100
4120
|
main: "./index.js",
|
|
4101
4121
|
engines: { node: ">=22" },
|
|
4102
4122
|
dependencies,
|
|
4103
|
-
...["@akanjs/
|
|
4123
|
+
...["@akanjs/cli"].includes(pkg.name) ? {} : {
|
|
4104
4124
|
exports: {
|
|
4105
4125
|
".": {
|
|
4106
4126
|
require: pkgJson.type === "module" ? "./index.cjs" : "./index.js",
|
package/package.json
CHANGED
|
@@ -1,132 +1,3 @@
|
|
|
1
|
-
import { NextConfig } from "next";
|
|
2
1
|
export * from "./src/akanConfig";
|
|
3
2
|
export * from "./src/nextConfig";
|
|
4
|
-
export
|
|
5
|
-
appName: string;
|
|
6
|
-
repoName: string;
|
|
7
|
-
serveDomain: string;
|
|
8
|
-
env: "testing" | "debug" | "develop" | "main";
|
|
9
|
-
command?: string;
|
|
10
|
-
}
|
|
11
|
-
export type Arch = "amd64" | "arm64";
|
|
12
|
-
export type ExplicitDependencies = string[] | {
|
|
13
|
-
[key in Arch]: string[];
|
|
14
|
-
};
|
|
15
|
-
export interface AppConfigResult {
|
|
16
|
-
rootLib?: string;
|
|
17
|
-
libs: string[];
|
|
18
|
-
backend: {
|
|
19
|
-
dockerfile: string;
|
|
20
|
-
explicitDependencies: ExplicitDependencies;
|
|
21
|
-
};
|
|
22
|
-
frontend: {
|
|
23
|
-
dockerfile: string;
|
|
24
|
-
nextConfig: NextConfig | (() => Promise<NextConfig> | NextConfig);
|
|
25
|
-
routes?: {
|
|
26
|
-
basePath?: string;
|
|
27
|
-
domains: {
|
|
28
|
-
main?: string[];
|
|
29
|
-
develop?: string[];
|
|
30
|
-
debug?: string[];
|
|
31
|
-
};
|
|
32
|
-
}[];
|
|
33
|
-
explicitDependencies: ExplicitDependencies;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export interface LibConfigResult {
|
|
37
|
-
rootLib?: string;
|
|
38
|
-
libs: string[];
|
|
39
|
-
backend: {
|
|
40
|
-
explicitDependencies: ExplicitDependencies;
|
|
41
|
-
};
|
|
42
|
-
frontend: {
|
|
43
|
-
explicitDependencies: ExplicitDependencies;
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export type DeepPartial<T> = {
|
|
47
|
-
[P in keyof T]?: T[P] extends any[] ? T[P] : T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
48
|
-
};
|
|
49
|
-
export type AppConfig = DeepPartial<AppConfigResult> | ((props: RunnerProps) => DeepPartial<AppConfigResult>);
|
|
50
|
-
export type LibConfig = DeepPartial<LibConfigResult> | ((props: RunnerProps) => DeepPartial<LibConfigResult>);
|
|
51
|
-
export interface AkanConfigFile {
|
|
52
|
-
default: NextConfig;
|
|
53
|
-
}
|
|
54
|
-
export interface FileConventionScanResult {
|
|
55
|
-
constants: {
|
|
56
|
-
databases: string[];
|
|
57
|
-
scalars: string[];
|
|
58
|
-
};
|
|
59
|
-
dictionary: {
|
|
60
|
-
databases: string[];
|
|
61
|
-
services: string[];
|
|
62
|
-
scalars: string[];
|
|
63
|
-
};
|
|
64
|
-
documents: {
|
|
65
|
-
databases: string[];
|
|
66
|
-
scalars: string[];
|
|
67
|
-
};
|
|
68
|
-
services: {
|
|
69
|
-
databases: string[];
|
|
70
|
-
services: string[];
|
|
71
|
-
scalars: string[];
|
|
72
|
-
};
|
|
73
|
-
signal: {
|
|
74
|
-
databases: string[];
|
|
75
|
-
services: string[];
|
|
76
|
-
scalars: string[];
|
|
77
|
-
};
|
|
78
|
-
store: {
|
|
79
|
-
databases: string[];
|
|
80
|
-
services: string[];
|
|
81
|
-
scalars: string[];
|
|
82
|
-
};
|
|
83
|
-
components: {
|
|
84
|
-
databases: string[];
|
|
85
|
-
services: string[];
|
|
86
|
-
scalars: string[];
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
export declare const getDefaultFileScan: () => FileConventionScanResult;
|
|
90
|
-
export interface AppScanResult {
|
|
91
|
-
name: string;
|
|
92
|
-
type: "app" | "lib";
|
|
93
|
-
akanConfig: AppConfigResult;
|
|
94
|
-
files: FileConventionScanResult;
|
|
95
|
-
libDeps: string[];
|
|
96
|
-
pkgDeps: string[];
|
|
97
|
-
dependencies: string[];
|
|
98
|
-
libs: {
|
|
99
|
-
[key: string]: LibScanResult;
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
export interface LibScanResult {
|
|
103
|
-
name: string;
|
|
104
|
-
type: "app" | "lib";
|
|
105
|
-
akanConfig: LibConfigResult;
|
|
106
|
-
files: FileConventionScanResult;
|
|
107
|
-
libDeps: string[];
|
|
108
|
-
pkgDeps: string[];
|
|
109
|
-
dependencies: string[];
|
|
110
|
-
libs: {
|
|
111
|
-
[key: string]: LibScanResult;
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
export interface PkgScanResult {
|
|
115
|
-
name: string;
|
|
116
|
-
pkgDeps: string[];
|
|
117
|
-
dependencies: string[];
|
|
118
|
-
}
|
|
119
|
-
export interface WorkspaceScanResult {
|
|
120
|
-
appNames: string[];
|
|
121
|
-
libNames: string[];
|
|
122
|
-
pkgNames: string[];
|
|
123
|
-
apps: {
|
|
124
|
-
[key: string]: AppScanResult;
|
|
125
|
-
};
|
|
126
|
-
libs: {
|
|
127
|
-
[key: string]: LibScanResult;
|
|
128
|
-
};
|
|
129
|
-
pkgs: {
|
|
130
|
-
[key: string]: PkgScanResult;
|
|
131
|
-
};
|
|
132
|
-
}
|
|
3
|
+
export * from "./src/types";
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { NextConfig } from "next";
|
|
2
|
+
export interface RunnerProps {
|
|
3
|
+
appName: string;
|
|
4
|
+
repoName: string;
|
|
5
|
+
serveDomain: string;
|
|
6
|
+
env: "testing" | "debug" | "develop" | "main";
|
|
7
|
+
command?: string;
|
|
8
|
+
}
|
|
9
|
+
export type Arch = "amd64" | "arm64";
|
|
10
|
+
export type ExplicitDependencies = string[] | {
|
|
11
|
+
[key in Arch]: string[];
|
|
12
|
+
};
|
|
13
|
+
export interface AppConfigResult {
|
|
14
|
+
rootLib?: string;
|
|
15
|
+
libs: string[];
|
|
16
|
+
backend: {
|
|
17
|
+
dockerfile: string;
|
|
18
|
+
explicitDependencies: ExplicitDependencies;
|
|
19
|
+
};
|
|
20
|
+
frontend: {
|
|
21
|
+
dockerfile: string;
|
|
22
|
+
nextConfig: NextConfig | (() => Promise<NextConfig> | NextConfig);
|
|
23
|
+
routes?: {
|
|
24
|
+
basePath?: string;
|
|
25
|
+
domains: {
|
|
26
|
+
main?: string[];
|
|
27
|
+
develop?: string[];
|
|
28
|
+
debug?: string[];
|
|
29
|
+
};
|
|
30
|
+
}[];
|
|
31
|
+
explicitDependencies: ExplicitDependencies;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface LibConfigResult {
|
|
35
|
+
rootLib?: string;
|
|
36
|
+
libs: string[];
|
|
37
|
+
backend: {
|
|
38
|
+
explicitDependencies: ExplicitDependencies;
|
|
39
|
+
};
|
|
40
|
+
frontend: {
|
|
41
|
+
explicitDependencies: ExplicitDependencies;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export type DeepPartial<T> = {
|
|
45
|
+
[P in keyof T]?: T[P] extends any[] ? T[P] : T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
46
|
+
};
|
|
47
|
+
export type AppConfig = DeepPartial<AppConfigResult> | ((props: RunnerProps) => DeepPartial<AppConfigResult>);
|
|
48
|
+
export type LibConfig = DeepPartial<LibConfigResult> | ((props: RunnerProps) => DeepPartial<LibConfigResult>);
|
|
49
|
+
export interface AkanConfigFile {
|
|
50
|
+
default: NextConfig;
|
|
51
|
+
}
|
|
52
|
+
export interface FileConventionScanResult {
|
|
53
|
+
constants: {
|
|
54
|
+
databases: string[];
|
|
55
|
+
scalars: string[];
|
|
56
|
+
};
|
|
57
|
+
dictionary: {
|
|
58
|
+
databases: string[];
|
|
59
|
+
services: string[];
|
|
60
|
+
scalars: string[];
|
|
61
|
+
};
|
|
62
|
+
documents: {
|
|
63
|
+
databases: string[];
|
|
64
|
+
scalars: string[];
|
|
65
|
+
};
|
|
66
|
+
services: {
|
|
67
|
+
databases: string[];
|
|
68
|
+
services: string[];
|
|
69
|
+
scalars: string[];
|
|
70
|
+
};
|
|
71
|
+
signal: {
|
|
72
|
+
databases: string[];
|
|
73
|
+
services: string[];
|
|
74
|
+
scalars: string[];
|
|
75
|
+
};
|
|
76
|
+
store: {
|
|
77
|
+
databases: string[];
|
|
78
|
+
services: string[];
|
|
79
|
+
scalars: string[];
|
|
80
|
+
};
|
|
81
|
+
components: {
|
|
82
|
+
databases: string[];
|
|
83
|
+
services: string[];
|
|
84
|
+
scalars: string[];
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
export declare const getDefaultFileScan: () => FileConventionScanResult;
|
|
88
|
+
export interface AppScanResult {
|
|
89
|
+
name: string;
|
|
90
|
+
type: "app" | "lib";
|
|
91
|
+
akanConfig: AppConfigResult;
|
|
92
|
+
files: FileConventionScanResult;
|
|
93
|
+
libDeps: string[];
|
|
94
|
+
pkgDeps: string[];
|
|
95
|
+
dependencies: string[];
|
|
96
|
+
libs: {
|
|
97
|
+
[key: string]: LibScanResult;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export interface LibScanResult {
|
|
101
|
+
name: string;
|
|
102
|
+
type: "app" | "lib";
|
|
103
|
+
akanConfig: LibConfigResult;
|
|
104
|
+
files: FileConventionScanResult;
|
|
105
|
+
libDeps: string[];
|
|
106
|
+
pkgDeps: string[];
|
|
107
|
+
dependencies: string[];
|
|
108
|
+
libs: {
|
|
109
|
+
[key: string]: LibScanResult;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export interface PkgScanResult {
|
|
113
|
+
name: string;
|
|
114
|
+
pkgDeps: string[];
|
|
115
|
+
dependencies: string[];
|
|
116
|
+
}
|
|
117
|
+
export interface WorkspaceScanResult {
|
|
118
|
+
appNames: string[];
|
|
119
|
+
libNames: string[];
|
|
120
|
+
pkgNames: string[];
|
|
121
|
+
apps: {
|
|
122
|
+
[key: string]: AppScanResult;
|
|
123
|
+
};
|
|
124
|
+
libs: {
|
|
125
|
+
[key: string]: LibScanResult;
|
|
126
|
+
};
|
|
127
|
+
pkgs: {
|
|
128
|
+
[key: string]: PkgScanResult;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//! will be replaced with akan.config.ts
|
|
2
2
|
const akanjsPrefix = process.env.USE_AKANJS_PKGS === "true" ? "../../pkgs/" : "";
|
|
3
|
-
const { withBase } = require(`${akanjsPrefix}@akanjs/config/
|
|
3
|
+
const { withBase } = require(`${akanjsPrefix}@akanjs/config/postcss.config.base`);
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @type {import('postcss-load-config').Config}
|