@adonisjs/assembler 7.8.2 → 8.0.0-next.1

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.
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/code_transformer/main.ts","../../../src/code_transformer/rc_file_transformer.ts"],"sourcesContent":["/*\n * @adonisjs/assembler\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { join } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { installPackage, detectPackageManager } from '@antfu/install-pkg'\nimport {\n Node,\n Project,\n QuoteKind,\n SourceFile,\n SyntaxKind,\n CodeBlockWriter,\n FormatCodeSettings,\n} from 'ts-morph'\n\nimport { RcFileTransformer } from './rc_file_transformer.js'\nimport type { MiddlewareNode, EnvValidationNode, BouncerPolicyNode } from '../types.js'\n\n/**\n * This class is responsible for updating\n */\nexport class CodeTransformer {\n /**\n * Exporting utilities to install package and detect\n * the package manager\n */\n installPackage = installPackage\n detectPackageManager = detectPackageManager\n\n /**\n * Directory of the adonisjs project\n */\n #cwd: URL\n\n /**\n * The TsMorph project\n */\n project: Project\n\n /**\n * Settings to use when persisting files\n */\n #editorSettings: FormatCodeSettings = {\n indentSize: 2,\n convertTabsToSpaces: true,\n trimTrailingWhitespace: true,\n ensureNewLineAtEndOfFile: true,\n indentStyle: 2,\n // @ts-expect-error SemicolonPreference doesn't seem to be re-exported from ts-morph\n semicolons: 'remove',\n }\n\n constructor(cwd: URL) {\n this.#cwd = cwd\n this.project = new Project({\n tsConfigFilePath: join(fileURLToPath(this.#cwd), 'tsconfig.json'),\n manipulationSettings: { quoteKind: QuoteKind.Single },\n })\n }\n\n /**\n * Add a new middleware to the middleware array of the\n * given file\n */\n #addToMiddlewareArray(file: SourceFile, target: string, middlewareEntry: MiddlewareNode) {\n const callExpressions = file\n .getDescendantsOfKind(SyntaxKind.CallExpression)\n .filter((statement) => statement.getExpression().getText() === target)\n\n if (!callExpressions.length) {\n throw new Error(`Cannot find ${target} statement in the file.`)\n }\n\n const arrayLiteralExpression = callExpressions[0].getArguments()[0]\n if (!arrayLiteralExpression || !Node.isArrayLiteralExpression(arrayLiteralExpression)) {\n throw new Error(`Cannot find middleware array in ${target} statement.`)\n }\n\n const middleware = `() => import('${middlewareEntry.path}')`\n\n /**\n * Delete the existing middleware if it exists\n */\n const existingMiddlewareIndex = arrayLiteralExpression\n .getElements()\n .findIndex((element) => element.getText() === middleware)\n\n if (existingMiddlewareIndex === -1) {\n /**\n * Add the middleware to the top or bottom of the array\n */\n if (middlewareEntry.position === 'before') {\n arrayLiteralExpression.insertElement(0, middleware)\n } else {\n arrayLiteralExpression.addElement(middleware)\n }\n }\n }\n\n /**\n * Add a new middleware to the named middleware of the given file\n */\n #addToNamedMiddleware(file: SourceFile, middlewareEntry: MiddlewareNode) {\n if (!middlewareEntry.name) {\n throw new Error('Named middleware requires a name.')\n }\n\n const callArguments = file\n .getVariableDeclarationOrThrow('middleware')\n .getInitializerIfKindOrThrow(SyntaxKind.CallExpression)\n .getArguments()\n\n if (callArguments.length === 0) {\n throw new Error('Named middleware call has no arguments.')\n }\n\n const namedMiddlewareObject = callArguments[0]\n if (!Node.isObjectLiteralExpression(namedMiddlewareObject)) {\n throw new Error('The argument of the named middleware call is not an object literal.')\n }\n\n /**\n * Check if property is already defined. If so, remove it\n */\n const existingProperty = namedMiddlewareObject.getProperty(middlewareEntry.name)\n if (!existingProperty) {\n /**\n * Add the named middleware\n */\n const middleware = `${middlewareEntry.name}: () => import('${middlewareEntry.path}')`\n namedMiddlewareObject!.insertProperty(0, middleware)\n }\n }\n\n /**\n * Add a policy to the list of pre-registered policy\n */\n #addToPoliciesList(file: SourceFile, policyEntry: BouncerPolicyNode) {\n const policiesObject = file\n .getVariableDeclarationOrThrow('policies')\n .getInitializerIfKindOrThrow(SyntaxKind.ObjectLiteralExpression)\n\n /**\n * Only define policy when one with the existing name does not\n * exist.\n */\n const existingProperty = policiesObject.getProperty(policyEntry.name)\n if (!existingProperty) {\n const policy = `${policyEntry.name}: () => import('${policyEntry.path}')`\n policiesObject!.insertProperty(0, policy)\n }\n }\n\n /**\n * Add the given import declarations to the source file\n * and merge named imports with the existing import\n */\n #addImportDeclarations(\n file: SourceFile,\n importDeclarations: { isNamed: boolean; module: string; identifier: string }[]\n ) {\n const existingImports = file.getImportDeclarations()\n\n importDeclarations.forEach((importDeclaration) => {\n const existingImport = existingImports.find(\n (mod) => mod.getModuleSpecifierValue() === importDeclaration.module\n )\n\n /**\n * Add a new named import to existing import for the\n * same module\n */\n if (existingImport && importDeclaration.isNamed) {\n if (\n !existingImport\n .getNamedImports()\n .find((namedImport) => namedImport.getName() === importDeclaration.identifier)\n ) {\n existingImport.addNamedImport(importDeclaration.identifier)\n }\n return\n }\n\n /**\n * Ignore default import when the same module is already imported.\n * The chances are the existing default import and the importDeclaration\n * identifiers are not the same. But we should not modify existing source\n */\n if (existingImport) {\n return\n }\n\n file.addImportDeclaration({\n ...(importDeclaration.isNamed\n ? { namedImports: [importDeclaration.identifier] }\n : { defaultImport: importDeclaration.identifier }),\n moduleSpecifier: importDeclaration.module,\n })\n })\n }\n\n /**\n * Write a leading comment\n */\n #addLeadingComment(writer: CodeBlockWriter, comment?: string) {\n if (!comment) {\n return writer.blankLine()\n }\n\n return writer\n .blankLine()\n .writeLine('/*')\n .writeLine(`|----------------------------------------------------------`)\n .writeLine(`| ${comment}`)\n .writeLine(`|----------------------------------------------------------`)\n .writeLine(`*/`)\n }\n\n /**\n * Add new env variable validation in the\n * `env.ts` file\n */\n async defineEnvValidations(definition: EnvValidationNode) {\n /**\n * Get the `start/env.ts` source file\n */\n const kernelUrl = fileURLToPath(new URL('./start/env.ts', this.#cwd))\n const file = this.project.getSourceFileOrThrow(kernelUrl)\n\n /**\n * Get the `Env.create` call expression\n */\n const callExpressions = file\n .getDescendantsOfKind(SyntaxKind.CallExpression)\n .filter((statement) => statement.getExpression().getText() === 'Env.create')\n\n if (!callExpressions.length) {\n throw new Error(`Cannot find Env.create statement in the file.`)\n }\n\n const objectLiteralExpression = callExpressions[0].getArguments()[1]\n if (!Node.isObjectLiteralExpression(objectLiteralExpression)) {\n throw new Error(`The second argument of Env.create is not an object literal.`)\n }\n\n let shouldAddComment = true\n\n /**\n * Add each variable validation\n */\n for (const [variable, validation] of Object.entries(definition.variables)) {\n /**\n * Check if the variable is already defined. If so, remove it\n */\n const existingProperty = objectLiteralExpression.getProperty(variable)\n\n /**\n * Do not add leading comment if one or more properties\n * already exists\n */\n if (existingProperty) {\n shouldAddComment = false\n }\n\n /**\n * Add property only when the property does not exist\n */\n if (!existingProperty) {\n objectLiteralExpression.addPropertyAssignment({\n name: variable,\n initializer: validation,\n leadingTrivia: (writer) => {\n if (!shouldAddComment) {\n return\n }\n\n shouldAddComment = false\n return this.#addLeadingComment(writer, definition.leadingComment)\n },\n })\n }\n }\n\n file.formatText(this.#editorSettings)\n await file.save()\n }\n\n /**\n * Define new middlewares inside the `start/kernel.ts`\n * file\n *\n * This function is highly based on some assumptions\n * and will not work if you significantly tweaked\n * your `start/kernel.ts` file.\n */\n async addMiddlewareToStack(stack: 'server' | 'router' | 'named', middleware: MiddlewareNode[]) {\n /**\n * Get the `start/kernel.ts` source file\n */\n const kernelUrl = fileURLToPath(new URL('./start/kernel.ts', this.#cwd))\n const file = this.project.getSourceFileOrThrow(kernelUrl)\n\n /**\n * Process each middleware entry\n */\n for (const middlewareEntry of middleware) {\n if (stack === 'named') {\n this.#addToNamedMiddleware(file, middlewareEntry)\n } else {\n this.#addToMiddlewareArray(file!, `${stack}.use`, middlewareEntry)\n }\n }\n\n file.formatText(this.#editorSettings)\n await file.save()\n }\n\n /**\n * Update the `adonisrc.ts` file\n */\n async updateRcFile(callback: (transformer: RcFileTransformer) => void) {\n const rcFileTransformer = new RcFileTransformer(this.#cwd, this.project)\n callback(rcFileTransformer)\n await rcFileTransformer.save()\n }\n\n /**\n * Add a new Japa plugin in the `tests/bootstrap.ts` file\n */\n async addJapaPlugin(\n pluginCall: string,\n importDeclarations: { isNamed: boolean; module: string; identifier: string }[]\n ) {\n /**\n * Get the `tests/bootstrap.ts` source file\n */\n const testBootstrapUrl = fileURLToPath(new URL('./tests/bootstrap.ts', this.#cwd))\n const file = this.project.getSourceFileOrThrow(testBootstrapUrl)\n\n /**\n * Add the import declarations\n */\n this.#addImportDeclarations(file, importDeclarations)\n\n /**\n * Insert the plugin call in the `plugins` array\n */\n const pluginsArray = file\n .getVariableDeclaration('plugins')\n ?.getInitializerIfKind(SyntaxKind.ArrayLiteralExpression)\n\n /**\n * Add plugin call to the plugins array\n */\n if (pluginsArray) {\n if (!pluginsArray.getElements().find((element) => element.getText() === pluginCall)) {\n pluginsArray.addElement(pluginCall)\n }\n }\n\n file.formatText(this.#editorSettings)\n await file.save()\n }\n\n /**\n * Add a new Vite plugin\n */\n async addVitePlugin(\n pluginCall: string,\n importDeclarations: { isNamed: boolean; module: string; identifier: string }[]\n ) {\n /**\n * Get the `vite.config.ts` source file\n */\n const viteConfigTsUrl = fileURLToPath(new URL('./vite.config.ts', this.#cwd))\n\n const file = this.project.getSourceFile(viteConfigTsUrl)\n if (!file) {\n throw new Error(\n 'Cannot find vite.config.ts file. Make sure to rename vite.config.js to vite.config.ts'\n )\n }\n\n /**\n * Add the import declarations\n */\n this.#addImportDeclarations(file, importDeclarations)\n\n /**\n * Get the default export options\n */\n const defaultExport = file.getDefaultExportSymbol()\n if (!defaultExport) {\n throw new Error('Cannot find the default export in vite.config.ts')\n }\n\n /**\n * Get the options object\n * - Either the first argument of `defineConfig` call : `export default defineConfig({})`\n * - Or child literal expression of the default export : `export default {}`\n */\n const declaration = defaultExport.getDeclarations()[0]\n const options =\n declaration.getChildrenOfKind(SyntaxKind.ObjectLiteralExpression)[0] ||\n declaration.getChildrenOfKind(SyntaxKind.CallExpression)[0].getArguments()[0]\n\n const pluginsArray = options\n .getPropertyOrThrow('plugins')\n .getFirstChildByKindOrThrow(SyntaxKind.ArrayLiteralExpression)\n\n /**\n * Add plugin call to the plugins array\n */\n if (!pluginsArray.getElements().find((element) => element.getText() === pluginCall)) {\n pluginsArray.addElement(pluginCall)\n }\n\n file.formatText(this.#editorSettings)\n await file.save()\n }\n\n /**\n * Adds a policy to the list of `policies` object configured\n * inside the `app/policies/main.ts` file.\n */\n async addPolicies(policies: BouncerPolicyNode[]) {\n /**\n * Get the `app/policies/main.ts` source file\n */\n const kernelUrl = fileURLToPath(new URL('./app/policies/main.ts', this.#cwd))\n const file = this.project.getSourceFileOrThrow(kernelUrl)\n\n /**\n * Process each middleware entry\n */\n for (const policy of policies) {\n this.#addToPoliciesList(file, policy)\n }\n\n file.formatText(this.#editorSettings)\n await file.save()\n }\n}\n","/*\n * @adonisjs/assembler\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { fileURLToPath } from 'node:url'\nimport type { AppEnvironments, RcFile } from '@adonisjs/application/types'\nimport {\n Node,\n Project,\n SourceFile,\n SyntaxKind,\n CallExpression,\n PropertyAssignment,\n FormatCodeSettings,\n ArrayLiteralExpression,\n} from 'ts-morph'\n\n/**\n * RcFileTransformer is used to transform the `adonisrc.ts` file\n * for adding new commands, providers, meta files etc\n */\nexport class RcFileTransformer {\n #cwd: URL\n #project: Project\n\n /**\n * Settings to use when persisting files\n */\n #editorSettings: FormatCodeSettings = {\n indentSize: 2,\n convertTabsToSpaces: true,\n trimTrailingWhitespace: true,\n ensureNewLineAtEndOfFile: true,\n indentStyle: 2,\n // @ts-expect-error SemicolonPreference doesn't seem to be re-exported from ts-morph\n semicolons: 'remove',\n }\n\n constructor(cwd: URL, project: Project) {\n this.#cwd = cwd\n this.#project = project\n }\n\n /**\n * Get the `adonisrc.ts` source file\n */\n #getRcFileOrThrow() {\n const kernelUrl = fileURLToPath(new URL('./adonisrc.ts', this.#cwd))\n return this.#project.getSourceFileOrThrow(kernelUrl)\n }\n\n /**\n * Check if environments array has a subset of available environments\n */\n #isInSpecificEnvironment(environments?: AppEnvironments[]): boolean {\n if (!environments) {\n return false\n }\n\n return !!(['web', 'console', 'test', 'repl'] as const).find(\n (env) => !environments.includes(env)\n )\n }\n\n /**\n * Locate the `defineConfig` call inside the `adonisrc.ts` file\n */\n #locateDefineConfigCallOrThrow(file: SourceFile) {\n const call = file\n .getDescendantsOfKind(SyntaxKind.CallExpression)\n .find((statement) => statement.getExpression().getText() === 'defineConfig')\n\n if (!call) {\n throw new Error('Could not locate the defineConfig call.')\n }\n\n return call\n }\n\n /**\n * Return the ObjectLiteralExpression of the defineConfig call\n */\n #getDefineConfigObjectOrThrow(defineConfigCall: CallExpression) {\n const configObject = defineConfigCall\n .getArguments()[0]\n .asKindOrThrow(SyntaxKind.ObjectLiteralExpression)\n\n return configObject\n }\n\n /**\n * Check if the defineConfig() call has the property assignment\n * inside it or not. If not, it will create one and return it.\n */\n #getPropertyAssignmentInDefineConfigCall(propertyName: string, initializer: string) {\n const file = this.#getRcFileOrThrow()\n const defineConfigCall = this.#locateDefineConfigCallOrThrow(file)\n const configObject = this.#getDefineConfigObjectOrThrow(defineConfigCall)\n\n let property = configObject.getProperty(propertyName)\n\n if (!property) {\n configObject.addPropertyAssignment({ name: propertyName, initializer })\n property = configObject.getProperty(propertyName)\n }\n\n return property as PropertyAssignment\n }\n\n /**\n * Extract list of imported modules from an ArrayLiteralExpression\n *\n * It assumes that the array can have two types of elements:\n *\n * - Simple lazy imported modules: [() => import('path/to/file')]\n * - Or an object entry: [{ file: () => import('path/to/file'), environment: ['web', 'console'] }]\n * where the `file` property is a lazy imported module.\n */\n #extractModulesFromArray(array: ArrayLiteralExpression) {\n const modules = array.getElements().map((element) => {\n /**\n * Simple lazy imported module\n */\n if (Node.isArrowFunction(element)) {\n const importExp = element.getFirstDescendantByKindOrThrow(SyntaxKind.CallExpression)\n const literal = importExp.getFirstDescendantByKindOrThrow(SyntaxKind.StringLiteral)\n return literal.getLiteralValue()\n }\n\n /**\n * Object entry\n */\n if (Node.isObjectLiteralExpression(element)) {\n const fileProp = element.getPropertyOrThrow('file') as PropertyAssignment\n const arrowFn = fileProp.getFirstDescendantByKindOrThrow(SyntaxKind.ArrowFunction)\n const importExp = arrowFn.getFirstDescendantByKindOrThrow(SyntaxKind.CallExpression)\n const literal = importExp.getFirstDescendantByKindOrThrow(SyntaxKind.StringLiteral)\n return literal.getLiteralValue()\n }\n })\n\n return modules.filter(Boolean) as string[]\n }\n\n /**\n * Extract a specific property from an ArrayLiteralExpression\n * that contains object entries.\n *\n * This function is mainly used for extractring the `pattern` property\n * when adding a new meta files entry, or the `name` property when\n * adding a new test suite.\n */\n #extractPropertyFromArray(array: ArrayLiteralExpression, propertyName: string) {\n const property = array.getElements().map((el) => {\n if (!Node.isObjectLiteralExpression(el)) return\n\n const nameProp = el.getPropertyOrThrow(propertyName)\n if (!Node.isPropertyAssignment(nameProp)) return\n\n const name = nameProp.getInitializerIfKindOrThrow(SyntaxKind.StringLiteral)\n return name.getLiteralValue()\n })\n\n return property.filter(Boolean) as string[]\n }\n\n /**\n * Build a new module entry for the preloads and providers array\n * based upon the environments specified\n */\n #buildNewModuleEntry(modulePath: string, environments?: AppEnvironments[]) {\n if (!this.#isInSpecificEnvironment(environments)) {\n return `() => import('${modulePath}')`\n }\n\n return `{\n file: () => import('${modulePath}'),\n environment: [${environments?.map((env) => `'${env}'`).join(', ')}],\n }`\n }\n\n /**\n * Add a new command to the rcFile\n */\n addCommand(commandPath: string) {\n const commandsProperty = this.#getPropertyAssignmentInDefineConfigCall('commands', '[]')\n const commandsArray = commandsProperty.getInitializerIfKindOrThrow(\n SyntaxKind.ArrayLiteralExpression\n )\n\n const commandString = `() => import('${commandPath}')`\n\n /**\n * If the command already exists, do nothing\n */\n if (commandsArray.getElements().some((el) => el.getText() === commandString)) {\n return this\n }\n\n /**\n * Add the command to the array\n */\n commandsArray.addElement(commandString)\n return this\n }\n\n /**\n * Add a new preloaded file to the rcFile\n */\n addPreloadFile(modulePath: string, environments?: AppEnvironments[]) {\n const preloadsProperty = this.#getPropertyAssignmentInDefineConfigCall('preloads', '[]')\n const preloadsArray = preloadsProperty.getInitializerIfKindOrThrow(\n SyntaxKind.ArrayLiteralExpression\n )\n\n /**\n * Check for duplicates\n */\n const existingPreloadedFiles = this.#extractModulesFromArray(preloadsArray)\n const isDuplicate = existingPreloadedFiles.includes(modulePath)\n if (isDuplicate) {\n return this\n }\n\n /**\n * Add the preloaded file to the array\n */\n preloadsArray.addElement(this.#buildNewModuleEntry(modulePath, environments))\n return this\n }\n\n /**\n * Add a new provider to the rcFile\n */\n addProvider(providerPath: string, environments?: AppEnvironments[]) {\n const property = this.#getPropertyAssignmentInDefineConfigCall('providers', '[]')\n const providersArray = property.getInitializerIfKindOrThrow(SyntaxKind.ArrayLiteralExpression)\n\n /**\n * Check for duplicates\n */\n const existingProviderPaths = this.#extractModulesFromArray(providersArray)\n const isDuplicate = existingProviderPaths.includes(providerPath)\n if (isDuplicate) {\n return this\n }\n\n /**\n * Add the provider to the array\n */\n providersArray.addElement(this.#buildNewModuleEntry(providerPath, environments))\n\n return this\n }\n\n /**\n * Add a new meta file to the rcFile\n */\n addMetaFile(globPattern: string, reloadServer = false) {\n const property = this.#getPropertyAssignmentInDefineConfigCall('metaFiles', '[]')\n const metaFilesArray = property.getInitializerIfKindOrThrow(SyntaxKind.ArrayLiteralExpression)\n\n /**\n * Check for duplicates\n */\n const alreadyDefinedPatterns = this.#extractPropertyFromArray(metaFilesArray, 'pattern')\n if (alreadyDefinedPatterns.includes(globPattern)) {\n return this\n }\n\n /**\n * Add the meta file to the array\n */\n metaFilesArray.addElement(\n `{\n pattern: '${globPattern}',\n reloadServer: ${reloadServer},\n }`\n )\n\n return this\n }\n\n /**\n * Set directory name and path\n */\n setDirectory(key: string, value: string) {\n const property = this.#getPropertyAssignmentInDefineConfigCall('directories', '{}')\n const directories = property.getInitializerIfKindOrThrow(SyntaxKind.ObjectLiteralExpression)\n directories.addPropertyAssignment({ name: key, initializer: `'${value}'` })\n\n return this\n }\n\n /**\n * Set command alias\n */\n setCommandAlias(alias: string, command: string) {\n const aliasProperty = this.#getPropertyAssignmentInDefineConfigCall('commandsAliases', '{}')\n const aliases = aliasProperty.getInitializerIfKindOrThrow(SyntaxKind.ObjectLiteralExpression)\n aliases.addPropertyAssignment({ name: alias, initializer: `'${command}'` })\n\n return this\n }\n\n /**\n * Add a new test suite to the rcFile\n */\n addSuite(suiteName: string, files: string | string[], timeout?: number) {\n const testProperty = this.#getPropertyAssignmentInDefineConfigCall(\n 'tests',\n `{ suites: [], forceExit: true, timeout: 2000 }`\n )\n\n const property = testProperty\n .getInitializerIfKindOrThrow(SyntaxKind.ObjectLiteralExpression)\n .getPropertyOrThrow('suites') as PropertyAssignment\n\n const suitesArray = property.getInitializerIfKindOrThrow(SyntaxKind.ArrayLiteralExpression)\n\n /**\n * Check for duplicates\n */\n const existingSuitesNames = this.#extractPropertyFromArray(suitesArray, 'name')\n if (existingSuitesNames.includes(suiteName)) {\n return this\n }\n\n /**\n * Add the suite to the array\n */\n const filesArray = Array.isArray(files) ? files : [files]\n suitesArray.addElement(\n `{\n name: '${suiteName}',\n files: [${filesArray.map((file) => `'${file}'`).join(', ')}],\n timeout: ${timeout ?? 2000},\n }`\n )\n\n return this\n }\n\n /**\n * Add a new assembler hook\n */\n addAssemblerHook(type: keyof NonNullable<RcFile['hooks']>, path: string) {\n const hooksProperty = this.#getPropertyAssignmentInDefineConfigCall('hooks', '{}')\n\n const hooks = hooksProperty.getInitializerIfKindOrThrow(SyntaxKind.ObjectLiteralExpression)\n let hookArray = hooks.getProperty(type) as PropertyAssignment\n if (!hookArray) {\n hooks.addPropertyAssignment({ name: type, initializer: '[]' })\n hookArray = hooks.getProperty(type) as PropertyAssignment\n }\n\n const hooksArray = hookArray.getInitializerIfKindOrThrow(SyntaxKind.ArrayLiteralExpression)\n const existingHooks = this.#extractModulesFromArray(hooksArray)\n if (existingHooks.includes(path)) {\n return this\n }\n\n hooksArray.addElement(`() => import('${path}')`)\n\n return this\n }\n\n /**\n * Save the adonisrc.ts file\n */\n save() {\n const file = this.#getRcFileOrThrow()\n file.formatText(this.#editorSettings)\n return file.save()\n }\n}\n"],"mappings":";AASA,SAAS,YAAY;AACrB,SAAS,iBAAAA,sBAAqB;AAC9B,SAAS,gBAAgB,4BAA4B;AACrD;AAAA,EACE,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA;AAAA,EAEA,cAAAC;AAAA,OAGK;;;ACXP,SAAS,qBAAqB;AAE9B;AAAA,EACE;AAAA,EAGA;AAAA,OAKK;AAMA,IAAM,oBAAN,MAAwB;AAAA,EAC7B;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAKA,kBAAsC;AAAA,IACpC,YAAY;AAAA,IACZ,qBAAqB;AAAA,IACrB,wBAAwB;AAAA,IACxB,0BAA0B;AAAA,IAC1B,aAAa;AAAA;AAAA,IAEb,YAAY;AAAA,EACd;AAAA,EAEA,YAAY,KAAU,SAAkB;AACtC,SAAK,OAAO;AACZ,SAAK,WAAW;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA,EAKA,oBAAoB;AAClB,UAAM,YAAY,cAAc,IAAI,IAAI,iBAAiB,KAAK,IAAI,CAAC;AACnE,WAAO,KAAK,SAAS,qBAAqB,SAAS;AAAA,EACrD;AAAA;AAAA;AAAA;AAAA,EAKA,yBAAyB,cAA2C;AAClE,QAAI,CAAC,cAAc;AACjB,aAAO;AAAA,IACT;AAEA,WAAO,CAAC,CAAE,CAAC,OAAO,WAAW,QAAQ,MAAM,EAAY;AAAA,MACrD,CAAC,QAAQ,CAAC,aAAa,SAAS,GAAG;AAAA,IACrC;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,+BAA+B,MAAkB;AAC/C,UAAM,OAAO,KACV,qBAAqB,WAAW,cAAc,EAC9C,KAAK,CAAC,cAAc,UAAU,cAAc,EAAE,QAAQ,MAAM,cAAc;AAE7E,QAAI,CAAC,MAAM;AACT,YAAM,IAAI,MA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C,UAAM,YAAYD,eAAc,IAAI,IAAI,0BAA0B,KAAK,IAAI,CAAC;AAC5E,UAAM,OAAO,KAAK,QAAQ,qBAAqB,SAAS;AAKxD,eAAW,UAAU,UAAU;AAC7B,WAAK,mBAAmB,MAAM,MAAM;AAAA,IACtC;AAEA,SAAK,WAAW,KAAK,eAAe;AACpC,UAAM,KAAK,KAAK;AAAA,EAClB;AACF;","names":["fileURLToPath","Node","Project","SyntaxKind","Project","fileURLToPath","SyntaxKind","Node"]}
@@ -1,29 +0,0 @@
1
- import { RcFile, AssemblerHookHandler, SourceFileChangedHookHandler } from '@adonisjs/application/types';
2
- export declare class AssemblerHooks {
3
- #private;
4
- constructor(config: RcFile['hooks']);
5
- /**
6
- * Resolve hooks needed for dev-time and register them to the Hooks instance
7
- */
8
- registerDevServerHooks(): Promise<void>;
9
- /**
10
- * Resolve hooks needed for build-time and register them to the Hooks instance
11
- */
12
- registerBuildHooks(): Promise<void>;
13
- /**
14
- * When the dev server is started
15
- */
16
- onDevServerStarted(...args: Parameters<AssemblerHookHandler>): Promise<void>;
17
- /**
18
- * When a source file changes
19
- */
20
- onSourceFileChanged(...args: Parameters<SourceFileChangedHookHandler>): Promise<void>;
21
- /**
22
- * When the build process is starting
23
- */
24
- onBuildStarting(...args: Parameters<AssemblerHookHandler>): Promise<void>;
25
- /**
26
- * When the build process is completed
27
- */
28
- onBuildCompleted(...args: Parameters<AssemblerHookHandler>): Promise<void>;
29
- }
@@ -1,245 +0,0 @@
1
- import type { RcFile } from '@adonisjs/application/types';
2
- /**
3
- * Options needed to run a script file
4
- */
5
- export type RunOptions = {
6
- /**
7
- * Script to run
8
- */
9
- script: string;
10
- /**
11
- * Arguments to pass to the script
12
- */
13
- scriptArgs: string[];
14
- /**
15
- * Arguments to pass to NodeJS CLI
16
- */
17
- nodeArgs: string[];
18
- /**
19
- * Standard input ouput stream options
20
- */
21
- stdio?: 'pipe' | 'inherit';
22
- /**
23
- * Environment variables to pass to the child process
24
- */
25
- env?: NodeJS.ProcessEnv;
26
- /**
27
- * Whether or not to reject the promise. Defaults
28
- * false
29
- */
30
- reject?: boolean;
31
- };
32
- /**
33
- * Watcher options
34
- */
35
- export type WatchOptions = {
36
- poll?: boolean;
37
- };
38
- /**
39
- * Meta file config defined in "adonisrc.ts" file
40
- */
41
- export type MetaFile = {
42
- pattern: string;
43
- reloadServer: boolean;
44
- };
45
- /**
46
- * Test suite defined in "adonisrc.ts" file
47
- */
48
- export type Suite = {
49
- name: string;
50
- files: string | string[];
51
- };
52
- /**
53
- * Options accepted by assets bundler
54
- */
55
- export type AssetsBundlerOptions = {
56
- enabled: false;
57
- driver?: string;
58
- cmd?: string;
59
- args?: string[];
60
- } | {
61
- enabled: true;
62
- driver: string;
63
- cmd: string;
64
- args: string[];
65
- };
66
- /**
67
- * Options accepted when starting the dev
68
- * server
69
- */
70
- export type DevServerOptions = {
71
- /**
72
- * If the dev server should use HMR
73
- */
74
- hmr?: boolean;
75
- /**
76
- * Arguments to pass to the "bin/server.js" file
77
- * executed a child process
78
- */
79
- scriptArgs: string[];
80
- /**
81
- * Arguments to pass to Node.js CLI when executing
82
- * the "bin/server.js" file
83
- */
84
- nodeArgs: string[];
85
- /**
86
- * Clear screen after every file change
87
- */
88
- clearScreen?: boolean;
89
- /**
90
- * Environment variables to share with the "bin/server.js"
91
- * file.
92
- */
93
- env?: NodeJS.ProcessEnv;
94
- /**
95
- * An array of metaFiles glob patterns to watch
96
- */
97
- metaFiles?: MetaFile[];
98
- /**
99
- * Assets bundler options to start its dev server
100
- */
101
- assets?: AssetsBundlerOptions;
102
- /**
103
- * Hooks to execute at different stages
104
- */
105
- hooks?: Pick<NonNullable<RcFile['hooks']>, 'onDevServerStarted' | 'onSourceFileChanged'>;
106
- };
107
- /**
108
- * Options accepted by the test runner
109
- */
110
- export type TestRunnerOptions = {
111
- /**
112
- * Arguments to pass to the "bin/server.js" file
113
- * executed a child process
114
- */
115
- scriptArgs: string[];
116
- /**
117
- * Arguments to pass to Node.js CLI when executing
118
- * the "bin/server.js" file
119
- */
120
- nodeArgs: string[];
121
- /**
122
- * Clear screen after every file change
123
- */
124
- clearScreen?: boolean;
125
- /**
126
- * Environment variables to share with the "bin/server.js"
127
- * file.
128
- */
129
- env?: NodeJS.ProcessEnv;
130
- /**
131
- * An array of metaFiles glob patterns to watch
132
- */
133
- metaFiles?: MetaFile[];
134
- /**
135
- * Assets bundler options to start its dev server
136
- */
137
- assets?: AssetsBundlerOptions;
138
- /**
139
- * An array of suites for which to run tests
140
- */
141
- suites: Suite[];
142
- /**
143
- * Set the tests runner reporter via the CLI flag
144
- */
145
- reporters?: string[];
146
- /**
147
- * Set the tests global timeout via the CLI flag
148
- */
149
- timeout?: number;
150
- /**
151
- * Define retries via the CLI flag
152
- */
153
- retries?: number;
154
- /**
155
- * Run only failed tests
156
- */
157
- failed?: boolean;
158
- /**
159
- * Filter arguments are provided as a key-value
160
- * pair, so that we can mutate them (if needed)
161
- */
162
- filters: Partial<{
163
- tests: string[];
164
- suites: string[];
165
- groups: string[];
166
- files: string[];
167
- tags: string[];
168
- }>;
169
- };
170
- /**
171
- * Options accepted by the project bundler
172
- */
173
- export type BundlerOptions = {
174
- /**
175
- * An array of metaFiles glob patterns to copy the
176
- * files to the build folder
177
- */
178
- metaFiles?: MetaFile[];
179
- /**
180
- * Assets bundler options to create the production build
181
- * for assets
182
- */
183
- assets?: AssetsBundlerOptions;
184
- /**
185
- * Hooks to execute at different stages
186
- */
187
- hooks?: Pick<NonNullable<RcFile['hooks']>, 'onBuildCompleted' | 'onBuildStarting'>;
188
- };
189
- /**
190
- * Entry to add a middleware to a given middleware stack
191
- * via the CodeTransformer
192
- */
193
- export type MiddlewareNode = {
194
- /**
195
- * If you are adding a named middleware, then you must
196
- * define the name.
197
- */
198
- name?: string;
199
- /**
200
- * The path to the middleware file
201
- *
202
- * @example
203
- * `@adonisjs/static/static_middleware`
204
- * `#middlewares/silent_auth.js`
205
- */
206
- path: string;
207
- /**
208
- * The position to add the middleware. If `before`
209
- * middleware will be added at the first position and
210
- * therefore will be run before all others
211
- *
212
- * @default 'after'
213
- */
214
- position?: 'before' | 'after';
215
- };
216
- /**
217
- * Policy node to be added to the list of policies.
218
- */
219
- export type BouncerPolicyNode = {
220
- /**
221
- * Policy name
222
- */
223
- name: string;
224
- /**
225
- * Policy import path
226
- */
227
- path: string;
228
- };
229
- /**
230
- * Defines the structure of an environment variable validation
231
- * definition
232
- */
233
- export type EnvValidationNode = {
234
- /**
235
- * Write a leading comment on top of your variables
236
- */
237
- leadingComment?: string;
238
- /**
239
- * A key-value pair of env variables and their validation
240
- *
241
- * @example
242
- * MY_VAR: 'Env.schema.string.optional()'
243
- */
244
- variables: Record<string, string>;
245
- };
@@ -1 +0,0 @@
1
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}