create-skweb 3.3.3 → 3.3.5
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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +12 -0
- package/package.json +1 -1
- package/templates/cjs/src/commands/migrate.js +4 -0
- package/templates/cjs/src/commands/seed.js +4 -0
- package/templates/cjs/src/controllers/user.js +1 -3
- package/templates/cjs/src/models/SysUser.js +39 -35
- package/templates/mjs/src/commands/migrate.js +4 -0
- package/templates/mjs/src/commands/seed.js +4 -0
- package/templates/mjs/src/controllers/user.js +1 -3
- package/templates/mjs/src/models/SysUser.js +37 -37
- package/templates/ts/src/commands/migrate.ts +4 -0
- package/templates/ts/src/commands/seed.ts +4 -0
- package/templates/ts/src/controllers/user.ts +1 -3
- package/templates/ts/src/models/SysUser.ts +37 -46
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
> create-skweb@3.3.
|
|
2
|
+
> create-skweb@3.3.5 prebuild
|
|
3
3
|
> tsc --outDir dist --rootDir src
|
|
4
4
|
|
|
5
5
|
⠙[1G[0K
|
|
6
|
-
> create-skweb@3.3.
|
|
6
|
+
> create-skweb@3.3.5 build
|
|
7
7
|
> rollup -c rollup.config.mjs && node scripts/inject-shebang.mjs && chmod +x dist/cli.js
|
|
8
8
|
|
|
9
9
|
⠙[1G[0K[36m
|
|
10
10
|
[1msrc/index.ts[22m → [1mdist/index.js[22m...[39m
|
|
11
11
|
[1m[33m(!) [plugin typescript] @rollup/plugin-typescript: outputToFilesystem option is defaulting to true.[39m[22m
|
|
12
|
-
[32mcreated [1mdist/index.js[22m in [
|
|
12
|
+
[32mcreated [1mdist/index.js[22m in [1m350ms[22m[39m
|
|
13
13
|
[36m
|
|
14
14
|
[1msrc/cli.ts[22m → [1mdist/cli.js[22m...[39m
|
|
15
|
-
[32mcreated [1mdist/cli.js[22m in [
|
|
15
|
+
[32mcreated [1mdist/cli.js[22m in [1m178ms[22m[39m
|
|
16
16
|
[inject-shebang] Shebang added to /Users/stayknight/projects/skweb-mono/tools/create-skweb/dist/cli.js
|
|
17
17
|
⠙[1G[0K
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# create-skweb
|
|
2
2
|
|
|
3
|
+
## 3.3.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- chore(create-skweb): v3.3.5 - 增强 migrate/seed 错误输出,便于定位数据库权限问题
|
|
8
|
+
|
|
9
|
+
## 3.3.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- chore(create-skweb): v3.3.4 - 模型改为 initModel 格式,移除 declare 声明,修复 SysUser 导入方式
|
|
14
|
+
|
|
3
15
|
## 3.3.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -22,6 +22,10 @@ async function runMigrate() {
|
|
|
22
22
|
if (require.main === module) {
|
|
23
23
|
runMigrate().catch((err) => {
|
|
24
24
|
logger.error('[migrate] Fatal error:', err)
|
|
25
|
+
console.error('[migrate] Error message:', err?.message)
|
|
26
|
+
console.error('[migrate] Error code:', err?.code)
|
|
27
|
+
console.error('[migrate] SQL:', err?.sql)
|
|
28
|
+
console.error('[migrate] Error details:', err)
|
|
25
29
|
process.exit(1)
|
|
26
30
|
})
|
|
27
31
|
}
|
|
@@ -45,6 +45,10 @@ async function runSeed() {
|
|
|
45
45
|
if (require.main === module) {
|
|
46
46
|
runSeed().catch((err) => {
|
|
47
47
|
logger.error('[seed] Fatal error:', err)
|
|
48
|
+
console.error('[seed] Error message:', err?.message)
|
|
49
|
+
console.error('[seed] Error code:', err?.code)
|
|
50
|
+
console.error('[seed] SQL:', err?.sql)
|
|
51
|
+
console.error('[seed] Error details:', err)
|
|
48
52
|
process.exit(1)
|
|
49
53
|
})
|
|
50
54
|
}
|
|
@@ -1,38 +1,42 @@
|
|
|
1
1
|
const { Model, DataTypes } = require('sequelize')
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
3
|
+
class SysUser extends Model {
|
|
4
|
+
static initModel(sequelize) {
|
|
5
|
+
SysUser.init({
|
|
6
|
+
id: {
|
|
7
|
+
type: DataTypes.INTEGER,
|
|
8
|
+
primaryKey: true,
|
|
9
|
+
autoIncrement: true
|
|
10
|
+
},
|
|
11
|
+
username: {
|
|
12
|
+
type: DataTypes.STRING(50),
|
|
13
|
+
allowNull: false,
|
|
14
|
+
unique: true
|
|
15
|
+
},
|
|
16
|
+
password: {
|
|
17
|
+
type: DataTypes.STRING(255),
|
|
18
|
+
allowNull: false
|
|
19
|
+
},
|
|
20
|
+
email: {
|
|
21
|
+
type: DataTypes.STRING(100)
|
|
22
|
+
},
|
|
23
|
+
phone: {
|
|
24
|
+
type: DataTypes.STRING(20)
|
|
25
|
+
},
|
|
26
|
+
status: {
|
|
27
|
+
type: DataTypes.TINYINT,
|
|
28
|
+
defaultValue: 1
|
|
29
|
+
}
|
|
30
|
+
}, {
|
|
31
|
+
sequelize,
|
|
32
|
+
modelName: 'SysUser',
|
|
33
|
+
tableName: 'sys_users',
|
|
34
|
+
timestamps: true,
|
|
35
|
+
underscored: true
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
return SysUser
|
|
39
|
+
}
|
|
38
40
|
}
|
|
41
|
+
|
|
42
|
+
module.exports = { SysUser }
|
|
@@ -27,6 +27,10 @@ const isMainModule = import.meta.url === `file://${process.argv[1]}`
|
|
|
27
27
|
if (isMainModule) {
|
|
28
28
|
runMigrate().catch((err) => {
|
|
29
29
|
logger.error('[migrate] Fatal error:', err)
|
|
30
|
+
console.error('[migrate] Error message:', err?.message)
|
|
31
|
+
console.error('[migrate] Error code:', err?.code)
|
|
32
|
+
console.error('[migrate] SQL:', err?.sql)
|
|
33
|
+
console.error('[migrate] Error details:', err)
|
|
30
34
|
process.exit(1)
|
|
31
35
|
})
|
|
32
36
|
}
|
|
@@ -52,6 +52,10 @@ const isMainModule = import.meta.url === `file://${process.argv[1]}`
|
|
|
52
52
|
if (isMainModule) {
|
|
53
53
|
runSeed().catch((err) => {
|
|
54
54
|
logger.error('[seed] Fatal error:', err)
|
|
55
|
+
console.error('[seed] Error message:', err?.message)
|
|
56
|
+
console.error('[seed] Error code:', err?.code)
|
|
57
|
+
console.error('[seed] SQL:', err?.sql)
|
|
58
|
+
console.error('[seed] Error details:', err)
|
|
55
59
|
process.exit(1)
|
|
56
60
|
})
|
|
57
61
|
}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { Model, DataTypes } from 'sequelize'
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export class SysUser extends Model {
|
|
4
|
+
static initModel(sequelize) {
|
|
5
|
+
SysUser.init({
|
|
6
|
+
id: {
|
|
7
|
+
type: DataTypes.INTEGER,
|
|
8
|
+
primaryKey: true,
|
|
9
|
+
autoIncrement: true
|
|
10
|
+
},
|
|
11
|
+
username: {
|
|
12
|
+
type: DataTypes.STRING(50),
|
|
13
|
+
allowNull: false,
|
|
14
|
+
unique: true
|
|
15
|
+
},
|
|
16
|
+
password: {
|
|
17
|
+
type: DataTypes.STRING(255),
|
|
18
|
+
allowNull: false
|
|
19
|
+
},
|
|
20
|
+
email: {
|
|
21
|
+
type: DataTypes.STRING(100)
|
|
22
|
+
},
|
|
23
|
+
phone: {
|
|
24
|
+
type: DataTypes.STRING(20)
|
|
25
|
+
},
|
|
26
|
+
status: {
|
|
27
|
+
type: DataTypes.TINYINT,
|
|
28
|
+
defaultValue: 1
|
|
29
|
+
}
|
|
30
|
+
}, {
|
|
31
|
+
sequelize,
|
|
32
|
+
modelName: 'SysUser',
|
|
33
|
+
tableName: 'sys_users',
|
|
34
|
+
timestamps: true,
|
|
35
|
+
underscored: true
|
|
36
|
+
})
|
|
5
37
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
primaryKey: true,
|
|
10
|
-
autoIncrement: true
|
|
11
|
-
},
|
|
12
|
-
username: {
|
|
13
|
-
type: DataTypes.STRING(50),
|
|
14
|
-
allowNull: false,
|
|
15
|
-
unique: true
|
|
16
|
-
},
|
|
17
|
-
password: {
|
|
18
|
-
type: DataTypes.STRING(255),
|
|
19
|
-
allowNull: false
|
|
20
|
-
},
|
|
21
|
-
email: {
|
|
22
|
-
type: DataTypes.STRING(100)
|
|
23
|
-
},
|
|
24
|
-
phone: {
|
|
25
|
-
type: DataTypes.STRING(20)
|
|
26
|
-
},
|
|
27
|
-
status: {
|
|
28
|
-
type: DataTypes.TINYINT,
|
|
29
|
-
defaultValue: 1
|
|
30
|
-
}
|
|
31
|
-
}, {
|
|
32
|
-
sequelize,
|
|
33
|
-
modelName: 'SysUser',
|
|
34
|
-
tableName: 'sys_users',
|
|
35
|
-
timestamps: true,
|
|
36
|
-
underscored: true
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
return SysUser
|
|
40
|
-
}
|
|
38
|
+
return SysUser
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -27,6 +27,10 @@ const isMainModule = import.meta.url === `file://${process.argv[1]}`
|
|
|
27
27
|
if (isMainModule) {
|
|
28
28
|
runMigrate().catch((err) => {
|
|
29
29
|
logger.error('[migrate] Fatal error:', err)
|
|
30
|
+
console.error('[migrate] Error message:', err?.message)
|
|
31
|
+
console.error('[migrate] Error code:', err?.code)
|
|
32
|
+
console.error('[migrate] SQL:', err?.sql)
|
|
33
|
+
console.error('[migrate] Error details:', err)
|
|
30
34
|
process.exit(1)
|
|
31
35
|
})
|
|
32
36
|
}
|
|
@@ -52,6 +52,10 @@ const isMainModule = import.meta.url === `file://${process.argv[1]}`
|
|
|
52
52
|
if (isMainModule) {
|
|
53
53
|
runSeed().catch((err) => {
|
|
54
54
|
logger.error('[seed] Fatal error:', err)
|
|
55
|
+
console.error('[seed] Error message:', err?.message)
|
|
56
|
+
console.error('[seed] Error code:', err?.code)
|
|
57
|
+
console.error('[seed] SQL:', err?.sql)
|
|
58
|
+
console.error('[seed] Error details:', err)
|
|
55
59
|
process.exit(1)
|
|
56
60
|
})
|
|
57
61
|
}
|
|
@@ -1,49 +1,40 @@
|
|
|
1
1
|
import { Model, DataTypes, type Sequelize, type ModelStatic } from 'sequelize'
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
type: DataTypes.TINYINT,
|
|
38
|
-
defaultValue: 1
|
|
39
|
-
}
|
|
40
|
-
}, {
|
|
41
|
-
sequelize,
|
|
42
|
-
modelName: 'SysUser',
|
|
43
|
-
tableName: 'sys_users',
|
|
44
|
-
timestamps: true,
|
|
45
|
-
underscored: true
|
|
46
|
-
})
|
|
3
|
+
export class SysUser extends Model {
|
|
4
|
+
static initModel(sequelize: Sequelize): ModelStatic<Model> {
|
|
5
|
+
SysUser.init({
|
|
6
|
+
id: {
|
|
7
|
+
type: DataTypes.INTEGER,
|
|
8
|
+
primaryKey: true,
|
|
9
|
+
autoIncrement: true
|
|
10
|
+
},
|
|
11
|
+
username: {
|
|
12
|
+
type: DataTypes.STRING(50),
|
|
13
|
+
allowNull: false,
|
|
14
|
+
unique: true
|
|
15
|
+
},
|
|
16
|
+
password: {
|
|
17
|
+
type: DataTypes.STRING(255),
|
|
18
|
+
allowNull: false
|
|
19
|
+
},
|
|
20
|
+
email: {
|
|
21
|
+
type: DataTypes.STRING(100)
|
|
22
|
+
},
|
|
23
|
+
phone: {
|
|
24
|
+
type: DataTypes.STRING(20)
|
|
25
|
+
},
|
|
26
|
+
status: {
|
|
27
|
+
type: DataTypes.TINYINT,
|
|
28
|
+
defaultValue: 1
|
|
29
|
+
}
|
|
30
|
+
}, {
|
|
31
|
+
sequelize,
|
|
32
|
+
modelName: 'SysUser',
|
|
33
|
+
tableName: 'sys_users',
|
|
34
|
+
timestamps: true,
|
|
35
|
+
underscored: true
|
|
36
|
+
})
|
|
47
37
|
|
|
48
|
-
|
|
49
|
-
}
|
|
38
|
+
return SysUser
|
|
39
|
+
}
|
|
40
|
+
}
|