@stacksjs/actions 0.70.256 → 0.70.258
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/deploy/index.js +6 -4
- package/dist/generate/index.d.ts +3 -0
- package/dist/generate/index.js +1 -0
- package/dist/generate/vschema.d.ts +9 -0
- package/dist/generate/vschema.js +47 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -0
- package/dist/lint/stx-gate.d.ts +36 -0
- package/dist/lint/stx-gate.js +175 -0
- package/dist/migrate/fresh.js +7 -1
- package/package.json +19 -19
package/dist/deploy/index.js
CHANGED
|
@@ -523,13 +523,15 @@ Set AWS_ACCOUNT_ID in your .env file or ensure valid AWS credentials are configu
|
|
|
523
523
|
if (isVerbose)
|
|
524
524
|
log.debug(`Migration error: ${migrationError.stack}`);
|
|
525
525
|
}
|
|
526
|
-
const frameworkTablesSpinner = spinner("Ensuring framework tables (auth, notifications, RBAC)...");
|
|
526
|
+
const frameworkTablesSpinner = spinner("Ensuring framework tables (auth, notifications, RBAC, traits)...");
|
|
527
527
|
frameworkTablesSpinner.start();
|
|
528
528
|
try {
|
|
529
|
-
const { migrateAuthTables, migrateNotificationTables, migrateRbacTables } = await import("@stacksjs/database"), failures = [], steps = [
|
|
529
|
+
const { ensureUtcDatetimeColumns, migrateAuthTables, migrateNotificationTables, migrateRbacTables, migrateTraitTables } = await import("@stacksjs/database"), failures = [], steps = [
|
|
530
530
|
["auth", migrateAuthTables],
|
|
531
531
|
["notification", migrateNotificationTables],
|
|
532
|
-
["RBAC", migrateRbacTables]
|
|
532
|
+
["RBAC", migrateRbacTables],
|
|
533
|
+
["trait", migrateTraitTables],
|
|
534
|
+
["utc-datetime", ensureUtcDatetimeColumns]
|
|
533
535
|
];
|
|
534
536
|
for (const [name, migrateTables] of steps) {
|
|
535
537
|
const result = await migrateTables({ verbose: isVerbose });
|
|
@@ -540,7 +542,7 @@ Set AWS_ACCOUNT_ID in your .env file or ensure valid AWS credentials are configu
|
|
|
540
542
|
frameworkTablesSpinner.stop();
|
|
541
543
|
console.log(`\u26A0 Some framework tables could not be migrated: ${failures.join("; ")}`);
|
|
542
544
|
} else
|
|
543
|
-
frameworkTablesSpinner.succeed("Framework tables ensured (auth, notifications, RBAC)");
|
|
545
|
+
frameworkTablesSpinner.succeed("Framework tables ensured (auth, notifications, RBAC, traits)");
|
|
544
546
|
} catch (frameworkTablesError) {
|
|
545
547
|
frameworkTablesSpinner.stop();
|
|
546
548
|
console.log(`\u26A0 Framework table migrations skipped: ${frameworkTablesError.message}`);
|
package/dist/generate/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { generateProjectImages } from './images';
|
|
2
2
|
import type { GeneratorOptions } from '@stacksjs/types';
|
|
3
3
|
export type { GenerateImagesActionOptions } from './images';
|
|
4
|
+
export type { GenerateVSchemaOptions, GenerateVSchemaResult } from './vschema';
|
|
4
5
|
// import { files } from '@stacksjs/storage'
|
|
5
6
|
export declare function invoke(options?: GeneratorOptions): Promise<void>;
|
|
6
7
|
export declare function generate(options: GeneratorOptions): Promise<void>;
|
|
@@ -45,3 +46,5 @@ export declare function generateSeeder(): Promise<void>;
|
|
|
45
46
|
export declare function generateCoreSymlink(): Promise<void>;
|
|
46
47
|
export declare function generateOpenApiSpec(): Promise<void>;
|
|
47
48
|
export { generateProjectImages } from './images';
|
|
49
|
+
// Vitess keyspace VSchema, derived from the model relationship graph.
|
|
50
|
+
export { generateVSchema } from './vschema';
|
package/dist/generate/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { runAction } from "../helpers";
|
|
|
10
10
|
import { generateVsCodeCustomData as genVsCodeCustomData } from "../helpers/vscode-custom-data";
|
|
11
11
|
import { generateProjectImages } from "./images";
|
|
12
12
|
export { generateProjectImages } from "./images";
|
|
13
|
+
export { generateVSchema } from "./vschema";
|
|
13
14
|
export async function invoke(options) {
|
|
14
15
|
if (options?.types)
|
|
15
16
|
await generateTypes(options);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { path } from '@stacksjs/path';
|
|
2
|
+
import type { VSchema } from '@stacksjs/database';
|
|
3
|
+
export declare function generateVSchema(options?: GenerateVSchemaOptions): Promise<GenerateVSchemaResult>;
|
|
4
|
+
export declare interface GenerateVSchemaOptions {
|
|
5
|
+
dryRun?: boolean
|
|
6
|
+
out?: string
|
|
7
|
+
}
|
|
8
|
+
export type GenerateVSchemaResult = | { ok: false, error: string }
|
|
9
|
+
| { ok: true, vschema: VSchema, report: string, path: string, tableCount: number }
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { dirname } from "node:path";
|
|
2
|
+
import { deriveVSchema, formatShardingReport, resolveModelSources, toShardableModel } from "@stacksjs/database";
|
|
3
|
+
import { log } from "@stacksjs/logging";
|
|
4
|
+
import { path } from "@stacksjs/path";
|
|
5
|
+
import { fs } from "@stacksjs/storage";
|
|
6
|
+
function tableNameFor(definition, fileName) {
|
|
7
|
+
if (definition?.table)
|
|
8
|
+
return definition.table;
|
|
9
|
+
const snake = (definition?.name ?? fileName).replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase();
|
|
10
|
+
if (/(?:s|x|z|ch|sh)$/.test(snake))
|
|
11
|
+
return `${snake}es`;
|
|
12
|
+
if (/[^aeiou]y$/.test(snake))
|
|
13
|
+
return `${snake.slice(0, -1)}ies`;
|
|
14
|
+
return `${snake}s`;
|
|
15
|
+
}
|
|
16
|
+
export async function generateVSchema(options = {}) {
|
|
17
|
+
const sources = resolveModelSources();
|
|
18
|
+
if (!sources || sources.models.length === 0)
|
|
19
|
+
return { ok: !1, error: "No models found. A VSchema is derived from your models, so there is nothing to generate." };
|
|
20
|
+
const models = [], failed = [];
|
|
21
|
+
for (const source of sources.models)
|
|
22
|
+
try {
|
|
23
|
+
const definition = (await import(source.file)).default;
|
|
24
|
+
if (!definition)
|
|
25
|
+
continue;
|
|
26
|
+
models.push(toShardableModel(definition, tableNameFor(definition, source.name)));
|
|
27
|
+
} catch (error) {
|
|
28
|
+
failed.push(`${source.name}: ${error.message}`);
|
|
29
|
+
}
|
|
30
|
+
for (const failure of failed)
|
|
31
|
+
log.warn(`[generate:vschema] skipped ${failure}`);
|
|
32
|
+
if (models.length === 0)
|
|
33
|
+
return { ok: !1, error: "Every model failed to load; nothing to derive a VSchema from." };
|
|
34
|
+
const { vschema, decisions } = deriveVSchema(models), report = formatShardingReport(decisions), outPath = path.projectPath(options.out ?? "database/vschema.json");
|
|
35
|
+
if (!options.dryRun) {
|
|
36
|
+
fs.mkdirSync(dirname(outPath), { recursive: !0 });
|
|
37
|
+
await Bun.write(outPath, `${JSON.stringify(vschema, null, 2)}
|
|
38
|
+
`);
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
ok: !0,
|
|
42
|
+
vschema,
|
|
43
|
+
report,
|
|
44
|
+
path: outPath,
|
|
45
|
+
tableCount: Object.keys(vschema.tables).length
|
|
46
|
+
};
|
|
47
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type { StxLintConfig, StxLintReport, StxLintResult } from './lint/stx-gate';
|
|
1
2
|
export type { CrudField } from './scaffold-crud';
|
|
2
3
|
export type { DiscoveredPackagesManifest, PackageStacksMeta } from './discover-packages';
|
|
3
4
|
export * from './action';
|
|
@@ -24,6 +25,9 @@ export * from './helpers/index';
|
|
|
24
25
|
// spawning a deep dist path. Exported from ./lint/lint — the pure module — so
|
|
25
26
|
// importing the barrel never pulls the process-exiting ./lint/index script.
|
|
26
27
|
export { formatProject, lintFix, lintProject } from './lint/lint';
|
|
28
|
+
// stx conformance checks behind `buddy lint --stx`. Pure - returns a report
|
|
29
|
+
// and never exits, so the command owns rendering and the exit code.
|
|
30
|
+
export { DEFAULT_STX_LINT_CONFIG, loadStxLintConfig, runStxLint } from './lint/stx-gate';
|
|
27
31
|
export * from './setup/index';
|
|
28
32
|
// makeFactory,
|
|
29
33
|
export {
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export * from "./dev";
|
|
|
13
13
|
export * from "./generate";
|
|
14
14
|
export * from "./helpers";
|
|
15
15
|
export { formatProject, lintFix, lintProject } from "./lint/lint";
|
|
16
|
+
export { DEFAULT_STX_LINT_CONFIG, loadStxLintConfig, runStxLint } from "./lint/stx-gate";
|
|
16
17
|
export * from "./setup";
|
|
17
18
|
export {
|
|
18
19
|
createComponent,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Read `config/lint.ts`, falling back to defaults when a project has none. */
|
|
2
|
+
export declare function loadStxLintConfig(root: string): Promise<StxLintConfig>;
|
|
3
|
+
/**
|
|
4
|
+
* Run every check and report.
|
|
5
|
+
*
|
|
6
|
+
* `status` is `fail` when a count sits above its baseline, `loosened` when it
|
|
7
|
+
* sits below one (real progress, but the baseline is now stale), `pass` when
|
|
8
|
+
* they match.
|
|
9
|
+
*/
|
|
10
|
+
export declare function runStxLint(options?: { root?: string, config?: StxLintConfig }): Promise<StxLintReport>;
|
|
11
|
+
export declare const DEFAULT_STX_LINT_CONFIG: StxLintConfig;
|
|
12
|
+
export declare interface StxLintConfig {
|
|
13
|
+
stxGlob: string
|
|
14
|
+
distGlob: string
|
|
15
|
+
baselines: Record<string, number>
|
|
16
|
+
doctypeExempt: string[]
|
|
17
|
+
styleExempt: string[]
|
|
18
|
+
staleRules: Record<string, boolean>
|
|
19
|
+
}
|
|
20
|
+
export declare interface StxLintResult {
|
|
21
|
+
id: string
|
|
22
|
+
label: string
|
|
23
|
+
why?: string
|
|
24
|
+
count: number
|
|
25
|
+
baseline: number
|
|
26
|
+
detail: string[]
|
|
27
|
+
status: 'pass' | 'fail' | 'loosened'
|
|
28
|
+
}
|
|
29
|
+
export declare interface StxLintReport {
|
|
30
|
+
root: string
|
|
31
|
+
results: StxLintResult[]
|
|
32
|
+
distMissing: boolean
|
|
33
|
+
failed: number
|
|
34
|
+
loosened: number
|
|
35
|
+
counts: Record<string, number>
|
|
36
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import process from "node:process";
|
|
4
|
+
import { Glob } from "bun";
|
|
5
|
+
export const DEFAULT_STX_LINT_CONFIG = {
|
|
6
|
+
stxGlob: "resources/**/*.stx",
|
|
7
|
+
distGlob: "dist/**/*.html",
|
|
8
|
+
baselines: {},
|
|
9
|
+
doctypeExempt: [],
|
|
10
|
+
styleExempt: ["resources/emails/"],
|
|
11
|
+
staleRules: {}
|
|
12
|
+
};
|
|
13
|
+
const REQUIRED_STX_CONFIG_KEYS = [
|
|
14
|
+
["strict", "DOM guard (ch. 12.1) - without it script-validation discards every finding"],
|
|
15
|
+
["root", "pins project topology; absent, resolveStxRoot sniffs it and double-prefixes dirs"],
|
|
16
|
+
["pagesDir", 'must accompany root - resolveStxRoot falls back to a non-existent "pages"']
|
|
17
|
+
];
|
|
18
|
+
export async function loadStxLintConfig(root) {
|
|
19
|
+
const found = ["config/lint.ts", "config/lint.js"].find((c) => existsSync(join(root, c)));
|
|
20
|
+
if (!found)
|
|
21
|
+
return { ...DEFAULT_STX_LINT_CONFIG };
|
|
22
|
+
try {
|
|
23
|
+
const stx = (await import(join(root, found))).default?.stx ?? {};
|
|
24
|
+
return {
|
|
25
|
+
...DEFAULT_STX_LINT_CONFIG,
|
|
26
|
+
...stx,
|
|
27
|
+
baselines: { ...stx.baselines },
|
|
28
|
+
styleExempt: stx.styleExempt ?? DEFAULT_STX_LINT_CONFIG.styleExempt,
|
|
29
|
+
doctypeExempt: stx.doctypeExempt ?? [],
|
|
30
|
+
staleRules: stx.staleRules ?? {}
|
|
31
|
+
};
|
|
32
|
+
} catch (error) {
|
|
33
|
+
throw Error(`Could not read ${found}: ${error.message}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async function scanGlob(pattern, root) {
|
|
37
|
+
const out = [];
|
|
38
|
+
try {
|
|
39
|
+
for await (const f of new Glob(pattern).scan(root))
|
|
40
|
+
out.push(f);
|
|
41
|
+
} catch {}
|
|
42
|
+
return out.sort();
|
|
43
|
+
}
|
|
44
|
+
const ROUTED_ANCHOR = /\bdata-stx-link\b|\bdata-no-router\b/;
|
|
45
|
+
async function grepLines(re, files, root, ignore) {
|
|
46
|
+
const hits = [];
|
|
47
|
+
for (const f of files) {
|
|
48
|
+
let src = "";
|
|
49
|
+
try {
|
|
50
|
+
src = await Bun.file(join(root, f)).text();
|
|
51
|
+
} catch {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
src.split(`
|
|
55
|
+
`).forEach((line, i) => {
|
|
56
|
+
re.lastIndex = 0;
|
|
57
|
+
if (!re.test(line))
|
|
58
|
+
return;
|
|
59
|
+
if (ignore) {
|
|
60
|
+
ignore.lastIndex = 0;
|
|
61
|
+
if (ignore.test(line))
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
hits.push(`${f}:${i + 1} ${line.trim().slice(0, 90)}`);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return hits;
|
|
68
|
+
}
|
|
69
|
+
async function scanSources(files, root, config) {
|
|
70
|
+
const { lintStxStrict } = await import("@stacksjs/stx"), { PROHIBITED_DOM_PATTERNS } = await import("@stacksjs/stx/script-validation"), { scanScriptTags } = await import("@stacksjs/stx/signal-processing"), domPatterns = PROHIBITED_DOM_PATTERNS, scan = { domGuard: [], strictLint: [], balance: [], commentLandmine: [], doctype: [] };
|
|
71
|
+
for (const f of files) {
|
|
72
|
+
let src = "";
|
|
73
|
+
try {
|
|
74
|
+
src = await Bun.file(join(root, f)).text();
|
|
75
|
+
} catch {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
for (const d of lintStxStrict(src, { filePath: f, rules: config.staleRules }) ?? [])
|
|
79
|
+
scan.strictLint.push(`${f}:${d.line}:${d.column} ${d.ruleId} ${d.message}`);
|
|
80
|
+
for (const s of scanScriptTags(src, { skipAttrs: /\bserver\b|\bsrc\s*=/ }))
|
|
81
|
+
for (const { pattern, message, suggestion } of domPatterns) {
|
|
82
|
+
pattern.lastIndex = 0;
|
|
83
|
+
const m = s.body.match(pattern);
|
|
84
|
+
if (m)
|
|
85
|
+
scan.domGuard.push(`${f} ${message} x${m.length} -> ${suggestion}`);
|
|
86
|
+
}
|
|
87
|
+
const open = (src.match(/<script\b/gi) ?? []).length, close = (src.match(/<\/script\s*>/gi) ?? []).length;
|
|
88
|
+
if (open !== close)
|
|
89
|
+
scan.balance.push(`${f} ${open} <script> vs ${close} </script> - a "</script" sits inside a script body`);
|
|
90
|
+
for (const m of src.matchAll(/<!--([\s\S]*?)-->/g))
|
|
91
|
+
if (/<\/?html\b|<!DOCTYPE\b|<\/?script\b/i.test(m[1] ?? "")) {
|
|
92
|
+
const line = src.slice(0, m.index).split(`
|
|
93
|
+
`).length;
|
|
94
|
+
scan.commentLandmine.push(`${f}:${line} banned token inside <!-- -->`);
|
|
95
|
+
}
|
|
96
|
+
const exempt = config.doctypeExempt.some((p) => f.startsWith(p) || f === p);
|
|
97
|
+
if (/<!DOCTYPE\s/i.test(src) && !/@nolayout\b/.test(src) && !exempt)
|
|
98
|
+
scan.doctype.push(`${f} <!DOCTYPE> with no @nolayout - layout resolution is silently skipped`);
|
|
99
|
+
}
|
|
100
|
+
return scan;
|
|
101
|
+
}
|
|
102
|
+
async function missingStxConfigKeys(root) {
|
|
103
|
+
const found = ["config/ui.ts", "config/ui.js"].find((c) => existsSync(join(root, c)));
|
|
104
|
+
if (!found)
|
|
105
|
+
return [];
|
|
106
|
+
let ui;
|
|
107
|
+
try {
|
|
108
|
+
ui = (await import(join(root, found))).default ?? {};
|
|
109
|
+
} catch {
|
|
110
|
+
return [];
|
|
111
|
+
}
|
|
112
|
+
return REQUIRED_STX_CONFIG_KEYS.filter(([key]) => ui[key] == null).map(([key, why]) => `${found} is missing "${key}" - ${why}`);
|
|
113
|
+
}
|
|
114
|
+
export async function runStxLint(options = {}) {
|
|
115
|
+
const root = options.root ?? process.cwd(), config = options.config ?? await loadStxLintConfig(root), stxAll = await scanGlob(config.stxGlob, root), dist = await scanGlob(config.distGlob, root), styled = stxAll.filter((f) => !config.styleExempt.some((p) => f.startsWith(p))), scan = await scanSources(stxAll, root, config), configErrors = await missingStxConfigKeys(root), definitions = [
|
|
116
|
+
{
|
|
117
|
+
id: "stx-config-keys",
|
|
118
|
+
label: "stx config sets every key the standards require",
|
|
119
|
+
why: "pinning root/pagesDir changes topology resolution, so it is a deliberate move",
|
|
120
|
+
detail: () => configErrors
|
|
121
|
+
},
|
|
122
|
+
{ id: "style-block", label: "no <style> block in a .stx file (rule 11.1)", detail: () => grepLines(/<style/, stxAll, root) },
|
|
123
|
+
{ id: "doctype-no-nolayout", label: "no <!DOCTYPE> outside the exempt list (rule 2.2)", detail: () => scan.doctype },
|
|
124
|
+
{ id: "script-tag-balance", label: 'no "</script" inside a script body', detail: () => scan.balance },
|
|
125
|
+
{ id: "comment-landmine", label: "no html/DOCTYPE/script token inside an HTML comment", detail: () => scan.commentLandmine },
|
|
126
|
+
{ id: "strict-lint", label: "stx's own strict linter", detail: () => scan.strictLint },
|
|
127
|
+
{
|
|
128
|
+
id: "dom-guard",
|
|
129
|
+
label: "prohibited DOM access in client scripts",
|
|
130
|
+
why: "imperative views clear these as they move to signals",
|
|
131
|
+
detail: () => scan.domGuard
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
id: "inline-style-attr",
|
|
135
|
+
label: 'no style="" attribute (rule 11.5)',
|
|
136
|
+
why: "pre-hydration display:none; the sanctioned form is a :class with literal branches",
|
|
137
|
+
detail: () => grepLines(/style="/, styled, root)
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: "plain-internal-anchor",
|
|
141
|
+
label: 'no unrouted internal <a href="/"> (rule 9 - use StxLink)',
|
|
142
|
+
why: "converting marketing pages is usually its own pass",
|
|
143
|
+
detail: () => grepLines(/<a [^>]*href="\//, styled, root, ROUTED_ANCHOR)
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: "unmanaged-timer",
|
|
147
|
+
label: "no bare setTimeout/setInterval (rule 6.7)",
|
|
148
|
+
why: "useTimeout()/useDebounce() unsubscribe on destroy; bare timers outlive the SPA swap",
|
|
149
|
+
detail: () => grepLines(/(^|[^.\w])(setTimeout|setInterval)\s*\(/, stxAll, root)
|
|
150
|
+
},
|
|
151
|
+
{ id: "dist-component-error", label: "no unresolved component in built HTML", detail: () => grepLines(/Error loading component/, dist, root) },
|
|
152
|
+
{ id: "dist-path-leak", label: "no absolute filesystem path in built HTML", detail: () => grepLines(/\/(Users|home)\/[a-z]/i, dist, root) },
|
|
153
|
+
{ id: "dist-layout-published", label: "no layout emitted as a public page", detail: () => dist.filter((f) => f.startsWith("layouts/") || f.includes("/layouts/")) }
|
|
154
|
+
], results = [];
|
|
155
|
+
for (const def of definitions) {
|
|
156
|
+
const detail = await def.detail(), count = detail.length, baseline = config.baselines[def.id] ?? 0;
|
|
157
|
+
results.push({
|
|
158
|
+
id: def.id,
|
|
159
|
+
label: def.label,
|
|
160
|
+
why: def.why,
|
|
161
|
+
count,
|
|
162
|
+
baseline,
|
|
163
|
+
detail,
|
|
164
|
+
status: count > baseline ? "fail" : count < baseline ? "loosened" : "pass"
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
root,
|
|
169
|
+
results,
|
|
170
|
+
distMissing: dist.length === 0,
|
|
171
|
+
failed: results.filter((r) => r.status === "fail").length,
|
|
172
|
+
loosened: results.filter((r) => r.status === "loosened").length,
|
|
173
|
+
counts: Object.fromEntries(results.map((r) => [r.id, r.count]))
|
|
174
|
+
};
|
|
175
|
+
}
|
package/dist/migrate/fresh.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import process from "node:process";
|
|
2
|
-
import { generateMigrations, migrateAuthTables, migrateNotificationTables, migrateRbacTables, resetDatabase, runDatabaseMigration } from "@stacksjs/database";
|
|
2
|
+
import { ensureUtcDatetimeColumns, generateMigrations, migrateAuthTables, migrateNotificationTables, migrateRbacTables, migrateTraitTables, resetDatabase, runDatabaseMigration } from "@stacksjs/database";
|
|
3
3
|
import { log } from "@stacksjs/logging";
|
|
4
4
|
const resetResult = await resetDatabase();
|
|
5
5
|
if (resetResult?.isErr) {
|
|
@@ -22,6 +22,12 @@ if (!notifResult.success)
|
|
|
22
22
|
const rbacResult = await migrateRbacTables();
|
|
23
23
|
if (!rbacResult.success)
|
|
24
24
|
log.error(`Failed to migrate RBAC tables: ${rbacResult.error}`);
|
|
25
|
+
const traitResult = await migrateTraitTables();
|
|
26
|
+
if (!traitResult.success)
|
|
27
|
+
log.error(`Failed to migrate polymorphic trait tables: ${traitResult.error}`);
|
|
28
|
+
const datetimeResult = await ensureUtcDatetimeColumns();
|
|
29
|
+
if (!datetimeResult.success)
|
|
30
|
+
log.error(`Failed to convert TIMESTAMP columns to DATETIME: ${datetimeResult.error}`);
|
|
25
31
|
if (migrateResult.isErr) {
|
|
26
32
|
log.error("runDatabaseMigration failed");
|
|
27
33
|
log.error(migrateResult.error);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/actions",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.70.
|
|
5
|
+
"version": "0.70.258",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -59,33 +59,33 @@
|
|
|
59
59
|
"prepublishOnly": "bun run build"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@stacksjs/config": "0.70.
|
|
62
|
+
"@stacksjs/config": "0.70.258",
|
|
63
63
|
"@stacksjs/bumpx": "^0.2.6",
|
|
64
64
|
"@stacksjs/bunpress": "^0.1.18",
|
|
65
65
|
"@stacksjs/logsmith": "^0.2.3",
|
|
66
|
-
"@stacksjs/registry": "0.70.
|
|
66
|
+
"@stacksjs/registry": "0.70.258",
|
|
67
67
|
"@stacksjs/stx": "^0.2.148",
|
|
68
|
-
"@stacksjs/ts-cloud": "^0.7.
|
|
68
|
+
"@stacksjs/ts-cloud": "^0.7.94",
|
|
69
69
|
"@stacksjs/ts-md": "^0.1.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@stacksjs/api": "0.70.
|
|
73
|
-
"@stacksjs/cli": "0.70.
|
|
74
|
-
"@stacksjs/database": "0.70.
|
|
72
|
+
"@stacksjs/api": "0.70.258",
|
|
73
|
+
"@stacksjs/cli": "0.70.258",
|
|
74
|
+
"@stacksjs/database": "0.70.258",
|
|
75
75
|
"@stacksjs/tlsx": "^0.13.2",
|
|
76
76
|
"better-dx": "^0.2.17",
|
|
77
|
-
"@stacksjs/dns": "0.70.
|
|
78
|
-
"@stacksjs/enums": "0.70.
|
|
79
|
-
"@stacksjs/env": "0.70.
|
|
80
|
-
"@stacksjs/error-handling": "0.70.
|
|
81
|
-
"@stacksjs/image": "0.70.
|
|
82
|
-
"@stacksjs/logging": "0.70.
|
|
83
|
-
"@stacksjs/path": "0.70.
|
|
84
|
-
"@stacksjs/security": "0.70.
|
|
85
|
-
"@stacksjs/storage": "0.70.
|
|
86
|
-
"@stacksjs/strings": "0.70.
|
|
87
|
-
"@stacksjs/utils": "0.70.
|
|
88
|
-
"@stacksjs/validation": "0.70.
|
|
77
|
+
"@stacksjs/dns": "0.70.258",
|
|
78
|
+
"@stacksjs/enums": "0.70.258",
|
|
79
|
+
"@stacksjs/env": "0.70.258",
|
|
80
|
+
"@stacksjs/error-handling": "0.70.258",
|
|
81
|
+
"@stacksjs/image": "0.70.258",
|
|
82
|
+
"@stacksjs/logging": "0.70.258",
|
|
83
|
+
"@stacksjs/path": "0.70.258",
|
|
84
|
+
"@stacksjs/security": "0.70.258",
|
|
85
|
+
"@stacksjs/storage": "0.70.258",
|
|
86
|
+
"@stacksjs/strings": "0.70.258",
|
|
87
|
+
"@stacksjs/utils": "0.70.258",
|
|
88
|
+
"@stacksjs/validation": "0.70.258"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"pickier": "^0.1.35"
|