@akanjs/cli 0.0.54 → 0.0.55
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 +37 -17
- package/package.json +7 -1
- package/pkgs/@akanjs/devkit/src/types.d.ts +1 -0
package/index.js
CHANGED
|
@@ -319,11 +319,11 @@ var streamAi = async (question, callback) => {
|
|
|
319
319
|
var import_dayjs = require("dayjs");
|
|
320
320
|
|
|
321
321
|
// pkgs/@akanjs/common/isQueryEqual.ts
|
|
322
|
-
var import_dayjs2 = __toESM(require("dayjs")
|
|
322
|
+
var import_dayjs2 = __toESM(require("dayjs"));
|
|
323
323
|
|
|
324
324
|
// pkgs/@akanjs/common/isValidDate.ts
|
|
325
|
-
var import_dayjs3 = __toESM(require("dayjs")
|
|
326
|
-
var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat")
|
|
325
|
+
var import_dayjs3 = __toESM(require("dayjs"));
|
|
326
|
+
var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat"));
|
|
327
327
|
import_dayjs3.default.extend(import_customParseFormat.default);
|
|
328
328
|
|
|
329
329
|
// pkgs/@akanjs/common/randomPicks.ts
|
|
@@ -342,7 +342,7 @@ var randomPicks = (arr, count = 1, allowDuplicate = false) => {
|
|
|
342
342
|
};
|
|
343
343
|
|
|
344
344
|
// pkgs/@akanjs/common/pluralize.ts
|
|
345
|
-
var import_pluralize = __toESM(require("pluralize")
|
|
345
|
+
var import_pluralize = __toESM(require("pluralize"));
|
|
346
346
|
|
|
347
347
|
// pkgs/@akanjs/common/capitalize.ts
|
|
348
348
|
var capitalize = (str) => {
|
|
@@ -350,7 +350,7 @@ var capitalize = (str) => {
|
|
|
350
350
|
};
|
|
351
351
|
|
|
352
352
|
// pkgs/@akanjs/common/Logger.ts
|
|
353
|
-
var import_dayjs4 = __toESM(require("dayjs")
|
|
353
|
+
var import_dayjs4 = __toESM(require("dayjs"));
|
|
354
354
|
var logLevels = ["trace", "verbose", "debug", "log", "info", "warn", "error"];
|
|
355
355
|
var clc = {
|
|
356
356
|
bold: (text) => `\x1B[1m${text}\x1B[0m`,
|
|
@@ -3797,7 +3797,7 @@ var PackageRunner = class {
|
|
|
3797
3797
|
}
|
|
3798
3798
|
async buildPackage(pkg, distPkg) {
|
|
3799
3799
|
const rootPackageJson = pkg.workspace.readJson("package.json");
|
|
3800
|
-
const
|
|
3800
|
+
const pkgJson = pkg.readJson("package.json");
|
|
3801
3801
|
await pkg.workspace.exec(`rm -rf dist/${pkg.name}`);
|
|
3802
3802
|
await import_promises3.default.rm(`dist/pkgs/${pkg.name}`, { force: true, recursive: true });
|
|
3803
3803
|
let buildResult;
|
|
@@ -3807,8 +3807,7 @@ var PackageRunner = class {
|
|
|
3807
3807
|
entryPoints: [`${pkg.cwdPath}/index.ts`],
|
|
3808
3808
|
bundle: true,
|
|
3809
3809
|
packages: "external",
|
|
3810
|
-
|
|
3811
|
-
format: packageJson.type === "module" ? "esm" : "cjs",
|
|
3810
|
+
format: "cjs",
|
|
3812
3811
|
outdir: distPkg.cwdPath,
|
|
3813
3812
|
logLevel: "error",
|
|
3814
3813
|
plugins: [(0, import_esbuild_plugin_d.dtsPlugin)({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })]
|
|
@@ -3819,8 +3818,7 @@ var PackageRunner = class {
|
|
|
3819
3818
|
write: false,
|
|
3820
3819
|
entryPoints: [`${pkg.cwdPath}/index.ts`],
|
|
3821
3820
|
bundle: true,
|
|
3822
|
-
|
|
3823
|
-
format: packageJson.type === "module" ? "esm" : "cjs",
|
|
3821
|
+
format: "cjs",
|
|
3824
3822
|
packages: "external",
|
|
3825
3823
|
outdir: distPkg.cwdPath,
|
|
3826
3824
|
logLevel: "error",
|
|
@@ -3833,8 +3831,7 @@ var PackageRunner = class {
|
|
|
3833
3831
|
packages: "external",
|
|
3834
3832
|
outdir: `${distPkg.cwdPath}/src/templates`,
|
|
3835
3833
|
outbase: `${pkg.cwdPath}/src/templates`,
|
|
3836
|
-
|
|
3837
|
-
format: packageJson.type === "module" ? "esm" : "cjs",
|
|
3834
|
+
format: "cjs",
|
|
3838
3835
|
footer: { js: "module.exports = module.exports.default;" }
|
|
3839
3836
|
});
|
|
3840
3837
|
await pkg.workspace.exec(
|
|
@@ -3846,17 +3843,40 @@ var PackageRunner = class {
|
|
|
3846
3843
|
entryPoints: [`${pkg.cwdPath}/**/*.ts`, `${pkg.cwdPath}/**/*.tsx`],
|
|
3847
3844
|
bundle: false,
|
|
3848
3845
|
packages: "external",
|
|
3849
|
-
splitting:
|
|
3850
|
-
format:
|
|
3851
|
-
// external: ["@akanjs/*"],
|
|
3846
|
+
splitting: false,
|
|
3847
|
+
format: "cjs",
|
|
3852
3848
|
outdir: distPkg.cwdPath,
|
|
3849
|
+
outExtension: { ".js": pkgJson.type === "module" ? ".cjs" : ".js" },
|
|
3853
3850
|
logLevel: "error",
|
|
3854
3851
|
plugins: [(0, import_esbuild_plugin_d.dtsPlugin)({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })]
|
|
3855
3852
|
});
|
|
3853
|
+
await esbuild2.build({
|
|
3854
|
+
write: true,
|
|
3855
|
+
entryPoints: [`${pkg.cwdPath}/**/*.ts`, `${pkg.cwdPath}/**/*.tsx`],
|
|
3856
|
+
bundle: false,
|
|
3857
|
+
packages: "external",
|
|
3858
|
+
splitting: false,
|
|
3859
|
+
format: "esm",
|
|
3860
|
+
outdir: distPkg.cwdPath,
|
|
3861
|
+
outExtension: { ".js": pkgJson.type === "module" ? ".js" : ".mjs" },
|
|
3862
|
+
logLevel: "error",
|
|
3863
|
+
plugins: []
|
|
3864
|
+
});
|
|
3856
3865
|
}
|
|
3857
|
-
const pkgJson = pkg.readJson("package.json");
|
|
3858
3866
|
const dependencies = buildResult.outputFiles ? extractDependencies(buildResult.outputFiles, rootPackageJson) : {};
|
|
3859
|
-
const pkgPackageJson = {
|
|
3867
|
+
const pkgPackageJson = {
|
|
3868
|
+
...pkgJson,
|
|
3869
|
+
main: "./index.js",
|
|
3870
|
+
engines: { node: ">=22" },
|
|
3871
|
+
dependencies,
|
|
3872
|
+
exports: {
|
|
3873
|
+
".": {
|
|
3874
|
+
require: pkgJson.type === "module" ? "./index.cjs" : "./index.js",
|
|
3875
|
+
import: pkgJson.type === "module" ? "./index.js" : "./index.mjs"
|
|
3876
|
+
},
|
|
3877
|
+
...pkgJson.exports ?? {}
|
|
3878
|
+
}
|
|
3879
|
+
};
|
|
3860
3880
|
if (buildResult.outputFiles)
|
|
3861
3881
|
buildResult.outputFiles.map((file) => distPkg.writeFile(file.path, file.text));
|
|
3862
3882
|
distPkg.writeJson("package.json", pkgPackageJson);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "commonjs",
|
|
3
3
|
"name": "@akanjs/cli",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.55",
|
|
5
5
|
"bin": {
|
|
6
6
|
"akan": "index.js"
|
|
7
7
|
},
|
|
@@ -48,5 +48,11 @@
|
|
|
48
48
|
"vite": "^6.3.4",
|
|
49
49
|
"vite-plugin-node-polyfills": "^0.23.0",
|
|
50
50
|
"vite-tsconfig-paths": "^5.1.4"
|
|
51
|
+
},
|
|
52
|
+
"exports": {
|
|
53
|
+
".": {
|
|
54
|
+
"require": "./index.js",
|
|
55
|
+
"import": "./index.mjs"
|
|
56
|
+
}
|
|
51
57
|
}
|
|
52
58
|
}
|
|
@@ -9,6 +9,7 @@ export interface PackageJson {
|
|
|
9
9
|
devDependencies?: Record<string, string>;
|
|
10
10
|
peerDependencies?: Record<string, string>;
|
|
11
11
|
engines?: Record<string, string>;
|
|
12
|
+
exports?: Record<string, Record<string, string>>;
|
|
12
13
|
}
|
|
13
14
|
export interface TsConfigJson {
|
|
14
15
|
extends?: string;
|