@adonisjs/assembler 6.1.3-17 → 6.1.3-19

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.
@@ -0,0 +1,28 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import { RcFileTransformer } from './rc_file_transformer.js';
3
+ import type { AddMiddlewareEntry, EnvValidationDefinition } from '../types.js';
4
+ /**
5
+ * This class is responsible for updating
6
+ */
7
+ export declare class CodeTransformer {
8
+ #private;
9
+ constructor(cwd: URL);
10
+ /**
11
+ * Update the `adonisrc.ts` file
12
+ */
13
+ updateRcFile(callback: (transformer: RcFileTransformer) => void): Promise<void>;
14
+ /**
15
+ * Define new middlewares inside the `start/kernel.ts`
16
+ * file
17
+ *
18
+ * This function is highly based on some assumptions
19
+ * and will not work if you significantly tweaked
20
+ * your `start/kernel.ts` file.
21
+ */
22
+ addMiddlewareToStack(stack: 'server' | 'router' | 'named', middleware: AddMiddlewareEntry[]): Promise<void>;
23
+ /**
24
+ * Add new env variable validation in the
25
+ * `env.ts` file
26
+ */
27
+ defineEnvValidations(definition: EnvValidationDefinition): Promise<void>;
28
+ }
@@ -0,0 +1,174 @@
1
+ /*
2
+ * @adonisjs/assembler
3
+ *
4
+ * (c) AdonisJS
5
+ *
6
+ * For the full copyright and license information, please view the LICENSE
7
+ * file that was distributed with this source code.
8
+ */
9
+ import { join } from 'node:path';
10
+ import { fileURLToPath } from 'node:url';
11
+ import { Node, Project, SyntaxKind } from 'ts-morph';
12
+ import { RcFileTransformer } from './rc_file_transformer.js';
13
+ /**
14
+ * This class is responsible for updating
15
+ */
16
+ export class CodeTransformer {
17
+ /**
18
+ * Directory of the adonisjs project
19
+ */
20
+ #cwd;
21
+ /**
22
+ * The TsMorph project
23
+ */
24
+ #project;
25
+ /**
26
+ * Settings to use when persisting files
27
+ */
28
+ #editorSettings = {
29
+ indentSize: 2,
30
+ convertTabsToSpaces: true,
31
+ trimTrailingWhitespace: true,
32
+ };
33
+ constructor(cwd) {
34
+ this.#cwd = cwd;
35
+ this.#project = new Project({
36
+ tsConfigFilePath: join(fileURLToPath(this.#cwd), 'tsconfig.json'),
37
+ });
38
+ }
39
+ /**
40
+ * Update the `adonisrc.ts` file
41
+ */
42
+ async updateRcFile(callback) {
43
+ const rcFileTransformer = new RcFileTransformer(this.#cwd, this.#project);
44
+ callback(rcFileTransformer);
45
+ await rcFileTransformer.save();
46
+ }
47
+ /**
48
+ * Add a new middleware to the middleware array of the
49
+ * given file
50
+ */
51
+ #addToMiddlewareArray(file, target, middlewareEntry) {
52
+ const callExpressions = file
53
+ .getDescendantsOfKind(SyntaxKind.CallExpression)
54
+ .filter((statement) => statement.getExpression().getText() === target);
55
+ if (!callExpressions.length) {
56
+ throw new Error(`Cannot find ${target} statement in the file.`);
57
+ }
58
+ const arrayLiteralExpression = callExpressions[0].getArguments()[0];
59
+ if (!arrayLiteralExpression || !Node.isArrayLiteralExpression(arrayLiteralExpression)) {
60
+ throw new Error(`Cannot find middleware array in ${target} statement.`);
61
+ }
62
+ const middleware = `() => import('${middlewareEntry.path}')`;
63
+ if (middlewareEntry.position === 'before') {
64
+ arrayLiteralExpression.insertElement(0, middleware);
65
+ }
66
+ else {
67
+ arrayLiteralExpression.addElement(middleware);
68
+ }
69
+ }
70
+ /**
71
+ * Add a new middleware to the named middleware of the given file
72
+ */
73
+ #addToNamedMiddleware(file, middlewareEntry) {
74
+ if (!middlewareEntry.name)
75
+ throw new Error('Named middleware requires a name.');
76
+ const callArguments = file
77
+ .getVariableDeclarationOrThrow('middleware')
78
+ .getInitializerIfKindOrThrow(SyntaxKind.CallExpression)
79
+ .getArguments();
80
+ if (callArguments.length === 0) {
81
+ throw new Error('Named middleware call has no arguments.');
82
+ }
83
+ const namedMiddlewareObject = callArguments[0];
84
+ if (!Node.isObjectLiteralExpression(namedMiddlewareObject)) {
85
+ throw new Error('The argument of the named middleware call is not an object literal.');
86
+ }
87
+ const middleware = `${middlewareEntry.name}: () => import('${middlewareEntry.path}')`;
88
+ namedMiddlewareObject.insertProperty(0, middleware);
89
+ }
90
+ /**
91
+ * Write a leading comment
92
+ */
93
+ #addLeadingComment(writer, comment) {
94
+ if (!comment)
95
+ return writer.blankLine();
96
+ return writer
97
+ .blankLine()
98
+ .writeLine('/*')
99
+ .writeLine(`|----------------------------------------------------------`)
100
+ .writeLine(`| ${comment}`)
101
+ .writeLine(`|----------------------------------------------------------`)
102
+ .writeLine(`*/`);
103
+ }
104
+ /**
105
+ * Define new middlewares inside the `start/kernel.ts`
106
+ * file
107
+ *
108
+ * This function is highly based on some assumptions
109
+ * and will not work if you significantly tweaked
110
+ * your `start/kernel.ts` file.
111
+ */
112
+ async addMiddlewareToStack(stack, middleware) {
113
+ /**
114
+ * Get the `start/kernel.ts` source file
115
+ */
116
+ const kernelUrl = fileURLToPath(new URL('./start/kernel.ts', this.#cwd));
117
+ const file = this.#project.getSourceFileOrThrow(kernelUrl);
118
+ /**
119
+ * Process each middleware entry
120
+ */
121
+ for (const middlewareEntry of middleware) {
122
+ if (stack === 'named') {
123
+ this.#addToNamedMiddleware(file, middlewareEntry);
124
+ }
125
+ else {
126
+ this.#addToMiddlewareArray(file, `${stack}.use`, middlewareEntry);
127
+ }
128
+ }
129
+ file.formatText(this.#editorSettings);
130
+ await file.save();
131
+ }
132
+ /**
133
+ * Add new env variable validation in the
134
+ * `env.ts` file
135
+ */
136
+ async defineEnvValidations(definition) {
137
+ /**
138
+ * Get the `start/env.ts` source file
139
+ */
140
+ const kernelUrl = fileURLToPath(new URL('./start/env.ts', this.#cwd));
141
+ const file = this.#project.getSourceFileOrThrow(kernelUrl);
142
+ /**
143
+ * Get the `Env.create` call expression
144
+ */
145
+ const callExpressions = file
146
+ .getDescendantsOfKind(SyntaxKind.CallExpression)
147
+ .filter((statement) => statement.getExpression().getText() === 'Env.create');
148
+ if (!callExpressions.length) {
149
+ throw new Error(`Cannot find Env.create statement in the file.`);
150
+ }
151
+ const objectLiteralExpression = callExpressions[0].getArguments()[1];
152
+ if (!Node.isObjectLiteralExpression(objectLiteralExpression)) {
153
+ throw new Error(`The second argument of Env.create is not an object literal.`);
154
+ }
155
+ let firstAdded = false;
156
+ /**
157
+ * Add each variable validation
158
+ */
159
+ for (const [variable, validation] of Object.entries(definition.variables)) {
160
+ objectLiteralExpression.addPropertyAssignment({
161
+ name: variable,
162
+ initializer: validation,
163
+ leadingTrivia: (writer) => {
164
+ if (firstAdded)
165
+ return;
166
+ firstAdded = true;
167
+ return this.#addLeadingComment(writer, definition.leadingComment);
168
+ },
169
+ });
170
+ }
171
+ file.formatText(this.#editorSettings);
172
+ await file.save();
173
+ }
174
+ }
@@ -0,0 +1,43 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import { Project } from 'ts-morph';
3
+ import type { AppEnvironments } from '@adonisjs/application/types';
4
+ /**
5
+ * RcFileTransformer is used to transform the `adonisrc.ts` file
6
+ * for adding new commands, providers, meta files etc
7
+ */
8
+ export declare class RcFileTransformer {
9
+ #private;
10
+ constructor(cwd: URL, project: Project);
11
+ /**
12
+ * Add a new command to the rcFile
13
+ */
14
+ addCommand(commandPath: string): this;
15
+ /**
16
+ * Add a new preloaded file to the rcFile
17
+ */
18
+ addPreloadFile(modulePath: string, environments?: AppEnvironments[]): this;
19
+ /**
20
+ * Add a new provider to the rcFile
21
+ */
22
+ addProvider(providerPath: string, environments?: AppEnvironments[]): this;
23
+ /**
24
+ * Add a new meta file to the rcFile
25
+ */
26
+ addMetaFile(globPattern: string, reloadServer?: boolean): this;
27
+ /**
28
+ * Set directory name and path
29
+ */
30
+ setDirectory(key: string, value: string): this;
31
+ /**
32
+ * Set command alias
33
+ */
34
+ setCommandAlias(alias: string, command: string): this;
35
+ /**
36
+ * Add a new test suite to the rcFile
37
+ */
38
+ addSuite(suiteName: string, files: string | string[], timeout?: number): this;
39
+ /**
40
+ * Save the adonisrc.ts file
41
+ */
42
+ save(): Promise<void>;
43
+ }
@@ -0,0 +1,272 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ import { Node, SyntaxKind, } from 'ts-morph';
3
+ /**
4
+ * RcFileTransformer is used to transform the `adonisrc.ts` file
5
+ * for adding new commands, providers, meta files etc
6
+ */
7
+ export class RcFileTransformer {
8
+ #cwd;
9
+ #project;
10
+ /**
11
+ * Settings to use when persisting files
12
+ */
13
+ #editorSettings = {
14
+ indentSize: 2,
15
+ convertTabsToSpaces: true,
16
+ trimTrailingWhitespace: true,
17
+ };
18
+ constructor(cwd, project) {
19
+ this.#cwd = cwd;
20
+ this.#project = project;
21
+ }
22
+ /**
23
+ * Get the `adonisrc.ts` source file
24
+ */
25
+ #getRcFileOrThrow() {
26
+ const kernelUrl = fileURLToPath(new URL('./adonisrc.ts', this.#cwd));
27
+ return this.#project.getSourceFileOrThrow(kernelUrl);
28
+ }
29
+ /**
30
+ * Check if environments array has a subset of available environments
31
+ */
32
+ #isInSpecificEnvironment(environments) {
33
+ if (!environments)
34
+ return false;
35
+ return !!['web', 'console', 'test', 'repl'].find((env) => !environments.includes(env));
36
+ }
37
+ /**
38
+ * Locate the `defineConfig` call inside the `adonisrc.ts` file
39
+ */
40
+ #locateDefineConfigCallOrThrow(file) {
41
+ const call = file
42
+ .getDescendantsOfKind(SyntaxKind.CallExpression)
43
+ .find((statement) => statement.getExpression().getText() === 'defineConfig');
44
+ if (!call) {
45
+ throw new Error('Could not locate the defineConfig call.');
46
+ }
47
+ return call;
48
+ }
49
+ /**
50
+ * Return the ObjectLiteralExpression of the defineConfig call
51
+ */
52
+ #getDefineConfigObjectOrThrow(defineConfigCall) {
53
+ const configObject = defineConfigCall
54
+ .getArguments()[0]
55
+ .asKindOrThrow(SyntaxKind.ObjectLiteralExpression);
56
+ return configObject;
57
+ }
58
+ /**
59
+ * Check if the defineConfig() call has the property assignment
60
+ * inside it or not. If not, it will create one and return it.
61
+ */
62
+ #getPropertyAssignmentInDefineConfigCall(propertyName, initializer) {
63
+ const file = this.#getRcFileOrThrow();
64
+ const defineConfigCall = this.#locateDefineConfigCallOrThrow(file);
65
+ const configObject = this.#getDefineConfigObjectOrThrow(defineConfigCall);
66
+ let property = configObject.getProperty(propertyName);
67
+ if (!property) {
68
+ configObject.addPropertyAssignment({ name: propertyName, initializer });
69
+ property = configObject.getProperty(propertyName);
70
+ }
71
+ return property;
72
+ }
73
+ /**
74
+ * Extract list of imported modules from an ArrayLiteralExpression
75
+ *
76
+ * It assumes that the array can have two types of elements:
77
+ *
78
+ * - Simple lazy imported modules: [() => import('path/to/file')]
79
+ * - Or an object entry: [{ file: () => import('path/to/file'), environment: ['web', 'console'] }]
80
+ * where the `file` property is a lazy imported module.
81
+ */
82
+ #extractModulesFromArray(array) {
83
+ const modules = array.getElements().map((element) => {
84
+ /**
85
+ * Simple lazy imported module
86
+ */
87
+ if (Node.isArrowFunction(element)) {
88
+ const importExp = element.getFirstDescendantByKindOrThrow(SyntaxKind.CallExpression);
89
+ const literal = importExp.getFirstDescendantByKindOrThrow(SyntaxKind.StringLiteral);
90
+ return literal.getLiteralValue();
91
+ }
92
+ /**
93
+ * Object entry
94
+ */
95
+ if (Node.isObjectLiteralExpression(element)) {
96
+ const fileProp = element.getPropertyOrThrow('file');
97
+ const arrowFn = fileProp.getFirstDescendantByKindOrThrow(SyntaxKind.ArrowFunction);
98
+ const importExp = arrowFn.getFirstDescendantByKindOrThrow(SyntaxKind.CallExpression);
99
+ const literal = importExp.getFirstDescendantByKindOrThrow(SyntaxKind.StringLiteral);
100
+ return literal.getLiteralValue();
101
+ }
102
+ });
103
+ return modules.filter(Boolean);
104
+ }
105
+ /**
106
+ * Extract a specific property from an ArrayLiteralExpression
107
+ * that contains object entries.
108
+ *
109
+ * This function is mainly used for extractring the `pattern` property
110
+ * when adding a new meta files entry, or the `name` property when
111
+ * adding a new test suite.
112
+ */
113
+ #extractPropertyFromArray(array, propertyName) {
114
+ const property = array.getElements().map((el) => {
115
+ if (!Node.isObjectLiteralExpression(el))
116
+ return;
117
+ const nameProp = el.getPropertyOrThrow(propertyName);
118
+ if (!Node.isPropertyAssignment(nameProp))
119
+ return;
120
+ const name = nameProp.getInitializerIfKindOrThrow(SyntaxKind.StringLiteral);
121
+ return name.getLiteralValue();
122
+ });
123
+ return property.filter(Boolean);
124
+ }
125
+ /**
126
+ * Build a new module entry for the preloads and providers array
127
+ * based upon the environments specified
128
+ */
129
+ #buildNewModuleEntry(modulePath, environments) {
130
+ if (!this.#isInSpecificEnvironment(environments)) {
131
+ return `() => import('${modulePath}')`;
132
+ }
133
+ return `{
134
+ file: () => import('${modulePath}'),
135
+ environment: [${environments?.map((env) => `'${env}'`).join(', ')}],
136
+ }`;
137
+ }
138
+ /**
139
+ * Add a new command to the rcFile
140
+ */
141
+ addCommand(commandPath) {
142
+ const commandsProperty = this.#getPropertyAssignmentInDefineConfigCall('providers', '[]');
143
+ const commandsArray = commandsProperty.getInitializerIfKindOrThrow(SyntaxKind.ArrayLiteralExpression);
144
+ const commandString = `() => import('${commandPath}')`;
145
+ /**
146
+ * If the command already exists, do nothing
147
+ */
148
+ if (commandsArray.getElements().some((el) => el.getText() === commandString)) {
149
+ return this;
150
+ }
151
+ /**
152
+ * Add the command to the array
153
+ */
154
+ commandsArray.addElement(commandString);
155
+ return this;
156
+ }
157
+ /**
158
+ * Add a new preloaded file to the rcFile
159
+ */
160
+ addPreloadFile(modulePath, environments) {
161
+ const preloadsProperty = this.#getPropertyAssignmentInDefineConfigCall('preloads', '[]');
162
+ const preloadsArray = preloadsProperty.getInitializerIfKindOrThrow(SyntaxKind.ArrayLiteralExpression);
163
+ /**
164
+ * Check for duplicates
165
+ */
166
+ const existingPreloadedFiles = this.#extractModulesFromArray(preloadsArray);
167
+ const isDuplicate = existingPreloadedFiles.includes(modulePath);
168
+ if (isDuplicate) {
169
+ return this;
170
+ }
171
+ /**
172
+ * Add the preloaded file to the array
173
+ */
174
+ preloadsArray.addElement(this.#buildNewModuleEntry(modulePath, environments));
175
+ return this;
176
+ }
177
+ /**
178
+ * Add a new provider to the rcFile
179
+ */
180
+ addProvider(providerPath, environments) {
181
+ const property = this.#getPropertyAssignmentInDefineConfigCall('providers', '[]');
182
+ const providersArray = property.getInitializerIfKindOrThrow(SyntaxKind.ArrayLiteralExpression);
183
+ /**
184
+ * Check for duplicates
185
+ */
186
+ const existingProviderPaths = this.#extractModulesFromArray(providersArray);
187
+ const isDuplicate = existingProviderPaths.includes(providerPath);
188
+ if (isDuplicate) {
189
+ return this;
190
+ }
191
+ /**
192
+ * Add the provider to the array
193
+ */
194
+ providersArray.addElement(this.#buildNewModuleEntry(providerPath, environments));
195
+ return this;
196
+ }
197
+ /**
198
+ * Add a new meta file to the rcFile
199
+ */
200
+ addMetaFile(globPattern, reloadServer = false) {
201
+ const property = this.#getPropertyAssignmentInDefineConfigCall('metaFiles', '[]');
202
+ const metaFilesArray = property.getInitializerIfKindOrThrow(SyntaxKind.ArrayLiteralExpression);
203
+ /**
204
+ * Check for duplicates
205
+ */
206
+ const alreadyDefinedPatterns = this.#extractPropertyFromArray(metaFilesArray, 'pattern');
207
+ if (alreadyDefinedPatterns.includes(globPattern)) {
208
+ return this;
209
+ }
210
+ /**
211
+ * Add the meta file to the array
212
+ */
213
+ metaFilesArray.addElement(`{
214
+ pattern: '${globPattern}',
215
+ reloadServer: ${reloadServer},
216
+ }`);
217
+ return this;
218
+ }
219
+ /**
220
+ * Set directory name and path
221
+ */
222
+ setDirectory(key, value) {
223
+ const property = this.#getPropertyAssignmentInDefineConfigCall('directories', '{}');
224
+ const directories = property.getInitializerIfKindOrThrow(SyntaxKind.ObjectLiteralExpression);
225
+ directories.addPropertyAssignment({ name: key, initializer: `'${value}'` });
226
+ return this;
227
+ }
228
+ /**
229
+ * Set command alias
230
+ */
231
+ setCommandAlias(alias, command) {
232
+ const aliasProperty = this.#getPropertyAssignmentInDefineConfigCall('commandsAliases', '{}');
233
+ const aliases = aliasProperty.getInitializerIfKindOrThrow(SyntaxKind.ObjectLiteralExpression);
234
+ aliases.addPropertyAssignment({ name: alias, initializer: `'${command}'` });
235
+ return this;
236
+ }
237
+ /**
238
+ * Add a new test suite to the rcFile
239
+ */
240
+ addSuite(suiteName, files, timeout) {
241
+ const testProperty = this.#getPropertyAssignmentInDefineConfigCall('tests', `{ suites: [], forceExit: true, timeout: 2000 }`);
242
+ const property = testProperty
243
+ .getInitializerIfKindOrThrow(SyntaxKind.ObjectLiteralExpression)
244
+ .getPropertyOrThrow('suites');
245
+ const suitesArray = property.getInitializerIfKindOrThrow(SyntaxKind.ArrayLiteralExpression);
246
+ /**
247
+ * Check for duplicates
248
+ */
249
+ const existingSuitesNames = this.#extractPropertyFromArray(suitesArray, 'name');
250
+ if (existingSuitesNames.includes(suiteName)) {
251
+ return this;
252
+ }
253
+ /**
254
+ * Add the suite to the array
255
+ */
256
+ const filesArray = Array.isArray(files) ? files : [files];
257
+ suitesArray.addElement(`{
258
+ name: '${suiteName}',
259
+ files: [${filesArray.map((file) => `'${file}'`).join(', ')}],
260
+ timeout: ${timeout ?? 2000},
261
+ }`);
262
+ return this;
263
+ }
264
+ /**
265
+ * Save the adonisrc.ts file
266
+ */
267
+ save() {
268
+ const file = this.#getRcFileOrThrow();
269
+ file.formatText(this.#editorSettings);
270
+ return file.save();
271
+ }
272
+ }
@@ -92,3 +92,47 @@ export type BundlerOptions = {
92
92
  metaFiles?: MetaFile[];
93
93
  assets?: AssetsBundlerOptions;
94
94
  };
95
+ /**
96
+ * Entry to add a middleware to a given middleware stack
97
+ * via the CodeTransformer
98
+ */
99
+ export type AddMiddlewareEntry = {
100
+ /**
101
+ * If you are adding a named middleware, then you must
102
+ * define the name.
103
+ */
104
+ name?: string;
105
+ /**
106
+ * The path to the middleware file
107
+ *
108
+ * @example
109
+ * `@adonisjs/static/static_middleware`
110
+ * `#middlewares/silent_auth.js`
111
+ */
112
+ path: string;
113
+ /**
114
+ * The position to add the middleware. If `before`
115
+ * middleware will be added at the first position and
116
+ * therefore will be run before all others
117
+ *
118
+ * @default 'after'
119
+ */
120
+ position?: 'before' | 'after';
121
+ };
122
+ /**
123
+ * Defines the structure of an environment variable validation
124
+ * definition
125
+ */
126
+ export type EnvValidationDefinition = {
127
+ /**
128
+ * Write a leading comment on top of your variables
129
+ */
130
+ leadingComment?: string;
131
+ /**
132
+ * A key-value pair of env variables and their validation
133
+ *
134
+ * @example
135
+ * MY_VAR: 'Env.schema.string.optional()'
136
+ */
137
+ variables: Record<string, string>;
138
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adonisjs/assembler",
3
3
  "description": "Provides utilities to run AdonisJS development server and build project for production",
4
- "version": "6.1.3-17",
4
+ "version": "6.1.3-19",
5
5
  "engines": {
6
6
  "node": ">=18.16.0"
7
7
  },
@@ -14,6 +14,7 @@
14
14
  ],
15
15
  "exports": {
16
16
  ".": "./build/index.js",
17
+ "./code_transformer": "./build/src/code_transformer/main.js",
17
18
  "./types": "./build/src/types.js"
18
19
  },
19
20
  "scripts": {
@@ -29,9 +30,10 @@
29
30
  "sync-labels": "github-label-sync --labels .github/labels.json adonisjs/assembler",
30
31
  "format": "prettier --write .",
31
32
  "prepublishOnly": "npm run build",
32
- "quick:test": "node --loader=ts-node/esm bin/test.ts"
33
+ "quick:test": "node --enable-source-maps --loader=ts-node/esm bin/test.ts"
33
34
  },
34
35
  "devDependencies": {
36
+ "@adonisjs/application": "^7.1.2-12",
35
37
  "@adonisjs/eslint-config": "^1.1.8",
36
38
  "@adonisjs/prettier-config": "^1.1.8",
37
39
  "@adonisjs/tsconfig": "^1.1.8",
@@ -40,11 +42,13 @@
40
42
  "@japa/assert": "^2.0.0-1",
41
43
  "@japa/file-system": "^2.0.0-1",
42
44
  "@japa/runner": "^3.0.0-6",
45
+ "@japa/snapshot": "2.0.0-1",
43
46
  "@swc/core": "^1.3.71",
44
47
  "@types/node": "^20.4.5",
45
48
  "@types/picomatch": "^2.3.0",
46
49
  "c8": "^8.0.1",
47
50
  "cross-env": "^7.0.3",
51
+ "dedent": "^1.5.1",
48
52
  "del-cli": "^5.0.0",
49
53
  "eslint": "^8.45.0",
50
54
  "github-label-sync": "^2.3.1",
@@ -65,7 +69,8 @@
65
69
  "get-port": "^7.0.0",
66
70
  "junk": "^4.0.1",
67
71
  "picomatch": "^2.3.1",
68
- "slash": "^5.1.0"
72
+ "slash": "^5.1.0",
73
+ "ts-morph": "^19.0.0"
69
74
  },
70
75
  "peerDependencies": {
71
76
  "typescript": "^4.0.0 || ^5.0.0"