sequelize-typescript-generator 12.0.0 → 13.0.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/.github/workflows/ci.yml +175 -150
- package/.vscode/launch.json +212 -0
- package/.vscode/tasks.json +95 -0
- package/CHANGELOG.md +17 -0
- package/CLAUDE.md +13 -0
- package/CONTEXT.md +67 -0
- package/README.md +827 -199
- package/build/bin/cli.js +65 -47
- package/build/bin/utils.d.ts +5 -2
- package/build/bin/utils.js +87 -104
- package/build/builders/Builder.d.ts +2 -2
- package/build/builders/Builder.js +3 -5
- package/build/builders/ModelBuilder.d.ts +43 -8
- package/build/builders/ModelBuilder.js +120 -122
- package/build/builders/NativeModelRenderer.d.ts +98 -0
- package/build/builders/NativeModelRenderer.js +353 -0
- package/build/builders/associationNaming.d.ts +9 -0
- package/build/builders/associationNaming.js +15 -0
- package/build/builders/decoratorsDependency.d.ts +27 -0
- package/build/builders/decoratorsDependency.js +45 -0
- package/build/builders/defaultValues.d.ts +40 -0
- package/build/builders/defaultValues.js +56 -0
- package/build/builders/generatedFile.d.ts +23 -0
- package/build/builders/generatedFile.js +31 -0
- package/build/builders/index.d.ts +1 -1
- package/build/builders/index.js +1 -5
- package/build/builders/nativeAssociations.d.ts +109 -0
- package/build/builders/nativeAssociations.js +308 -0
- package/build/builders/nativeAttributes.d.ts +96 -0
- package/build/builders/nativeAttributes.js +174 -0
- package/build/builders/nativeWiring.d.ts +51 -0
- package/build/builders/nativeWiring.js +108 -0
- package/build/builders/utils.d.ts +75 -0
- package/build/builders/utils.js +142 -48
- package/build/config/IConfig.d.ts +11 -2
- package/build/config/IConfig.js +4 -6
- package/build/config/format.d.ts +27 -0
- package/build/config/format.js +26 -0
- package/build/config/index.d.ts +1 -1
- package/build/config/index.js +1 -2
- package/build/connection/createConnection.d.ts +8 -1
- package/build/connection/createConnection.js +30 -7
- package/build/connection/index.d.ts +1 -1
- package/build/connection/index.js +1 -17
- package/build/dialects/AssociationsParser.d.ts +10 -2
- package/build/dialects/AssociationsParser.js +16 -19
- package/build/dialects/Dialect.d.ts +52 -9
- package/build/dialects/Dialect.js +93 -57
- package/build/dialects/DialectMSSQL.d.ts +22 -3
- package/build/dialects/DialectMSSQL.js +169 -75
- package/build/dialects/DialectMariaDB.d.ts +13 -3
- package/build/dialects/DialectMariaDB.js +98 -79
- package/build/dialects/DialectMySQL.d.ts +13 -3
- package/build/dialects/DialectMySQL.js +101 -83
- package/build/dialects/DialectPostgres.d.ts +14 -3
- package/build/dialects/DialectPostgres.js +129 -75
- package/build/dialects/DialectSQLite.d.ts +41 -3
- package/build/dialects/DialectSQLite.js +166 -24
- package/build/dialects/associationDiscovery.d.ts +64 -0
- package/build/dialects/associationDiscovery.js +275 -0
- package/build/dialects/associationsFileMerge.d.ts +21 -0
- package/build/dialects/associationsFileMerge.js +107 -0
- package/build/dialects/createDialect.d.ts +8 -0
- package/build/dialects/createDialect.js +24 -0
- package/build/dialects/dataTypes.d.ts +58 -0
- package/build/dialects/dataTypes.js +108 -0
- package/build/dialects/foreignKeys.d.ts +115 -0
- package/build/dialects/foreignKeys.js +198 -0
- package/build/dialects/index.d.ts +5 -5
- package/build/dialects/index.js +5 -13
- package/build/dialects/paranoid.d.ts +24 -0
- package/build/dialects/paranoid.js +29 -0
- package/build/dialects/utils.d.ts +2 -8
- package/build/dialects/utils.js +61 -58
- package/build/index.d.ts +11 -3
- package/build/index.js +5 -19
- package/build/lint/Linter.d.ts +14 -3
- package/build/lint/Linter.js +114 -14
- package/build/lint/eslintDefaultConfig.d.ts +2 -2
- package/build/lint/eslintDefaultConfig.js +28 -23
- package/build/lint/index.d.ts +1 -1
- package/build/lint/index.js +1 -5
- package/build/utils/errors.d.ts +6 -0
- package/build/utils/errors.js +6 -0
- package/docker-compose.yml +65 -0
- package/docs/adr/0001-esm-only-package.md +36 -0
- package/docs/adr/0002-native-default-output-format.md +41 -0
- package/docs/agents/domain.md +51 -0
- package/docs/agents/issue-tracker.md +45 -0
- package/docs/agents/triage-labels.md +15 -0
- package/docs/migration/12-to-13.md +248 -0
- package/docs/plans/v13-phase5-association-discovery.md +168 -0
- package/docs/plans/v13-phase6-native-emitter.md +537 -0
- package/docs/plans/v13-upgrade-plan.md +137 -0
- package/jest.config.cjs +31 -0
- package/package.json +44 -27
- package/scripts/check-no-sequelize-typescript.cjs +68 -0
- package/tsconfig.json +4 -3
package/.github/workflows/ci.yml
CHANGED
|
@@ -1,199 +1,224 @@
|
|
|
1
1
|
name: ci
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- master
|
|
8
|
+
tags:
|
|
9
|
+
- "v*"
|
|
10
|
+
schedule:
|
|
11
|
+
# Weekly full matrix, Mondays at 04:00 UTC.
|
|
12
|
+
- cron: "0 4 * * 1"
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
|
|
15
|
+
env:
|
|
16
|
+
NODE_VERSION: "22.13"
|
|
3
17
|
|
|
4
18
|
jobs:
|
|
5
|
-
|
|
19
|
+
checks:
|
|
6
20
|
runs-on: ubuntu-latest
|
|
7
21
|
steps:
|
|
8
|
-
-
|
|
9
|
-
uses: actions/checkout@v2
|
|
10
|
-
|
|
11
|
-
- name: Setup node
|
|
12
|
-
uses: actions/setup-node@v2
|
|
13
|
-
with:
|
|
14
|
-
node-version: '16'
|
|
22
|
+
- uses: actions/checkout@v4
|
|
15
23
|
|
|
16
|
-
-
|
|
17
|
-
id: cache-node-modules
|
|
18
|
-
uses: actions/cache@v2
|
|
24
|
+
- uses: actions/setup-node@v4
|
|
19
25
|
with:
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
27
|
+
cache: npm
|
|
22
28
|
|
|
23
29
|
- name: Install
|
|
24
|
-
run: npm
|
|
30
|
+
run: npm ci
|
|
31
|
+
|
|
32
|
+
# Type check stands in for lint: the repo has no ESLint config for its own source.
|
|
33
|
+
- name: Lint (type check)
|
|
34
|
+
run: npx tsc --noEmit
|
|
25
35
|
|
|
26
36
|
- name: Build
|
|
27
37
|
run: npm run build
|
|
28
38
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
needs: install_build
|
|
32
|
-
steps:
|
|
33
|
-
- name: Check out repository code
|
|
34
|
-
uses: actions/checkout@v2
|
|
35
|
-
|
|
36
|
-
- name: Setup node
|
|
37
|
-
uses: actions/setup-node@v2
|
|
38
|
-
with:
|
|
39
|
-
node-version: '16'
|
|
40
|
-
|
|
41
|
-
- name: Restore node_modules
|
|
42
|
-
id: cache-node-modules
|
|
43
|
-
uses: actions/cache@v2
|
|
44
|
-
with:
|
|
45
|
-
path: node_modules
|
|
46
|
-
key: node-modules-${{ hashFiles('package-lock.json') }}
|
|
47
|
-
|
|
48
|
-
- name: Test MySQL 5
|
|
49
|
-
run: npm run test-mysql
|
|
50
|
-
env:
|
|
51
|
-
DOCKER_MYSQL_TAG: 5
|
|
39
|
+
- name: Unit tests
|
|
40
|
+
run: npm run test:unit
|
|
52
41
|
|
|
53
|
-
|
|
54
|
-
run: npm run test-mysql
|
|
55
|
-
env:
|
|
56
|
-
DOCKER_MYSQL_TAG: 8
|
|
57
|
-
|
|
58
|
-
test_postgres:
|
|
42
|
+
sqlite:
|
|
59
43
|
runs-on: ubuntu-latest
|
|
60
|
-
needs:
|
|
44
|
+
needs: checks
|
|
61
45
|
steps:
|
|
62
|
-
-
|
|
63
|
-
uses: actions/checkout@v2
|
|
64
|
-
|
|
65
|
-
- name: Setup node
|
|
66
|
-
uses: actions/setup-node@v2
|
|
67
|
-
with:
|
|
68
|
-
node-version: '16'
|
|
46
|
+
- uses: actions/checkout@v4
|
|
69
47
|
|
|
70
|
-
-
|
|
71
|
-
id: cache-node-modules
|
|
72
|
-
uses: actions/cache@v2
|
|
48
|
+
- uses: actions/setup-node@v4
|
|
73
49
|
with:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
- name: Test Postgres 11
|
|
78
|
-
run: npm run test-postgres
|
|
79
|
-
env:
|
|
80
|
-
DOCKER_POSTGRES_TAG: 11
|
|
50
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
51
|
+
cache: npm
|
|
81
52
|
|
|
82
|
-
- name:
|
|
83
|
-
run: npm
|
|
84
|
-
env:
|
|
85
|
-
DOCKER_POSTGRES_TAG: 14
|
|
53
|
+
- name: Install
|
|
54
|
+
run: npm ci
|
|
86
55
|
|
|
87
|
-
- name:
|
|
88
|
-
run: npm run test
|
|
89
|
-
env:
|
|
90
|
-
DOCKER_POSTGRES_TAG: 16
|
|
56
|
+
- name: SQLite tests
|
|
57
|
+
run: npm run test:sqlite
|
|
91
58
|
|
|
92
|
-
|
|
59
|
+
set-matrix:
|
|
93
60
|
runs-on: ubuntu-latest
|
|
94
|
-
needs:
|
|
61
|
+
needs: checks
|
|
62
|
+
outputs:
|
|
63
|
+
latest: ${{ steps.matrix.outputs.latest }}
|
|
64
|
+
full: ${{ steps.matrix.outputs.full }}
|
|
95
65
|
steps:
|
|
96
|
-
- name:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
DOCKER_MARIADB_TAG: 11
|
|
120
|
-
|
|
121
|
-
test_mssql:
|
|
66
|
+
- name: Build matrices
|
|
67
|
+
id: matrix
|
|
68
|
+
run: |
|
|
69
|
+
latest='[
|
|
70
|
+
{"dialect":"postgres","image":"postgres:18","container_port":5432},
|
|
71
|
+
{"dialect":"mysql","image":"mysql:9.7","container_port":3306},
|
|
72
|
+
{"dialect":"mariadb","image":"mariadb:12.3","container_port":3306},
|
|
73
|
+
{"dialect":"mssql","image":"mcr.microsoft.com/mssql/server:2025-latest","container_port":1433}
|
|
74
|
+
]'
|
|
75
|
+
full='[
|
|
76
|
+
{"dialect":"postgres","image":"postgres:18","container_port":5432},
|
|
77
|
+
{"dialect":"postgres","image":"postgres:16","container_port":5432},
|
|
78
|
+
{"dialect":"mysql","image":"mysql:9.7","container_port":3306},
|
|
79
|
+
{"dialect":"mysql","image":"mysql:8.4","container_port":3306},
|
|
80
|
+
{"dialect":"mariadb","image":"mariadb:12.3","container_port":3306},
|
|
81
|
+
{"dialect":"mariadb","image":"mariadb:11.4","container_port":3306},
|
|
82
|
+
{"dialect":"mssql","image":"mcr.microsoft.com/mssql/server:2025-latest","container_port":1433},
|
|
83
|
+
{"dialect":"mssql","image":"mcr.microsoft.com/mssql/server:2022-latest","container_port":1433}
|
|
84
|
+
]'
|
|
85
|
+
echo "latest=$(echo "$latest" | jq -c .)" >> "$GITHUB_OUTPUT"
|
|
86
|
+
echo "full=$(echo "$full" | jq -c .)" >> "$GITHUB_OUTPUT"
|
|
87
|
+
|
|
88
|
+
integration-latest:
|
|
122
89
|
runs-on: ubuntu-latest
|
|
123
|
-
needs:
|
|
90
|
+
needs: set-matrix
|
|
91
|
+
strategy:
|
|
92
|
+
fail-fast: false
|
|
93
|
+
matrix:
|
|
94
|
+
include: ${{ fromJson(needs.set-matrix.outputs.latest) }}
|
|
95
|
+
services:
|
|
96
|
+
db:
|
|
97
|
+
image: ${{ matrix.image }}
|
|
98
|
+
env:
|
|
99
|
+
POSTGRES_DB: testdb
|
|
100
|
+
POSTGRES_USER: sa
|
|
101
|
+
POSTGRES_PASSWORD: Passw0rd88!
|
|
102
|
+
MYSQL_DATABASE: testdb
|
|
103
|
+
MYSQL_USER: sa
|
|
104
|
+
MYSQL_PASSWORD: Passw0rd88!
|
|
105
|
+
MYSQL_ROOT_PASSWORD: Passw0rd88!
|
|
106
|
+
MARIADB_DATABASE: testdb
|
|
107
|
+
MARIADB_USER: sa
|
|
108
|
+
MARIADB_PASSWORD: Passw0rd88!
|
|
109
|
+
MARIADB_ROOT_PASSWORD: Passw0rd88!
|
|
110
|
+
ACCEPT_EULA: "Y"
|
|
111
|
+
SA_PASSWORD: Passw0rd88!
|
|
112
|
+
MSSQL_SA_PASSWORD: Passw0rd88!
|
|
113
|
+
ports:
|
|
114
|
+
- 1234:${{ matrix.container_port }}
|
|
115
|
+
env:
|
|
116
|
+
TEST_DB_DIALECT: ${{ matrix.dialect }}
|
|
117
|
+
TEST_DB_HOST: localhost
|
|
118
|
+
TEST_DB_PORT: 1234
|
|
124
119
|
steps:
|
|
125
|
-
-
|
|
126
|
-
uses: actions/checkout@v2
|
|
120
|
+
- uses: actions/checkout@v4
|
|
127
121
|
|
|
128
|
-
-
|
|
129
|
-
uses: actions/setup-node@v2
|
|
122
|
+
- uses: actions/setup-node@v4
|
|
130
123
|
with:
|
|
131
|
-
node-version:
|
|
124
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
125
|
+
cache: npm
|
|
132
126
|
|
|
133
|
-
- name:
|
|
134
|
-
|
|
135
|
-
uses: actions/cache@v2
|
|
136
|
-
with:
|
|
137
|
-
path: node_modules
|
|
138
|
-
key: node-modules-${{ hashFiles('package-lock.json') }}
|
|
127
|
+
- name: Install
|
|
128
|
+
run: npm ci
|
|
139
129
|
|
|
140
|
-
- name:
|
|
141
|
-
run:
|
|
142
|
-
env:
|
|
143
|
-
DOCKER_MSSQL_TAG: 2019-latest
|
|
130
|
+
- name: Wait for database
|
|
131
|
+
run: npx tsx src/tests/integration/wait-for-db.ts
|
|
144
132
|
|
|
145
|
-
- name:
|
|
146
|
-
run: npm run test
|
|
147
|
-
env:
|
|
148
|
-
DOCKER_MSSQL_TAG: 2022-latest
|
|
133
|
+
- name: Integration tests (${{ matrix.image }})
|
|
134
|
+
run: npm run test:integration
|
|
149
135
|
|
|
150
|
-
|
|
136
|
+
integration-full:
|
|
151
137
|
runs-on: ubuntu-latest
|
|
152
|
-
needs:
|
|
138
|
+
needs: set-matrix
|
|
139
|
+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v')
|
|
140
|
+
strategy:
|
|
141
|
+
fail-fast: false
|
|
142
|
+
matrix:
|
|
143
|
+
include: ${{ fromJson(needs.set-matrix.outputs.full) }}
|
|
144
|
+
services:
|
|
145
|
+
db:
|
|
146
|
+
image: ${{ matrix.image }}
|
|
147
|
+
env:
|
|
148
|
+
POSTGRES_DB: testdb
|
|
149
|
+
POSTGRES_USER: sa
|
|
150
|
+
POSTGRES_PASSWORD: Passw0rd88!
|
|
151
|
+
MYSQL_DATABASE: testdb
|
|
152
|
+
MYSQL_USER: sa
|
|
153
|
+
MYSQL_PASSWORD: Passw0rd88!
|
|
154
|
+
MYSQL_ROOT_PASSWORD: Passw0rd88!
|
|
155
|
+
MARIADB_DATABASE: testdb
|
|
156
|
+
MARIADB_USER: sa
|
|
157
|
+
MARIADB_PASSWORD: Passw0rd88!
|
|
158
|
+
MARIADB_ROOT_PASSWORD: Passw0rd88!
|
|
159
|
+
ACCEPT_EULA: "Y"
|
|
160
|
+
SA_PASSWORD: Passw0rd88!
|
|
161
|
+
MSSQL_SA_PASSWORD: Passw0rd88!
|
|
162
|
+
ports:
|
|
163
|
+
- 1234:${{ matrix.container_port }}
|
|
164
|
+
env:
|
|
165
|
+
TEST_DB_DIALECT: ${{ matrix.dialect }}
|
|
166
|
+
TEST_DB_HOST: localhost
|
|
167
|
+
TEST_DB_PORT: 1234
|
|
153
168
|
steps:
|
|
154
|
-
-
|
|
155
|
-
uses: actions/checkout@v2
|
|
169
|
+
- uses: actions/checkout@v4
|
|
156
170
|
|
|
157
|
-
-
|
|
158
|
-
uses: actions/setup-node@v2
|
|
171
|
+
- uses: actions/setup-node@v4
|
|
159
172
|
with:
|
|
160
|
-
node-version:
|
|
173
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
174
|
+
cache: npm
|
|
161
175
|
|
|
162
|
-
- name:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
key: node-modules-${{ hashFiles('package-lock.json') }}
|
|
176
|
+
- name: Install
|
|
177
|
+
run: npm ci
|
|
178
|
+
|
|
179
|
+
- name: Wait for database
|
|
180
|
+
run: npx tsx src/tests/integration/wait-for-db.ts
|
|
168
181
|
|
|
169
|
-
- name:
|
|
170
|
-
run: npm run test
|
|
182
|
+
- name: Integration tests (${{ matrix.image }})
|
|
183
|
+
run: npm run test:integration
|
|
171
184
|
|
|
172
185
|
publish:
|
|
173
186
|
runs-on: ubuntu-latest
|
|
174
|
-
|
|
187
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
188
|
+
needs:
|
|
189
|
+
- sqlite
|
|
190
|
+
- integration-latest
|
|
191
|
+
- integration-full
|
|
192
|
+
permissions:
|
|
193
|
+
id-token: write
|
|
194
|
+
contents: read
|
|
175
195
|
steps:
|
|
176
|
-
-
|
|
177
|
-
uses: actions/checkout@v2
|
|
196
|
+
- uses: actions/checkout@v4
|
|
178
197
|
|
|
179
|
-
-
|
|
180
|
-
uses: actions/setup-node@v2
|
|
198
|
+
- uses: actions/setup-node@v4
|
|
181
199
|
with:
|
|
182
|
-
node-version:
|
|
200
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
201
|
+
cache: npm
|
|
202
|
+
registry-url: "https://registry.npmjs.org"
|
|
183
203
|
|
|
184
|
-
- name:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
204
|
+
- name: Upgrade npm for trusted publishing
|
|
205
|
+
# npm 11.x provides OIDC trusted publishing and supports Node 22.13
|
|
206
|
+
run: npm install -g npm@11
|
|
207
|
+
|
|
208
|
+
- name: Install
|
|
209
|
+
run: npm ci
|
|
190
210
|
|
|
191
211
|
- name: Build
|
|
192
212
|
run: npm run build
|
|
193
213
|
|
|
194
|
-
- name:
|
|
195
|
-
|
|
214
|
+
- name: Resolve npm dist-tag
|
|
215
|
+
id: dist_tag
|
|
196
216
|
run: |
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
217
|
+
if [[ "${GITHUB_REF_NAME}" == *-* ]]; then
|
|
218
|
+
echo "tag=next" >> "$GITHUB_OUTPUT"
|
|
219
|
+
else
|
|
220
|
+
echo "tag=latest" >> "$GITHUB_OUTPUT"
|
|
221
|
+
fi
|
|
222
|
+
|
|
223
|
+
- name: Publish
|
|
224
|
+
run: npm publish --provenance --access public --tag ${{ steps.dist_tag.outputs.tag }}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
// Run the CLI from source (tsx) against a sqlite DB, emitting native models.
|
|
9
|
+
// Point -S at your own sqlite file (create .scratch/local.sqlite first).
|
|
10
|
+
"type": "node",
|
|
11
|
+
"request": "launch",
|
|
12
|
+
"name": "CLI: sqlite → native",
|
|
13
|
+
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/tsx",
|
|
14
|
+
"program": "${workspaceFolder}/src/bin/cli.ts",
|
|
15
|
+
"args": [
|
|
16
|
+
"-D", "sqlite",
|
|
17
|
+
"-S", "${workspaceFolder}/.scratch/local.sqlite",
|
|
18
|
+
"-o", "${workspaceFolder}/output-models",
|
|
19
|
+
"-F", "native",
|
|
20
|
+
"--clean"
|
|
21
|
+
],
|
|
22
|
+
"console": "integratedTerminal",
|
|
23
|
+
"skipFiles": ["<node_internals>/**"]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
// Same as above but emitting sequelize-typescript decorator models.
|
|
27
|
+
"type": "node",
|
|
28
|
+
"request": "launch",
|
|
29
|
+
"name": "CLI: sqlite → decorators",
|
|
30
|
+
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/tsx",
|
|
31
|
+
"program": "${workspaceFolder}/src/bin/cli.ts",
|
|
32
|
+
"args": [
|
|
33
|
+
"-D", "sqlite",
|
|
34
|
+
"-S", "${workspaceFolder}/.scratch/local.sqlite",
|
|
35
|
+
"-o", "${workspaceFolder}/output-models",
|
|
36
|
+
"-F", "decorators",
|
|
37
|
+
"--clean"
|
|
38
|
+
],
|
|
39
|
+
"console": "integratedTerminal",
|
|
40
|
+
"skipFiles": ["<node_internals>/**"]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
// Print CLI usage.
|
|
44
|
+
"type": "node",
|
|
45
|
+
"request": "launch",
|
|
46
|
+
"name": "CLI: --help",
|
|
47
|
+
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/tsx",
|
|
48
|
+
"program": "${workspaceFolder}/src/bin/cli.ts",
|
|
49
|
+
"args": ["--help"],
|
|
50
|
+
"console": "integratedTerminal",
|
|
51
|
+
"skipFiles": ["<node_internals>/**"]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
// Run the CLI against a sqlite DB whose path and output format you choose at launch.
|
|
55
|
+
"type": "node",
|
|
56
|
+
"request": "launch",
|
|
57
|
+
"name": "CLI: sqlite (prompt path + format)",
|
|
58
|
+
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/tsx",
|
|
59
|
+
"program": "${workspaceFolder}/src/bin/cli.ts",
|
|
60
|
+
"args": [
|
|
61
|
+
"-D", "sqlite",
|
|
62
|
+
"-S", "${input:sqliteStorage}",
|
|
63
|
+
"-o", "${workspaceFolder}/output-models",
|
|
64
|
+
"-F", "${input:format}",
|
|
65
|
+
"--clean"
|
|
66
|
+
],
|
|
67
|
+
"console": "integratedTerminal",
|
|
68
|
+
"skipFiles": ["<node_internals>/**"]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
// Run all unit tests under the Node debugger.
|
|
72
|
+
"type": "node",
|
|
73
|
+
"request": "launch",
|
|
74
|
+
"name": "Jest: unit (all)",
|
|
75
|
+
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
|
|
76
|
+
"args": ["src/tests/unit", "--runInBand"],
|
|
77
|
+
"env": {
|
|
78
|
+
"NODE_OPTIONS": "--experimental-vm-modules"
|
|
79
|
+
},
|
|
80
|
+
"console": "integratedTerminal",
|
|
81
|
+
"skipFiles": ["<node_internals>/**"]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
// Run all sqlite integration tests under the Node debugger.
|
|
85
|
+
"type": "node",
|
|
86
|
+
"request": "launch",
|
|
87
|
+
"name": "Jest: sqlite integration (all)",
|
|
88
|
+
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
|
|
89
|
+
"args": ["src/tests/integration/sqlite", "--runInBand"],
|
|
90
|
+
"env": {
|
|
91
|
+
"NODE_OPTIONS": "--experimental-vm-modules"
|
|
92
|
+
},
|
|
93
|
+
"console": "integratedTerminal",
|
|
94
|
+
"skipFiles": ["<node_internals>/**"]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
// Run the currently open test file under the Node debugger.
|
|
98
|
+
"type": "node",
|
|
99
|
+
"request": "launch",
|
|
100
|
+
"name": "Jest: current file",
|
|
101
|
+
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
|
|
102
|
+
"args": ["${relativeFile}", "--runInBand"],
|
|
103
|
+
"env": {
|
|
104
|
+
"NODE_OPTIONS": "--experimental-vm-modules"
|
|
105
|
+
},
|
|
106
|
+
"console": "integratedTerminal",
|
|
107
|
+
"skipFiles": ["<node_internals>/**"]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
// Regenerate sqlite golden fixtures for the golden tests.
|
|
111
|
+
"type": "node",
|
|
112
|
+
"request": "launch",
|
|
113
|
+
"name": "Jest: sqlite golden update",
|
|
114
|
+
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
|
|
115
|
+
"args": ["src/tests/integration/sqlite", "-t", "golden", "--runInBand"],
|
|
116
|
+
"env": {
|
|
117
|
+
"NODE_OPTIONS": "--experimental-vm-modules",
|
|
118
|
+
"GOLDEN_UPDATE": "1"
|
|
119
|
+
},
|
|
120
|
+
"console": "integratedTerminal",
|
|
121
|
+
"skipFiles": ["<node_internals>/**"]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
// Debug the postgres integration tests. preLaunchTask brings the DB up and waits;
|
|
125
|
+
// the container is left running afterwards — run the "db: down (all)" task to stop it.
|
|
126
|
+
"type": "node",
|
|
127
|
+
"request": "launch",
|
|
128
|
+
"name": "Integration: postgres (debug)",
|
|
129
|
+
"preLaunchTask": "db: postgres (up + wait)",
|
|
130
|
+
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
|
|
131
|
+
"args": ["src/tests/integration/postgres", "--runInBand"],
|
|
132
|
+
"env": {
|
|
133
|
+
"NODE_OPTIONS": "--experimental-vm-modules",
|
|
134
|
+
"TEST_DB_DIALECT": "postgres",
|
|
135
|
+
"TEST_DB_HOST": "localhost",
|
|
136
|
+
"TEST_DB_PORT": "1234"
|
|
137
|
+
},
|
|
138
|
+
"console": "integratedTerminal",
|
|
139
|
+
"skipFiles": ["<node_internals>/**"]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
// Debug the mysql integration tests. preLaunchTask brings the DB up and waits;
|
|
143
|
+
// the container is left running afterwards — run the "db: down (all)" task to stop it.
|
|
144
|
+
"type": "node",
|
|
145
|
+
"request": "launch",
|
|
146
|
+
"name": "Integration: mysql (debug)",
|
|
147
|
+
"preLaunchTask": "db: mysql (up + wait)",
|
|
148
|
+
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
|
|
149
|
+
"args": ["src/tests/integration/mysql", "--runInBand"],
|
|
150
|
+
"env": {
|
|
151
|
+
"NODE_OPTIONS": "--experimental-vm-modules",
|
|
152
|
+
"TEST_DB_DIALECT": "mysql",
|
|
153
|
+
"TEST_DB_HOST": "localhost",
|
|
154
|
+
"TEST_DB_PORT": "1234"
|
|
155
|
+
},
|
|
156
|
+
"console": "integratedTerminal",
|
|
157
|
+
"skipFiles": ["<node_internals>/**"]
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
// Debug the mariadb integration tests. preLaunchTask brings the DB up and waits;
|
|
161
|
+
// the container is left running afterwards — run the "db: down (all)" task to stop it.
|
|
162
|
+
"type": "node",
|
|
163
|
+
"request": "launch",
|
|
164
|
+
"name": "Integration: mariadb (debug)",
|
|
165
|
+
"preLaunchTask": "db: mariadb (up + wait)",
|
|
166
|
+
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
|
|
167
|
+
"args": ["src/tests/integration/mariadb", "--runInBand"],
|
|
168
|
+
"env": {
|
|
169
|
+
"NODE_OPTIONS": "--experimental-vm-modules",
|
|
170
|
+
"TEST_DB_DIALECT": "mariadb",
|
|
171
|
+
"TEST_DB_HOST": "localhost",
|
|
172
|
+
"TEST_DB_PORT": "1234"
|
|
173
|
+
},
|
|
174
|
+
"console": "integratedTerminal",
|
|
175
|
+
"skipFiles": ["<node_internals>/**"]
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
// Debug the mssql integration tests. preLaunchTask brings the DB up and waits;
|
|
179
|
+
// the container is left running afterwards — run the "db: down (all)" task to stop it.
|
|
180
|
+
// Requires Node <= 23 locally (tedious/SlowBuffer broken on Node >= 24).
|
|
181
|
+
"type": "node",
|
|
182
|
+
"request": "launch",
|
|
183
|
+
"name": "Integration: mssql (debug)",
|
|
184
|
+
"preLaunchTask": "db: mssql (up + wait)",
|
|
185
|
+
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
|
|
186
|
+
"args": ["src/tests/integration/mssql", "--runInBand"],
|
|
187
|
+
"env": {
|
|
188
|
+
"NODE_OPTIONS": "--experimental-vm-modules",
|
|
189
|
+
"TEST_DB_DIALECT": "mssql",
|
|
190
|
+
"TEST_DB_HOST": "localhost",
|
|
191
|
+
"TEST_DB_PORT": "1234"
|
|
192
|
+
},
|
|
193
|
+
"console": "integratedTerminal",
|
|
194
|
+
"skipFiles": ["<node_internals>/**"]
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"inputs": [
|
|
198
|
+
{
|
|
199
|
+
"id": "sqliteStorage",
|
|
200
|
+
"type": "promptString",
|
|
201
|
+
"description": "Path to the sqlite database file",
|
|
202
|
+
"default": "${workspaceFolder}/.scratch/local.sqlite"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"id": "format",
|
|
206
|
+
"type": "pickString",
|
|
207
|
+
"description": "Output format",
|
|
208
|
+
"options": ["native", "decorators"],
|
|
209
|
+
"default": "native"
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
}
|