@akanjs/devkit 3.1.0-rc.2 → 3.1.0-rc.3
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/executors.test.ts +23 -0
- package/executors.ts +4 -4
- package/package.json +2 -2
package/executors.test.ts
CHANGED
|
@@ -99,6 +99,29 @@ describe("Executor filesystem helpers", () => {
|
|
|
99
99
|
expect(entries.dirs).toContain("nested");
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
+
test("lists a folder in name order, whatever order the filesystem keeps it in", async () => {
|
|
103
|
+
const root = await makeTempRoot();
|
|
104
|
+
const exec = new Executor("fixture", root);
|
|
105
|
+
for (const name of ["summary", "file", "banner", "_noti", "admin"]) await exec.mkdir(`lib/${name}`);
|
|
106
|
+
for (const name of ["st.ts", "cnst.ts", "dict.ts"]) await exec.writeFile(`lib/${name}`, "");
|
|
107
|
+
|
|
108
|
+
expect(await exec.readdir("lib")).toEqual([
|
|
109
|
+
"_noti",
|
|
110
|
+
"admin",
|
|
111
|
+
"banner",
|
|
112
|
+
"cnst.ts",
|
|
113
|
+
"dict.ts",
|
|
114
|
+
"file",
|
|
115
|
+
"st.ts",
|
|
116
|
+
"summary",
|
|
117
|
+
]);
|
|
118
|
+
expect(await exec.getFilesAndDirs("lib")).toEqual({
|
|
119
|
+
files: ["cnst.ts", "dict.ts", "st.ts"],
|
|
120
|
+
dirs: ["_noti", "admin", "banner", "file", "summary"],
|
|
121
|
+
});
|
|
122
|
+
expect(await exec.getAllFiles("**/*", { cwd: exec.getPath("lib") })).toEqual(["cnst.ts", "dict.ts", "st.ts"]);
|
|
123
|
+
});
|
|
124
|
+
|
|
102
125
|
test("a refreshed tsconfig re-reads the config it extends", async () => {
|
|
103
126
|
const root = await makeTempRoot();
|
|
104
127
|
const appDir = path.join(root, "apps/demo");
|
package/executors.ts
CHANGED
|
@@ -271,20 +271,20 @@ export class Executor {
|
|
|
271
271
|
const readPath = this.getPath(dirPath);
|
|
272
272
|
try {
|
|
273
273
|
const glob = new Bun.Glob("*");
|
|
274
|
-
return Array.from(glob.scanSync({ cwd: readPath, onlyFiles: false }));
|
|
274
|
+
return Array.from(glob.scanSync({ cwd: readPath, onlyFiles: false })).sort();
|
|
275
275
|
} catch {
|
|
276
276
|
return [];
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
async getAllFiles(pattern = "**/*", { cwd }: { cwd?: string } = {}): Promise<string[]> {
|
|
280
280
|
const glob = new Bun.Glob(pattern);
|
|
281
|
-
return Array.from(glob.scanSync({ cwd: cwd ?? this.cwdPath, onlyFiles: true }));
|
|
281
|
+
return Array.from(glob.scanSync({ cwd: cwd ?? this.cwdPath, onlyFiles: true })).sort();
|
|
282
282
|
}
|
|
283
283
|
async getFilesAndDirs(dirPath: string): Promise<{ files: string[]; dirs: string[] }> {
|
|
284
284
|
const fullDirPath = this.getPath(dirPath);
|
|
285
285
|
const glob = new Bun.Glob("*");
|
|
286
|
-
const files = Array.from(glob.scanSync({ cwd: fullDirPath, onlyFiles: true }));
|
|
287
|
-
const allEntries = Array.from(glob.scanSync({ cwd: fullDirPath, onlyFiles: false }));
|
|
286
|
+
const files = Array.from(glob.scanSync({ cwd: fullDirPath, onlyFiles: true })).sort();
|
|
287
|
+
const allEntries = Array.from(glob.scanSync({ cwd: fullDirPath, onlyFiles: false })).sort();
|
|
288
288
|
const dirs = allEntries.filter((entry) => !files.includes(entry));
|
|
289
289
|
return { files, dirs };
|
|
290
290
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/devkit",
|
|
3
|
-
"version": "3.1.0-rc.
|
|
3
|
+
"version": "3.1.0-rc.3",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@earendil-works/pi-tui": "0.86.1",
|
|
49
49
|
"@inquirer/prompts": "^8.4.3",
|
|
50
50
|
"@tailwindcss/node": "^4.3.0",
|
|
51
|
-
"akanjs": "3.1.0-rc.
|
|
51
|
+
"akanjs": "3.1.0-rc.3",
|
|
52
52
|
"chalk": "^5.6.2",
|
|
53
53
|
"commander": "^14.0.3",
|
|
54
54
|
"dayjs": "^1.11.20",
|