akanjs 2.0.0-beta.0 → 2.0.0-beta.2
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/cli/index.js
CHANGED
|
@@ -867,7 +867,9 @@ import {
|
|
|
867
867
|
import { readFileSync as readFileSync3 } from "fs";
|
|
868
868
|
import { mkdir as mkdir2, readdir as readDirEntries, stat as stat2 } from "fs/promises";
|
|
869
869
|
import path7 from "path";
|
|
870
|
+
var {$ } = globalThis.Bun;
|
|
870
871
|
import chalk4 from "chalk";
|
|
872
|
+
import ts3 from "typescript";
|
|
871
873
|
|
|
872
874
|
import fs from "fs";
|
|
873
875
|
import path from "path";
|
|
@@ -1163,9 +1165,6 @@ var decreaseBuildNum = async (app) => {
|
|
|
1163
1165
|
fs.writeFileSync(akanConfigPath, akanConfigContent);
|
|
1164
1166
|
};
|
|
1165
1167
|
|
|
1166
|
-
var {$ } = globalThis.Bun;
|
|
1167
|
-
import ts3 from "typescript";
|
|
1168
|
-
|
|
1169
1168
|
import path2 from "path";
|
|
1170
1169
|
var getDirname = (url) => path2.dirname(new URL(url).pathname);
|
|
1171
1170
|
|
|
@@ -9972,15 +9971,22 @@ class PackageRunner extends runner("package") {
|
|
|
9972
9971
|
await pkg.dist.mkdir(pkg.dist.cwdPath);
|
|
9973
9972
|
const scanner = await TypeScriptDependencyScanner.from(pkg);
|
|
9974
9973
|
const { npmDeps, npmDevDeps, missingDeps } = await scanner.getPackageBuildDependencies(pkg.name);
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9974
|
+
const packageRuntimeDependencies = { akanjs: ["daisyui"] };
|
|
9975
|
+
const forcedRuntimeDeps = packageRuntimeDependencies[pkg.name] ?? [];
|
|
9976
|
+
const packageRuntimeDeps = [...new Set([...npmDeps, ...forcedRuntimeDeps])];
|
|
9977
|
+
const rootPackageJson = await pkg.workspace.getPackageJson();
|
|
9978
|
+
const rootDeps = { ...rootPackageJson.dependencies, ...rootPackageJson.devDependencies };
|
|
9979
|
+
const missingForcedDeps = forcedRuntimeDeps.filter((dep) => !rootDeps[dep]);
|
|
9980
|
+
const allMissingDeps = [...new Set([...missingDeps, ...missingForcedDeps])].sort();
|
|
9981
|
+
if (allMissingDeps.length > 0)
|
|
9982
|
+
throw new Error(`Missing dependency versions in root package.json: ${allMissingDeps.join(", ")}`);
|
|
9983
|
+
await pkg.updatePackageJsonDependencies(packageRuntimeDeps, npmDevDeps);
|
|
9978
9984
|
const hasBuildFile = await Bun.file(`${pkg.cwdPath}/build.ts`).exists();
|
|
9979
9985
|
if (hasBuildFile) {
|
|
9980
9986
|
await pkg.workspace.spawn(process.execPath, [`${pkg.cwdPath}/build.ts`], { env: process.env, stdio: "inherit" });
|
|
9981
9987
|
} else {
|
|
9982
9988
|
await $2`cp -r ${pkg.cwdPath}/. ${pkg.dist.cwdPath}`;
|
|
9983
|
-
await Promise.all([pkg.generateDistPackageJson(
|
|
9989
|
+
await Promise.all([pkg.generateDistPackageJson(packageRuntimeDeps, npmDevDeps), pkg.generateTsconfigJson()]);
|
|
9984
9990
|
}
|
|
9985
9991
|
}
|
|
9986
9992
|
async updateWorskpaceRootPackageJson(workspace, rootPackageJson) {
|
|
@@ -11362,8 +11368,7 @@ class WorkspaceScript extends script("workspace", [WorkspaceRunner, ApplicationS
|
|
|
11362
11368
|
|
|
11363
11369
|
class WorkspaceCommand extends command("workspace", [WorkspaceScript], ({ public: target }) => ({
|
|
11364
11370
|
createWorkspace: target({ desc: "Create a new Akan.js workspace", runsOnWorkspaceRoot: false }).arg("workspaceName", String, { desc: "what is the name of your organization?" }).option("app", String, {
|
|
11365
|
-
desc: "what is the codename of your first application? (e.g. myapp)"
|
|
11366
|
-
default: "app"
|
|
11371
|
+
desc: "what is the codename of your first application? (e.g. myapp)"
|
|
11367
11372
|
}).option("dir", String, {
|
|
11368
11373
|
desc: "directory of workspace",
|
|
11369
11374
|
default: process.env.USE_AKANJS_PKGS === "true" ? "local" : "."
|
|
@@ -32,17 +32,24 @@ export class PackageRunner extends runner("package") {
|
|
|
32
32
|
await pkg.dist.mkdir(pkg.dist.cwdPath);
|
|
33
33
|
const scanner = await TypeScriptDependencyScanner.from(pkg);
|
|
34
34
|
const { npmDeps, npmDevDeps, missingDeps } = await scanner.getPackageBuildDependencies(pkg.name);
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
const packageRuntimeDependencies: Record<string, string[]> = { akanjs: ["daisyui"] };
|
|
36
|
+
const forcedRuntimeDeps = packageRuntimeDependencies[pkg.name] ?? [];
|
|
37
|
+
const packageRuntimeDeps = [...new Set([...npmDeps, ...forcedRuntimeDeps])];
|
|
38
|
+
const rootPackageJson = await pkg.workspace.getPackageJson();
|
|
39
|
+
const rootDeps = { ...rootPackageJson.dependencies, ...rootPackageJson.devDependencies };
|
|
40
|
+
const missingForcedDeps = forcedRuntimeDeps.filter((dep) => !rootDeps[dep]);
|
|
41
|
+
const allMissingDeps = [...new Set([...missingDeps, ...missingForcedDeps])].sort();
|
|
42
|
+
if (allMissingDeps.length > 0)
|
|
43
|
+
throw new Error(`Missing dependency versions in root package.json: ${allMissingDeps.join(", ")}`);
|
|
37
44
|
|
|
38
|
-
await pkg.updatePackageJsonDependencies(
|
|
45
|
+
await pkg.updatePackageJsonDependencies(packageRuntimeDeps, npmDevDeps);
|
|
39
46
|
|
|
40
47
|
const hasBuildFile = await Bun.file(`${pkg.cwdPath}/build.ts`).exists();
|
|
41
48
|
if (hasBuildFile) {
|
|
42
49
|
await pkg.workspace.spawn(process.execPath, [`${pkg.cwdPath}/build.ts`], { env: process.env, stdio: "inherit" });
|
|
43
50
|
} else {
|
|
44
51
|
await $`cp -r ${pkg.cwdPath}/. ${pkg.dist.cwdPath}`;
|
|
45
|
-
await Promise.all([pkg.generateDistPackageJson(
|
|
52
|
+
await Promise.all([pkg.generateDistPackageJson(packageRuntimeDeps, npmDevDeps), pkg.generateTsconfigJson()]);
|
|
46
53
|
}
|
|
47
54
|
}
|
|
48
55
|
|
|
@@ -7,7 +7,6 @@ export class WorkspaceCommand extends command("workspace", [WorkspaceScript], ({
|
|
|
7
7
|
.arg("workspaceName", String, { desc: "what is the name of your organization?" })
|
|
8
8
|
.option("app", String, {
|
|
9
9
|
desc: "what is the codename of your first application? (e.g. myapp)",
|
|
10
|
-
default: "app",
|
|
11
10
|
})
|
|
12
11
|
.option("dir", String, {
|
|
13
12
|
desc: "directory of workspace",
|
package/devkit/executors.ts
CHANGED
|
@@ -18,11 +18,10 @@ import {
|
|
|
18
18
|
validatePageSourceFile,
|
|
19
19
|
validateSubRoutePageKey,
|
|
20
20
|
} from "akanjs/common";
|
|
21
|
-
import chalk from "chalk";
|
|
22
|
-
import { AkanAppConfig, AkanLibConfig, decreaseBuildNum, increaseBuildNum } from "./akanConfig";
|
|
23
|
-
|
|
24
21
|
import { $ } from "bun";
|
|
22
|
+
import chalk from "chalk";
|
|
25
23
|
import ts from "typescript";
|
|
24
|
+
import { AkanAppConfig, AkanLibConfig, decreaseBuildNum, increaseBuildNum } from "./akanConfig";
|
|
26
25
|
import { FileSys } from "./fileSys";
|
|
27
26
|
import { getDirname } from "./getDirname";
|
|
28
27
|
import { Linter } from "./linter";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "akanjs",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.2",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -153,6 +153,7 @@
|
|
|
153
153
|
"compare-versions": "^6.1.1",
|
|
154
154
|
"cordova-plugin-purchase": "^13.16.0",
|
|
155
155
|
"croner": "^10.0.1",
|
|
156
|
+
"daisyui": "^5.5.20",
|
|
156
157
|
"dataloader": "^2.2.3",
|
|
157
158
|
"dayjs": "^1.11.20",
|
|
158
159
|
"file-saver": "^2.0.5",
|