Skip to content

Commit 51a58cf

Browse files
authored
Merge pull request #74 from adonisjs/refactor/project-public
refactor: make `project` public in `CodeTransformer`
2 parents f7f314a + 5a476d6 commit 51a58cf

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/code_transformer/main.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class CodeTransformer {
4242
/**
4343
* The TsMorph project
4444
*/
45-
#project: Project
45+
project: Project
4646

4747
/**
4848
* Settings to use when persisting files
@@ -59,7 +59,7 @@ export class CodeTransformer {
5959

6060
constructor(cwd: URL) {
6161
this.#cwd = cwd
62-
this.#project = new Project({
62+
this.project = new Project({
6363
tsConfigFilePath: join(fileURLToPath(this.#cwd), 'tsconfig.json'),
6464
manipulationSettings: { quoteKind: QuoteKind.Single },
6565
})
@@ -232,7 +232,7 @@ export class CodeTransformer {
232232
* Get the `start/env.ts` source file
233233
*/
234234
const kernelUrl = fileURLToPath(new URL('./start/env.ts', this.#cwd))
235-
const file = this.#project.getSourceFileOrThrow(kernelUrl)
235+
const file = this.project.getSourceFileOrThrow(kernelUrl)
236236

237237
/**
238238
* Get the `Env.create` call expression
@@ -305,7 +305,7 @@ export class CodeTransformer {
305305
* Get the `start/kernel.ts` source file
306306
*/
307307
const kernelUrl = fileURLToPath(new URL('./start/kernel.ts', this.#cwd))
308-
const file = this.#project.getSourceFileOrThrow(kernelUrl)
308+
const file = this.project.getSourceFileOrThrow(kernelUrl)
309309

310310
/**
311311
* Process each middleware entry
@@ -326,7 +326,7 @@ export class CodeTransformer {
326326
* Update the `adonisrc.ts` file
327327
*/
328328
async updateRcFile(callback: (transformer: RcFileTransformer) => void) {
329-
const rcFileTransformer = new RcFileTransformer(this.#cwd, this.#project)
329+
const rcFileTransformer = new RcFileTransformer(this.#cwd, this.project)
330330
callback(rcFileTransformer)
331331
await rcFileTransformer.save()
332332
}
@@ -342,7 +342,7 @@ export class CodeTransformer {
342342
* Get the `tests/bootstrap.ts` source file
343343
*/
344344
const testBootstrapUrl = fileURLToPath(new URL('./tests/bootstrap.ts', this.#cwd))
345-
const file = this.#project.getSourceFileOrThrow(testBootstrapUrl)
345+
const file = this.project.getSourceFileOrThrow(testBootstrapUrl)
346346

347347
/**
348348
* Add the import declarations
@@ -381,7 +381,7 @@ export class CodeTransformer {
381381
*/
382382
const viteConfigTsUrl = fileURLToPath(new URL('./vite.config.ts', this.#cwd))
383383

384-
const file = this.#project.getSourceFile(viteConfigTsUrl)
384+
const file = this.project.getSourceFile(viteConfigTsUrl)
385385
if (!file) {
386386
throw new Error(
387387
'Cannot find vite.config.ts file. Make sure to rename vite.config.js to vite.config.ts'
@@ -429,7 +429,7 @@ export class CodeTransformer {
429429
* Get the `app/policies/main.ts` source file
430430
*/
431431
const kernelUrl = fileURLToPath(new URL('./app/policies/main.ts', this.#cwd))
432-
const file = this.#project.getSourceFileOrThrow(kernelUrl)
432+
const file = this.project.getSourceFileOrThrow(kernelUrl)
433433

434434
/**
435435
* Process each middleware entry

0 commit comments

Comments
 (0)