create-nexwire 4.1.2 → 4.2.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/express/gitignore-stub +31 -24
- package/express/package.json +2 -2
- package/express/src/database/migrations/sqlite/meta/0000_snapshot.json +411 -411
- package/express/src/database/migrations/sqlite/meta/_journal.json +12 -12
- package/express/src/framework/maker-cli/db/index.mjs +1 -1
- package/express/src/framework/maker-cli/deploy/core.mjs +0 -1
- package/express/src/framework/maker-cli/index.mjs +13 -3
- package/express/src/framework/maker-cli/module/core.mjs +121 -43
- package/express/src/framework/maker-cli/runtime/core.mjs +26 -7
- package/express/src/framework/maker-cli/runtime/index.mjs +120 -104
- package/express/src/framework/maker-cli/stubs/controller/openapi.ts.stub +6 -6
- package/express/src/framework/maker-cli/stubs/controller/plain.ts.stub +6 -6
- package/express/src/framework/maker-cli/stubs/helper/name.ts.stub +1 -1
- package/express/src/framework/maker-cli/stubs/seeder/name.ts.stub +17 -19
- package/express/src/framework/maker-cli/stubs/seeder/standalone.ts.stub +22 -0
- package/express/src/framework/maker-cli/stubs/service/name.plain.ts.stub +2 -2
- package/express/src/framework/maker-cli/stubs/service/name.ts.stub +1 -1
- package/express/src/framework/maker-cli/utils/help.mjs +374 -50
- package/express/src/framework/maker-cli/utils/naming.mjs +83 -20
- package/express/src/framework/maker-cli/utils/project-commands.mjs +140 -0
- package/express/src/framework/queue/queue.ts +402 -342
- package/express/src/modules/auth/database/seeders/role.ts +18 -18
- package/express/src/modules/auth/database/seeders/user.ts +35 -35
- package/express/vitest.config.ts +38 -23
- package/hono/gitignore-stub +31 -24
- package/hono/package.json +2 -2
- package/hono/src/database/migrations/sqlite/meta/0000_snapshot.json +411 -411
- package/hono/src/database/migrations/sqlite/meta/_journal.json +12 -12
- package/hono/src/framework/database/paginate.ts +253 -253
- package/hono/src/framework/maker-cli/db/index.mjs +1 -1
- package/hono/src/framework/maker-cli/deploy/core.mjs +0 -1
- package/hono/src/framework/maker-cli/index.mjs +13 -3
- package/hono/src/framework/maker-cli/module/core.mjs +116 -38
- package/hono/src/framework/maker-cli/runtime/core.mjs +24 -6
- package/hono/src/framework/maker-cli/runtime/index.mjs +120 -104
- package/hono/src/framework/maker-cli/stubs/controller/openapi.ts.stub +6 -6
- package/hono/src/framework/maker-cli/stubs/controller/plain.ts.stub +6 -6
- package/hono/src/framework/maker-cli/stubs/helper/name.ts.stub +1 -1
- package/hono/src/framework/maker-cli/stubs/seeder/name.ts.stub +17 -19
- package/hono/src/framework/maker-cli/stubs/seeder/standalone.ts.stub +22 -0
- package/hono/src/framework/maker-cli/stubs/service/name.plain.ts.stub +2 -2
- package/hono/src/framework/maker-cli/stubs/service/name.ts.stub +1 -1
- package/hono/src/framework/maker-cli/utils/help.mjs +374 -50
- package/hono/src/framework/maker-cli/utils/naming.mjs +83 -20
- package/hono/src/framework/maker-cli/utils/project-commands.mjs +140 -0
- package/hono/src/framework/queue/queue.ts +402 -342
- package/hono/src/modules/auth/database/seeders/role.ts +18 -18
- package/hono/src/modules/auth/database/seeders/user.ts +35 -35
- package/hono/vitest.config.ts +38 -23
- package/package.json +1 -1
- package/express/src/framework/maker-cli/stubs/controller/openapi.with-model.ts.stub +0 -73
- package/hono/src/framework/maker-cli/stubs/controller/openapi.with-model.ts.stub +0 -69
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { eq } from "drizzle-orm";
|
|
2
|
-
import { db } from "@/framework/facade.js";
|
|
3
|
-
import { roles } from "@/modules/auth/database/models/role.js";
|
|
4
|
-
|
|
5
|
-
export const table = roles;
|
|
6
|
-
|
|
7
|
-
export default async function RoleSeeder() {
|
|
8
|
-
const rows = [{ name: "admin" }, { name: "user" }];
|
|
9
|
-
|
|
10
|
-
for (const row of rows) {
|
|
11
|
-
const existing = await db.query.roles.findFirst({ where: eq(roles.name, row.name) });
|
|
12
|
-
if (!existing) {
|
|
13
|
-
await db.insert(roles).values({ name: row.name });
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
console.log("Role seeder completed");
|
|
18
|
-
}
|
|
1
|
+
import { eq } from "drizzle-orm";
|
|
2
|
+
import { db } from "@/framework/facade.js";
|
|
3
|
+
import { roles } from "@/modules/auth/database/models/role.js";
|
|
4
|
+
|
|
5
|
+
export const table = roles;
|
|
6
|
+
|
|
7
|
+
export default async function RoleSeeder() {
|
|
8
|
+
const rows = [{ name: "admin" }, { name: "user" }];
|
|
9
|
+
|
|
10
|
+
for (const row of rows) {
|
|
11
|
+
const existing = await db.query.roles.findFirst({ where: eq(roles.name, row.name) });
|
|
12
|
+
if (!existing) {
|
|
13
|
+
await db.insert(roles).values({ name: row.name });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
console.log("Role seeder completed");
|
|
18
|
+
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { eq } from "drizzle-orm";
|
|
2
|
-
import { db, password } from "@/framework/facade.js";
|
|
3
|
-
import { roles } from "@/modules/auth/database/models/role.js";
|
|
4
|
-
import { users } from "@/modules/auth/database/models/user.js";
|
|
5
|
-
|
|
6
|
-
export const table = users;
|
|
7
|
-
|
|
8
|
-
export default async function UserSeeder() {
|
|
9
|
-
const adminRole = await db.query.roles.findFirst({ where: eq(roles.name, "admin") });
|
|
10
|
-
const userRole = await db.query.roles.findFirst({ where: eq(roles.name, "user") });
|
|
11
|
-
|
|
12
|
-
const rows = [
|
|
13
|
-
{
|
|
14
|
-
name: "Admin",
|
|
15
|
-
email: "admin@example.com",
|
|
16
|
-
password: await password.hashPassword("Password@123"),
|
|
17
|
-
roleId: adminRole?.id ?? null
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: "User One",
|
|
21
|
-
email: "user1@example.com",
|
|
22
|
-
password: await password.hashPassword("Password@123"),
|
|
23
|
-
roleId: userRole?.id ?? null
|
|
24
|
-
}
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
for (const row of rows) {
|
|
28
|
-
const existing = await db.query.users.findFirst({ where: eq(users.email, row.email) });
|
|
29
|
-
if (!existing) {
|
|
30
|
-
await db.insert(users).values(row);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
console.log("User seeder completed");
|
|
35
|
-
}
|
|
1
|
+
import { eq } from "drizzle-orm";
|
|
2
|
+
import { db, password } from "@/framework/facade.js";
|
|
3
|
+
import { roles } from "@/modules/auth/database/models/role.js";
|
|
4
|
+
import { users } from "@/modules/auth/database/models/user.js";
|
|
5
|
+
|
|
6
|
+
export const table = users;
|
|
7
|
+
|
|
8
|
+
export default async function UserSeeder() {
|
|
9
|
+
const adminRole = await db.query.roles.findFirst({ where: eq(roles.name, "admin") });
|
|
10
|
+
const userRole = await db.query.roles.findFirst({ where: eq(roles.name, "user") });
|
|
11
|
+
|
|
12
|
+
const rows = [
|
|
13
|
+
{
|
|
14
|
+
name: "Admin",
|
|
15
|
+
email: "admin@example.com",
|
|
16
|
+
password: await password.hashPassword("Password@123"),
|
|
17
|
+
roleId: adminRole?.id ?? null
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "User One",
|
|
21
|
+
email: "user1@example.com",
|
|
22
|
+
password: await password.hashPassword("Password@123"),
|
|
23
|
+
roleId: userRole?.id ?? null
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
for (const row of rows) {
|
|
28
|
+
const existing = await db.query.users.findFirst({ where: eq(users.email, row.email) });
|
|
29
|
+
if (!existing) {
|
|
30
|
+
await db.insert(users).values(row);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
console.log("User seeder completed");
|
|
35
|
+
}
|
package/express/vitest.config.ts
CHANGED
|
@@ -1,23 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
import { defineConfig } from "vitest/config";
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
resolve: {
|
|
6
|
+
alias: {
|
|
7
|
+
"@": fileURLToPath(new URL("./src", import.meta.url))
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
test: {
|
|
11
|
+
globals: true,
|
|
12
|
+
include: ["src/**/*.test.ts", "src/**/*.spec.ts"],
|
|
13
|
+
exclude: ["src/resources/**", "src/storage/**", "node_modules/**", "dist/**"],
|
|
14
|
+
environment: "node",
|
|
15
|
+
coverage: {
|
|
16
|
+
provider: "v8",
|
|
17
|
+
reporter: ["text", "json", "html"],
|
|
18
|
+
include: ["src/**/*.ts"],
|
|
19
|
+
exclude: ["src/resources/**", "src/storage/**", "src/framework/maker-cli/**", "src/**/*.d.ts", "src/**/*.test.ts", "src/**/*.spec.ts"]
|
|
20
|
+
// No `thresholds` here on purpose.
|
|
21
|
+
//
|
|
22
|
+
// This file is published inside the package, so any floor written here also
|
|
23
|
+
// becomes every scaffolded project's floor - and it would fail them on the
|
|
24
|
+
// first run. A new project ships with only the auth module's tests: the
|
|
25
|
+
// framework's own tests under `src/framework/**/__tests__/` are not
|
|
26
|
+
// published, because they test the framework rather than the application.
|
|
27
|
+
// That measures 8.49% statements, so a floor calibrated for this repository
|
|
28
|
+
// (14%) reports a failure for a developer who has done nothing wrong and
|
|
29
|
+
// whose 56 tests all pass.
|
|
30
|
+
//
|
|
31
|
+
// The floor is a guard on this repository, so it is applied by CI, which
|
|
32
|
+
// passes --coverage.thresholds.* on the command line. That keeps this file
|
|
33
|
+
// byte-identical across both engines, keeps it free of a number that would
|
|
34
|
+
// be meaningless in someone else's project, and still fails the build when
|
|
35
|
+
// untested code is added here.
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
package/hono/gitignore-stub
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
|
-
.env
|
|
2
|
-
node_modules/
|
|
3
|
-
dist/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
.env
|
|
2
|
+
node_modules/
|
|
3
|
+
dist/
|
|
4
|
+
|
|
5
|
+
# Coverage reports - regenerated by `npm run test:coverage`, ~130 HTML files
|
|
6
|
+
coverage/
|
|
7
|
+
|
|
8
|
+
public/*
|
|
9
|
+
!public/.gitkeep
|
|
10
|
+
|
|
11
|
+
deploy/.env
|
|
12
|
+
deploy/server/.env
|
|
13
|
+
|
|
14
|
+
*.log
|
|
15
|
+
npm-debug.log*
|
|
16
|
+
yarn-debug.log*
|
|
17
|
+
yarn-error.log*
|
|
18
|
+
pnpm-debug.log*
|
|
19
|
+
|
|
20
|
+
.DS_Store
|
|
21
|
+
Thumbs.db
|
|
22
|
+
|
|
23
|
+
# Lock files — regenerated per developer's package manager
|
|
24
|
+
# bun.lockb is the binary format used by bun before 1.2; bun.lock is the
|
|
25
|
+
# current text format. Both are ignored, so upgrading bun cannot turn a
|
|
26
|
+
# developer's local install into an untracked file.
|
|
27
|
+
bun.lock
|
|
28
|
+
bun.lockb
|
|
29
|
+
package-lock.json
|
|
30
|
+
pnpm-lock.yaml
|
|
31
|
+
yarn.lock
|
package/hono/package.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"test": "vitest",
|
|
26
26
|
"test:run": "vitest run",
|
|
27
27
|
"test:ui": "vitest --ui",
|
|
28
|
-
"test:coverage": "vitest --coverage"
|
|
28
|
+
"test:coverage": "vitest run --coverage"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@aws-sdk/client-s3": "^3.1111.0",
|
|
@@ -96,4 +96,4 @@
|
|
|
96
96
|
"pnpm": ">=11",
|
|
97
97
|
"yarn": ">=4"
|
|
98
98
|
}
|
|
99
|
-
}
|
|
99
|
+
}
|