Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@adonisjs/application

Package Overview
Dependencies
Maintainers
3
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adonisjs/application - npm Package Compare versions

Comparing version 8.0.0-1 to 8.0.0-2

build/chunk-7WA7C5MT.js

26

build/factories/main.d.ts

@@ -1,25 +0,1 @@

import { b as AppEnvironments, I as Importer, A as Application } from '../application-973855eb.js';
import '@adonisjs/config';
import '@adonisjs/fold';
import '@poppinss/hooks/types';
/**
* App factory is used to generate application class instances for
* testing
*/
declare class AppFactory {
#private;
/**
* Merge parameters accepted by the AppFactory
*/
merge(params: Partial<{
environment: AppEnvironments;
importer: Importer;
}>): this;
/**
* Create application class instance
*/
create(appRoot: URL, importer: Importer): Application<Record<any, any>>;
}
export { AppFactory };
export { AppFactory } from './app.js';
import {
Application
} from "../chunk-2FUH3MH5.js";
import "../chunk-GDI6IYJU.js";
} from "../chunk-B4J6O62D.js";
import "../chunk-7WA7C5MT.js";

@@ -29,1 +29,2 @@ // factories/app.ts

};
//# sourceMappingURL=main.js.map

@@ -1,245 +0,5 @@

import * as _poppinss_utils from '@poppinss/utils';
import { R as RcFile, a as RcFileInput } from './application-973855eb.js';
export { A as Application } from './application-973855eb.js';
import '@adonisjs/config';
import '@adonisjs/fold';
import '@poppinss/hooks/types';
/**
* The exception is raised when the "pattern" property is missing
* in the meta file object.
*/
declare const E_MISSING_METAFILE_PATTERN: new (args: [fileProperty: string], options?: ErrorOptions | undefined) => _poppinss_utils.Exception;
/**
* The exception is raised when the "file" property is missing
* in the preload file object
*/
declare const E_MISSING_PRELOAD_FILE: new (args: [preloadProperty: string], options?: ErrorOptions | undefined) => _poppinss_utils.Exception;
/**
* The exception is raised when the "file" property is missing
* in the provider object
*/
declare const E_MISSING_PROVIDER_FILE: new (args: [preloadProperty: string], options?: ErrorOptions | undefined) => _poppinss_utils.Exception;
/**
* The exception is raised when the "name" property is missing
* in the suite object
*/
declare const E_MISSING_SUITE_NAME: new (args: [suiteProperty: string], options?: ErrorOptions | undefined) => _poppinss_utils.Exception;
/**
* The exception is raised when the "files" property is missing
* in the suite object
*/
declare const E_MISSING_SUITE_FILES: new (args: [suiteProperty: string], options?: ErrorOptions | undefined) => _poppinss_utils.Exception;
/**
* The exception is raised when the "devServerCommand" is missing
* in assetsBundler object
*/
declare const E_MISSING_BUNDLER_DEV_COMMAND: new (args?: any, options?: ErrorOptions | undefined) => _poppinss_utils.Exception;
/**
* The exception is raised when the "buildCommand" is missing
* in assetsBundler object
*/
declare const E_MISSING_BUNDLER_BUILD_COMMAND: new (args?: any, options?: ErrorOptions | undefined) => _poppinss_utils.Exception;
/**
* The exception is raised when the "name" is missing
* in assetsBundler object
*/
declare const E_MISSING_BUNDLER_NAME: new (args?: any, options?: ErrorOptions | undefined) => _poppinss_utils.Exception;
declare const errors_E_MISSING_BUNDLER_BUILD_COMMAND: typeof E_MISSING_BUNDLER_BUILD_COMMAND;
declare const errors_E_MISSING_BUNDLER_DEV_COMMAND: typeof E_MISSING_BUNDLER_DEV_COMMAND;
declare const errors_E_MISSING_BUNDLER_NAME: typeof E_MISSING_BUNDLER_NAME;
declare const errors_E_MISSING_METAFILE_PATTERN: typeof E_MISSING_METAFILE_PATTERN;
declare const errors_E_MISSING_PRELOAD_FILE: typeof E_MISSING_PRELOAD_FILE;
declare const errors_E_MISSING_PROVIDER_FILE: typeof E_MISSING_PROVIDER_FILE;
declare const errors_E_MISSING_SUITE_FILES: typeof E_MISSING_SUITE_FILES;
declare const errors_E_MISSING_SUITE_NAME: typeof E_MISSING_SUITE_NAME;
declare namespace errors {
export {
errors_E_MISSING_BUNDLER_BUILD_COMMAND as E_MISSING_BUNDLER_BUILD_COMMAND,
errors_E_MISSING_BUNDLER_DEV_COMMAND as E_MISSING_BUNDLER_DEV_COMMAND,
errors_E_MISSING_BUNDLER_NAME as E_MISSING_BUNDLER_NAME,
errors_E_MISSING_METAFILE_PATTERN as E_MISSING_METAFILE_PATTERN,
errors_E_MISSING_PRELOAD_FILE as E_MISSING_PRELOAD_FILE,
errors_E_MISSING_PROVIDER_FILE as E_MISSING_PROVIDER_FILE,
errors_E_MISSING_SUITE_FILES as E_MISSING_SUITE_FILES,
errors_E_MISSING_SUITE_NAME as E_MISSING_SUITE_NAME,
};
}
/**
* Rc file parser is used to parse and validate the `adonisrc.js` file contents.
*/
declare class RcFileParser {
#private;
constructor(rcFile: Record<string, any>);
/**
* Parse and validate file contents and merge them with defaults
*/
parse(): RcFile;
}
/**
* Define rcFile config
*/
declare function defineConfig(config: RcFileInput): RcFileInput;
/**
* Generators used for scaffolding
*/
declare const generators: {
/**
* The given controller names will always be generated
* in singular form
*/
singularControllerNames: string[];
/**
* Creates the entity path and name from the user
* input.
*/
createEntity(entityName: string): {
path: string;
name: string;
};
/**
* Construct paths to make an import path
*/
importPath(...paths: string[]): string;
/**
* Converts an entity name to database table name
*/
tableName(entityName: string): string;
/**
* Converts an entity name to model name
*/
modelName(entityName: string): string;
/**
* Converts an entity name to model file name
*/
modelFileName(entityName: string): string;
/**
* Converts an entity name to a controller name
*/
controllerName(entityName: string, singular?: boolean): string;
/**
* Converts an entity name to a controller file name
*/
controllerFileName(entityName: string, singular?: boolean): string;
/**
* Converts an entity name to an event name
*/
eventName(entityName: string): string;
/**
* Converts an entity name to an event file name
*/
eventFileName(entityName: string): string;
/**
* Converts an entity name to listener name
*/
listenerName(entityName: string): string;
/**
* Converts an entity name to listener file name
*/
listenerFileName(entityName: string): string;
/**
* Converts an entity name to middleware name
*/
middlewareName(entityName: string): string;
/**
* Converts an entity name to middleware file name
*/
middlewareFileName(entityName: string): string;
/**
* Converts an entity name to provider name
*/
providerName(entityName: string): string;
/**
* Converts an entity name to provider file name
*/
providerFileName(entityName: string): string;
/**
* Converts an entity name to policy name
*/
policyName(entityName: string): string;
/**
* Converts an entity name to policy file name
*/
policyFileName(entityName: string): string;
/**
* Converts an entity name to factory name
*/
factoryName(entityName: string): string;
/**
* Converts an entity name to factory file name
*/
factoryFileName(entityName: string): string;
/**
* Converts an entity name to service name
*/
serviceName(entityName: string): string;
/**
* Converts an entity name to service file name
*/
serviceFileName(entityName: string): string;
/**
* Converts an entity name to seeder name
*/
seederName(entityName: string): string;
/**
* Converts an entity name to seeder file name
*/
seederFileName(entityName: string): string;
/**
* Converts an entity name to command terminal name
*/
commandTerminalName(entityName: string): string;
/**
* Converts an entity name to command name
*/
commandName(entityName: string): string;
/**
* Converts an entity name to command file name
*/
commandFileName(entityName: string): string;
/**
* Converts an entity name to validator name
*/
validatorName(entityName: string): string;
/**
* Converts an entity name to validator file name
*/
validatorFileName(entityName: string): string;
/**
* Converts an entity name to exception name
*/
exceptionName(entityName: string): string;
/**
* Converts an entity name to exception file name
*/
exceptionFileName(entityName: string): string;
/**
* Converts an entity name to mailer name
*/
mailerName(entityName: string, type?: 'notification' | 'provision'): string;
/**
* Converts an entity name to mailer file name
*/
mailerFileName(entityName: string, type?: 'notification' | 'provision'): string;
/**
* Converts an entity to test group name
*/
testGroupName(entity: {
path: string;
name: string;
}): string;
/**
* Converts an entity name to test file name
*/
testFileName(entityName: string): string;
/**
* Converts an entity name to the view template file
*/
viewFileName(entityName: string): string;
};
export { RcFileParser, defineConfig, errors, generators };
export * as errors from './src/errors.js';
export { Application } from './src/application.js';
export { RcFileParser } from './src/rc_file/parser.js';
export { defineConfig } from './src/define_config.js';
export { default as generators } from './src/generators.js';

@@ -6,4 +6,4 @@ import {

generators_default
} from "./chunk-2FUH3MH5.js";
import "./chunk-GDI6IYJU.js";
} from "./chunk-B4J6O62D.js";
import "./chunk-7WA7C5MT.js";

@@ -21,1 +21,2 @@ // src/define_config.ts

};
//# sourceMappingURL=index.js.map

@@ -1,4 +0,256 @@

export { b as AppEnvironments, c as ApplicationStates, C as ContainerProviderContract, D as DirectoriesNode, H as HooksState, I as Importer, M as MetaFileNode, P as PreloadNode, d as ProviderNode, R as RcFile, a as RcFileInput, S as SemverNode } from '../application-973855eb.js';
import '@adonisjs/config';
import '@adonisjs/fold';
import '@poppinss/hooks/types';
import type { Application } from './application.js';
/**
* Known application environments. The list is strictly limited to
* AdonisJS known environments and custom environments are not
* supported as of now
*/
export type AppEnvironments = 'web' | 'console' | 'test' | 'repl' | 'unknown';
/**
* Known application states.
*
* - 'created' Creating an application class instance sets the state to 'created'.
*
* - 'initiated' Calling `app.init()` method sets the state to 'initiated'.
* The rc file contents and environment variables are parsed during
* init phase.
*
* - 'booted' Calling `app.boot()` method sets the state to `booted`. The service
* providers are registered and booted in this state.
*
* - 'ready' Calling `app.start()` method sets the state to `ready`. A set of
* pre and post start operations inside this method.
*
* The service providers start methods are called during pre-start phase.
* The service providers shutdown and application terminating hooks are
* called during post-start phase.
*
* - 'terminated' Calling `app.terminate' method sets the state to `terminated`. The service
* providers shutdown methods are called in this state.
*/
export type ApplicationStates = 'created' | 'initiated' | 'booted' | 'ready' | 'terminated';
/**
* State shared with hooks
*/
export type HooksState<ContainerBindings extends Record<any, any>> = [
[
Application<ContainerBindings>
],
[
Application<ContainerBindings>
]
];
/**
* Shape of directories object with known and unknown
* directories
*/
export interface DirectoriesNode {
[key: string]: string;
config: string;
public: string;
contracts: string;
providers: string;
languageFiles: string;
migrations: string;
seeders: string;
factories: string;
views: string;
start: string;
tmp: string;
httpControllers: string;
models: string;
services: string;
exceptions: string;
mailers: string;
middleware: string;
policies: string;
validators: string;
commands: string;
events: string;
listeners: string;
stubs: string;
}
/**
* Shape of preload files
*/
export type PreloadNode = {
file: string | (() => Promise<any>);
environment: Exclude<AppEnvironments, 'unknown'>[];
};
/**
* Shape of provider modules
*/
export type ProviderNode = {
file: string | (() => Promise<{
default?: new (app: Application<any>) => ContainerProviderContract;
}>);
environment: Exclude<AppEnvironments, 'unknown'>[];
};
/**
* Shape of semver node
*/
export type SemverNode = {
major: number;
minor: number;
patch: number;
prerelease: (string | number)[];
version: string;
toString(): string;
};
/**
* Shape of the meta file inside the `metaFiles` array inside
* `adonisrc.js` file.
*/
export type MetaFileNode = {
pattern: string;
reloadServer: boolean;
};
/**
* Shape of the adonisrc.js file
*/
export type RcFile = {
/**
* Configure a custom assets bundler to bundle and serve
* assets.
*
* This config can be used to configure assets bundler apart from
* vite and encore (since both are auto-detected)
*/
assetsBundler?: {
name: string;
devServer: {
command: string;
args?: string[];
};
build: {
command: string;
args?: string[];
};
};
/**
* Is it a TypeScript project
*/
typescript: boolean;
/**
* List of configured directories
*/
directories: DirectoriesNode & {
[key: string]: string;
};
/**
* An array of files to load after the application
* has been booted
*/
preloads: PreloadNode[];
/**
* An array of files to load after the application
* has been booted
*/
metaFiles: MetaFileNode[];
/**
* Providers to register.
*
* - The "base" key is used to register providers in all the environments.
* - The environment specific keys are used to register providers for a specific env.
*/
providers: ProviderNode[];
/**
* An array of commands to register
*/
commands: (string | (() => Promise<any>))[];
/**
* Custom command aliases
*/
commandsAliases: {
[key: string]: string;
};
/**
* Register test suites
*/
tests: {
suites: {
name: string;
files: string | string[];
directories: string[];
timeout?: number;
}[];
forceExit: boolean;
timeout: number;
};
/**
* Reference to `adonisrc.js` file raw contents
*/
raw: Record<string, any>;
};
export interface RcFileInput {
assetsBundler?: RcFile['assetsBundler'];
typescript?: RcFile['typescript'];
directories?: Partial<DirectoriesNode> & {
[key: string]: string;
};
preloads?: (PreloadNode | PreloadNode['file'])[];
metaFiles?: string[] | RcFile['metaFiles'];
commands?: RcFile['commands'];
commandsAliases?: RcFile['commandsAliases'];
tests?: {
suites: {
name: string;
files: string | string[];
timeout?: number;
}[];
forceExit?: boolean;
timeout?: number;
};
providers?: (ProviderNode | ProviderNode['file'])[];
}
/**
* Shape of the container provider class instance.
*/
export interface ContainerProviderContract {
/**
* The register method on the provider class is meant to
* register bindings in the container
*/
register?(): void;
/**
* The boot method on the provider class is meant to boot
* any state that application might need.
*
* For example: Registering macros/getters, defining middleware,
* or repl bindings.
*/
boot?(): void | Promise<void>;
/**
* The start method on the provider class is called right the
* boot method.
*
* This method is best place to use existing container bindings before
* the application gets started. Also, at this stage you can be sure
* that all providers have been booted.
*/
start?(): void | Promise<void>;
/**
* The ready method is called after the preloaded files have been
* imported and the app is considered ready. In case of an HTTP
* server, the server will be ready to receive incoming HTTP requests
* before this hook gets called.
*/
ready?(): void | Promise<void>;
/**
* The shutdown method on the provider class is meant to perform
* cleanup for graceful shutdown. You should avoid executing
* long running tasks in this method.
*
* If the shutdown process takes time, the application might get
* forcefully killed based upon the event that occurred shutdown
* in first place.
*/
shutdown?(): void | Promise<void>;
}
/**
* The importer is used to import modules in context of the
* an AdonisJS application.
*
* Anytime AdonisJS wants to import a module from a bare string, it
* will call this function
*/
export type Importer = (moduleIdentifier: string, options?: ImportCallOptions) => any;
{
"name": "@adonisjs/application",
"version": "8.0.0-1",
"version": "8.0.0-2",
"description": "AdonisJS application class to read app related data",

@@ -8,3 +8,5 @@ "type": "module",

"files": [
"build"
"build",
"!build/bin",
"!build/tests"
],

@@ -24,3 +26,4 @@ "exports": {

"typecheck": "tsc --noEmit",
"compile": "npm run lint && npm run clean && tsup-node",
"precompile": "npm run lint && npm run clean",
"compile": "tsup-node && tsc --emitDeclarationOnly --declaration",
"build": "npm run compile",

@@ -43,21 +46,21 @@ "release": "np",

"@adonisjs/config": "^4.2.1-5",
"@adonisjs/eslint-config": "^1.1.8",
"@adonisjs/eslint-config": "^1.1.9",
"@adonisjs/fold": "^9.9.3-10",
"@adonisjs/prettier-config": "^1.1.8",
"@adonisjs/tsconfig": "^1.1.8",
"@commitlint/cli": "^17.8.0",
"@commitlint/config-conventional": "^17.8.0",
"@japa/assert": "^2.0.0",
"@adonisjs/prettier-config": "^1.1.9",
"@adonisjs/tsconfig": "^1.1.9",
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@japa/assert": "^2.0.1",
"@japa/expect-type": "^2.0.0",
"@japa/file-system": "^2.0.0",
"@japa/runner": "^3.0.2",
"@swc/core": "1.3.82",
"@types/fs-extra": "^11.0.2",
"@types/glob-parent": "^5.1.1",
"@types/node": "^20.8.6",
"@types/semver": "^7.5.3",
"@japa/file-system": "^2.0.1",
"@japa/runner": "^3.1.0",
"@swc/core": "^1.3.99",
"@types/fs-extra": "^11.0.4",
"@types/glob-parent": "^5.1.3",
"@types/node": "^20.9.4",
"@types/semver": "^7.5.6",
"c8": "^8.0.1",
"cross-env": "^7.0.3",
"del-cli": "^5.0.0",
"eslint": "^8.51.0",
"eslint": "^8.54.0",
"fs-extra": "^11.1.1",

@@ -67,12 +70,12 @@ "github-label-sync": "^2.3.1",

"np": "^8.0.4",
"prettier": "^3.0.0",
"prettier": "^3.1.0",
"semver": "^7.5.4",
"ts-dedent": "^2.2.0",
"ts-node": "^10.9.1",
"tsup": "^7.2.0",
"typescript": "^5.1.6"
"tsup": "^8.0.1",
"typescript": "5.2.2"
},
"dependencies": {
"@poppinss/hooks": "^7.2.0",
"@poppinss/utils": "^6.5.0",
"@poppinss/hooks": "^7.2.1",
"@poppinss/utils": "^6.5.1",
"glob-parent": "^6.0.2",

@@ -130,5 +133,6 @@ "tempura": "^0.4.0"

"format": "esm",
"dts": true,
"dts": false,
"sourcemap": true,
"target": "esnext"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc