@akanjs/devkit 3.1.0-rc.2 → 3.1.0-rc.4
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.
|
@@ -46,6 +46,8 @@ describe("resolveSsrPageEntries", () => {
|
|
|
46
46
|
expect(generatedSource).toContain("export const NotFound = userLayout.NotFound ?? inheritedLayout.NotFound;");
|
|
47
47
|
expect(generatedSource).toContain("export const Error = userLayout.Error ?? inheritedLayout.Error;");
|
|
48
48
|
expect(generatedSource).toContain("export const pageConfig = userLayout.pageConfig ?? inheritedLayout.pageConfig;");
|
|
49
|
+
// The ancestor root is its own level of the stack, so inheriting its loading would nest it inside itself.
|
|
50
|
+
expect(generatedSource).toContain("export const Loading = userLayout.Loading;");
|
|
49
51
|
expect(generatedSource).toContain(
|
|
50
52
|
"<UserLayout params={params} searchParams={searchParams}>{children}</UserLayout>",
|
|
51
53
|
);
|
|
@@ -201,6 +201,7 @@ async function writeGeneratedRootLayoutFile(opts: {
|
|
|
201
201
|
export const NotFound = userLayout.NotFound ?? inheritedLayout.NotFound;
|
|
202
202
|
export const Error = userLayout.Error ?? inheritedLayout.Error;
|
|
203
203
|
export const pageConfig = userLayout.pageConfig ?? inheritedLayout.pageConfig;
|
|
204
|
+
export const Loading = userLayout.Loading;
|
|
204
205
|
|
|
205
206
|
${layoutSignature}({ children, params, searchParams }: LayoutProps) {
|
|
206
207
|
${layoutBinding} return `;
|
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/mobile/nativeApp.test.ts
CHANGED
|
@@ -151,7 +151,7 @@ describe("NativeApp", () => {
|
|
|
151
151
|
|
|
152
152
|
describe("the public env a build inlined, recorded in its bundle.json", () => {
|
|
153
153
|
const publicEnv = { AKAN_PUBLIC_ENV: "main", AKAN_PUBLIC_SERVE_DOMAIN: "akamir.com" };
|
|
154
|
-
const building = async (inlined: Record<string, string>, updates:
|
|
154
|
+
const building = async (inlined: Record<string, string>, updates: AkanNativeTarget["updates"]) => {
|
|
155
155
|
const root = await makeTempRoot();
|
|
156
156
|
const warned: string[] = [];
|
|
157
157
|
const app = {
|
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.4",
|
|
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.4",
|
|
52
52
|
"chalk": "^5.6.2",
|
|
53
53
|
"commander": "^14.0.3",
|
|
54
54
|
"dayjs": "^1.11.20",
|