@podosoft/podokit 0.13.0 → 0.14.0
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/dist/add.d.ts +27 -1
- package/dist/add.js +3 -1
- package/dist/index.js +6 -3
- package/dist/lib.d.ts +1 -1
- package/dist/lockfile.d.ts +4 -1
- package/dist/lockfile.js +4 -3
- package/dist/module-migrations.d.ts +25 -0
- package/dist/module-migrations.js +233 -0
- package/dist/templates/fullstack-nest-svelte/Dockerfile.dev +3 -1
- package/dist/templates/fullstack-nest-svelte/apps/api/package.json +1 -1
- package/dist/templates/fullstack-nest-svelte/apps/web/Dockerfile +3 -0
- package/dist/templates/fullstack-nest-svelte/apps/web/package.json +1 -1
- package/dist/templates/fullstack-nest-svelte/apps/web/src/lib/components/ui/input/input.svelte +3 -1
- package/dist/templates/fullstack-nest-svelte/apps/web/src/routes/+page.svelte +5 -0
- package/dist/templates/fullstack-nest-svelte/compose.dev.yaml +6 -0
- package/dist/templates/fullstack-nest-svelte/dot-env.example +2 -0
- package/dist/templates/fullstack-nest-svelte/infra/k3s/configmap.yaml +1 -0
- package/dist/templates/modules/admin-dashboard/files/apps/api/src/profile-image/profile-image-upload.interceptor.ts +39 -0
- package/dist/templates/modules/admin-dashboard/files/apps/api/src/profile-image/profile-image.controller.ts +73 -0
- package/dist/templates/modules/admin-dashboard/files/apps/api/src/profile-image/profile-image.module.ts +9 -0
- package/dist/templates/modules/admin-dashboard/files/apps/api/src/profile-image/profile-image.service.spec.ts +43 -0
- package/dist/templates/modules/admin-dashboard/files/apps/api/src/profile-image/profile-image.service.ts +110 -0
- package/dist/templates/modules/admin-dashboard/files/apps/api/src/profile-image/profile-image.validation.spec.ts +79 -0
- package/dist/templates/modules/admin-dashboard/files/apps/api/src/profile-image/profile-image.validation.ts +74 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/admin/registry.svelte.ts +1 -1
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/account-page.svelte +155 -2
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/sidebar-user-menu.svelte +1 -1
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/i18n/catalogs/admin-dashboard/en.json +13 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/i18n/catalogs/admin-dashboard/ko.json +13 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/server/protected-layout.ts +78 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(admin)/+layout.server.ts +8 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/{(app) → (admin)}/+layout.svelte +2 -2
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/+layout.server.ts +2 -47
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/+page.svelte +4 -0
- package/dist/templates/modules/admin-dashboard/files/tests/api/profile-image.api.spec.ts +96 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/account.ui.spec.ts +64 -1
- package/dist/templates/modules/admin-dashboard/files/tests/ui/dashboard.ui.spec.ts +16 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/guards.ui.spec.ts +4 -7
- package/dist/templates/modules/admin-dashboard/files/tests/ui/settings-dialogs.ui.spec.ts +4 -1
- package/dist/templates/modules/admin-dashboard/module.manifest.json +74 -11
- package/dist/templates/modules/auth/files/apps/api/src/auth/auth.ts +5 -1
- package/dist/templates/modules/auth/files/apps/api/src/auth/user-delete-handlers.spec.ts +42 -0
- package/dist/templates/modules/auth/files/apps/api/src/auth/user-delete-handlers.ts +27 -0
- package/dist/templates/modules/auth/module.manifest.json +1 -1
- package/dist/templates/todo/Dockerfile.dev +3 -1
- package/dist/templates/todo/apps/api/package.json +1 -1
- package/dist/templates/todo/apps/web/package.json +1 -1
- package/dist/templates/todo/compose.dev.yaml +6 -0
- package/dist/update.d.ts +8 -1
- package/dist/update.js +68 -12
- package/package.json +1 -1
- /package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/{app-sidebar.svelte → admin-sidebar.svelte} +0 -0
- /package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/{(app) → (admin)}/admin/+page.svelte +0 -0
- /package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/{(app) → (admin)}/admin/account/+page.server.ts +0 -0
- /package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/{(app) → (admin)}/admin/account/+page.svelte +0 -0
- /package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/{(app) → (admin)}/admin/audit/+page.server.ts +0 -0
- /package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/{(app) → (admin)}/admin/audit/+page.svelte +0 -0
- /package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/{(app) → (admin)}/admin/organizations/+page.server.ts +0 -0
- /package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/{(app) → (admin)}/admin/organizations/+page.svelte +0 -0
- /package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/{(app) → (admin)}/admin/sessions/+page.server.ts +0 -0
- /package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/{(app) → (admin)}/admin/sessions/+page.svelte +0 -0
- /package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/{(app) → (admin)}/admin/settings/+page.server.ts +0 -0
- /package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/{(app) → (admin)}/admin/settings/+page.svelte +0 -0
- /package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/{(app) → (admin)}/admin/settings/general-settings.svelte +0 -0
- /package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/{(app) → (admin)}/admin/users/+page.server.ts +0 -0
- /package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/{(app) → (admin)}/admin/users/+page.svelte +0 -0
package/dist/update.js
CHANGED
|
@@ -12,6 +12,7 @@ const assemble_1 = require("./assemble");
|
|
|
12
12
|
const lockfile_1 = require("./lockfile");
|
|
13
13
|
const inspect_1 = require("./inspect");
|
|
14
14
|
const add_1 = require("./add");
|
|
15
|
+
const module_migrations_1 = require("./module-migrations");
|
|
15
16
|
function treeText(tree, path) {
|
|
16
17
|
const file = tree.get(path);
|
|
17
18
|
if (!file)
|
|
@@ -64,9 +65,29 @@ function planUpdate(projectRoot, templatesDir) {
|
|
|
64
65
|
});
|
|
65
66
|
const managedOverrides = targetManagedOverrides(projectRoot, templatesDir, manifest.modules, manifest.managedOverrides);
|
|
66
67
|
const ownedGlobs = targetOwnedGlobs(projectRoot, templatesDir, manifest.modules, manifest.ownedGlobs);
|
|
67
|
-
const
|
|
68
|
+
const pendingMigrations = (0, module_migrations_1.collectPendingMigrations)(projectRoot, templatesDir, manifest.modules);
|
|
69
|
+
const migrationPlan = (0, module_migrations_1.planModuleMigrations)(projectRoot, newTree, lock, pendingMigrations);
|
|
70
|
+
const changes = migrationPlan.moves.map((move) => ({
|
|
71
|
+
path: move.to,
|
|
72
|
+
fromPath: move.from,
|
|
73
|
+
tier: move.tier,
|
|
74
|
+
action: "move",
|
|
75
|
+
note: "module path migration",
|
|
76
|
+
}));
|
|
77
|
+
for (const conflict of migrationPlan.conflicts) {
|
|
78
|
+
changes.push({
|
|
79
|
+
path: "module migration",
|
|
80
|
+
tier: "managed",
|
|
81
|
+
action: "conflict",
|
|
82
|
+
note: conflict,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
const movedSources = new Set(migrationPlan.moves.map((move) => move.from));
|
|
86
|
+
const movedTargets = new Set(migrationPlan.moves.map((move) => move.to));
|
|
68
87
|
const paths = new Set([...newTree.keys(), ...Object.keys(lock.files)]);
|
|
69
88
|
for (const path of [...paths].sort()) {
|
|
89
|
+
if (movedSources.has(path) || movedTargets.has(path))
|
|
90
|
+
continue;
|
|
70
91
|
const locked = lock.files[path];
|
|
71
92
|
const newText = treeText(newTree, path);
|
|
72
93
|
const disk = diskContent(projectRoot, path);
|
|
@@ -232,6 +253,19 @@ function applyUpdate(projectRoot, templatesDir, options = {}) {
|
|
|
232
253
|
});
|
|
233
254
|
const managedOverrides = targetManagedOverrides(projectRoot, templatesDir, modules, manifest.managedOverrides);
|
|
234
255
|
const ownedGlobs = targetOwnedGlobs(projectRoot, templatesDir, modules, manifest.ownedGlobs);
|
|
256
|
+
const pendingMigrations = (0, module_migrations_1.collectPendingMigrations)(projectRoot, templatesDir, modules);
|
|
257
|
+
const migrationPlan = (0, module_migrations_1.planModuleMigrations)(projectRoot, newTree, previousLock, pendingMigrations);
|
|
258
|
+
if (migrationPlan.conflicts.length) {
|
|
259
|
+
throw new Error(`Cannot apply module path migration:\n${migrationPlan.conflicts
|
|
260
|
+
.map((conflict) => ` - ${conflict}`)
|
|
261
|
+
.join("\n")}`);
|
|
262
|
+
}
|
|
263
|
+
const migratedOwnedGlobs = [
|
|
264
|
+
...new Set(ownedGlobs.map((glob) => (0, module_migrations_1.migrateConfiguredPath)(glob, pendingMigrations))),
|
|
265
|
+
];
|
|
266
|
+
const migratedManagedOverrides = [
|
|
267
|
+
...new Set(managedOverrides.map((glob) => (0, module_migrations_1.migrateConfiguredPath)(glob, pendingMigrations))),
|
|
268
|
+
];
|
|
235
269
|
const needsMergeBase = plan.changes.some((change) => change.action === "conflict");
|
|
236
270
|
let oldTree = null;
|
|
237
271
|
if (options.oldTemplatesDir && needsMergeBase) {
|
|
@@ -250,7 +284,13 @@ function applyUpdate(projectRoot, templatesDir, options = {}) {
|
|
|
250
284
|
(0, node_fs_1.rmSync)(previousModules.root, { recursive: true, force: true });
|
|
251
285
|
}
|
|
252
286
|
}
|
|
253
|
-
const result = {
|
|
287
|
+
const result = {
|
|
288
|
+
written: [],
|
|
289
|
+
moved: (0, module_migrations_1.applyModuleMigrations)(projectRoot, migrationPlan),
|
|
290
|
+
removed: [],
|
|
291
|
+
merged: [],
|
|
292
|
+
conflicts: [],
|
|
293
|
+
};
|
|
254
294
|
for (const change of plan.changes) {
|
|
255
295
|
const newText = treeText(newTree, change.path);
|
|
256
296
|
if (change.action === "update" || change.action === "add") {
|
|
@@ -280,22 +320,37 @@ function applyUpdate(projectRoot, templatesDir, options = {}) {
|
|
|
280
320
|
// Keep the assembled target as the managed baseline. A merged working file
|
|
281
321
|
// intentionally remains drifted so a future update performs another 3-way
|
|
282
322
|
// merge instead of treating the user's lines as clean generated output.
|
|
283
|
-
(0, lockfile_1.writeFilesLock)(projectRoot, updatedFilesLock(projectRoot, newTree, previousLock,
|
|
323
|
+
(0, lockfile_1.writeFilesLock)(projectRoot, updatedFilesLock(projectRoot, newTree, previousLock, migratedOwnedGlobs, migratedManagedOverrides));
|
|
284
324
|
const modulesDir = (0, node_path_1.join)(templatesDir, "modules");
|
|
325
|
+
const appliedMigrations = new Map();
|
|
326
|
+
for (const pending of pendingMigrations) {
|
|
327
|
+
const ids = appliedMigrations.get(pending.module) ?? [];
|
|
328
|
+
ids.push(pending.migration.id);
|
|
329
|
+
appliedMigrations.set(pending.module, ids);
|
|
330
|
+
}
|
|
285
331
|
const refreshedModules = manifest.modules.map((module) => {
|
|
286
332
|
const resolved = (0, add_1.resolveModule)(module.packageName ?? module.name, modulesDir, projectRoot);
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
...module,
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
333
|
+
const applied = [
|
|
334
|
+
...new Set([
|
|
335
|
+
...(module.appliedMigrations ?? []),
|
|
336
|
+
...(appliedMigrations.get(module.name) ?? []),
|
|
337
|
+
]),
|
|
338
|
+
];
|
|
339
|
+
return {
|
|
340
|
+
...module,
|
|
341
|
+
...(resolved?.packageName
|
|
342
|
+
? {
|
|
343
|
+
packageName: resolved.packageName,
|
|
344
|
+
moduleVersion: resolved.moduleVersion,
|
|
345
|
+
}
|
|
346
|
+
: {}),
|
|
347
|
+
...(applied.length ? { appliedMigrations: applied } : {}),
|
|
348
|
+
};
|
|
294
349
|
});
|
|
295
350
|
(0, lockfile_1.writeManifest)(projectRoot, {
|
|
296
351
|
...manifest,
|
|
297
|
-
ownedGlobs,
|
|
298
|
-
managedOverrides,
|
|
352
|
+
ownedGlobs: migratedOwnedGlobs,
|
|
353
|
+
managedOverrides: migratedManagedOverrides,
|
|
299
354
|
modules: refreshedModules,
|
|
300
355
|
podokitVersion: (0, lockfile_1.podokitVersion)(),
|
|
301
356
|
});
|
|
@@ -308,6 +363,7 @@ function summarize(plan) {
|
|
|
308
363
|
merge: 0,
|
|
309
364
|
conflict: 0,
|
|
310
365
|
add: 0,
|
|
366
|
+
move: 0,
|
|
311
367
|
remove: 0,
|
|
312
368
|
skip: 0,
|
|
313
369
|
"up-to-date": 0,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@podosoft/podokit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "An opinionated but extensible starter toolkit and CLI for full-stack TypeScript apps with NestJS, SvelteKit, TailwindCSS, shadcn-svelte, Docker, and k3s.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|