@adonisjs/core 6.1.5-1 → 6.1.5-3
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/build/commands/build.d.ts +3 -0
- package/build/commands/build.d.ts.map +1 -0
- package/build/commands/build.js +22 -2
- package/build/commands/commands.json +1 -1
- package/build/commands/configure.d.ts +1 -0
- package/build/commands/configure.d.ts.map +1 -0
- package/build/commands/configure.js +2 -1
- package/build/commands/eject.d.ts +1 -0
- package/build/commands/eject.d.ts.map +1 -0
- package/build/commands/eject.js +2 -1
- package/build/commands/generate_key.d.ts +1 -0
- package/build/commands/generate_key.d.ts.map +1 -0
- package/build/commands/generate_key.js +2 -1
- package/build/commands/inspect_rcfile.d.ts +7 -0
- package/build/commands/inspect_rcfile.d.ts.map +1 -0
- package/build/commands/inspect_rcfile.js +10 -0
- package/build/commands/list/routes.d.ts +14 -0
- package/build/commands/list/routes.d.ts.map +1 -0
- package/build/commands/list/routes.js +79 -0
- package/build/commands/make/_base.d.ts +23 -1
- package/build/commands/make/_base.d.ts.map +1 -0
- package/build/commands/make/_base.js +11 -2
- package/build/commands/make/command.d.ts +1 -0
- package/build/commands/make/command.d.ts.map +1 -0
- package/build/commands/make/command.js +2 -1
- package/build/commands/make/controller.d.ts +1 -0
- package/build/commands/make/controller.d.ts.map +1 -0
- package/build/commands/make/controller.js +2 -1
- package/build/commands/make/event.d.ts +1 -0
- package/build/commands/make/event.d.ts.map +1 -0
- package/build/commands/make/event.js +2 -1
- package/build/commands/make/listener.d.ts +1 -0
- package/build/commands/make/listener.d.ts.map +1 -0
- package/build/commands/make/listener.js +2 -1
- package/build/commands/make/middleware.d.ts +1 -0
- package/build/commands/make/middleware.d.ts.map +1 -0
- package/build/commands/make/middleware.js +2 -1
- package/build/commands/make/prldfile.d.ts +9 -0
- package/build/commands/make/prldfile.d.ts.map +1 -0
- package/build/commands/make/prldfile.js +28 -0
- package/build/commands/make/provider.d.ts +1 -0
- package/build/commands/make/provider.d.ts.map +1 -0
- package/build/commands/make/provider.js +5 -2
- package/build/commands/make/service.d.ts +9 -0
- package/build/commands/make/service.d.ts.map +1 -0
- package/build/commands/make/service.js +26 -0
- package/build/commands/make/test.d.ts +1 -0
- package/build/commands/make/test.d.ts.map +1 -0
- package/build/commands/make/test.js +2 -1
- package/build/commands/serve.d.ts +3 -0
- package/build/commands/serve.d.ts.map +1 -0
- package/build/commands/serve.js +21 -1
- package/build/commands/test.d.ts +21 -0
- package/build/commands/test.d.ts.map +1 -0
- package/build/commands/test.js +156 -0
- package/build/factories/app.d.ts +1 -0
- package/build/factories/app.d.ts.map +1 -0
- package/build/factories/bodyparser.d.ts +1 -0
- package/build/factories/bodyparser.d.ts.map +1 -0
- package/build/factories/core/ace.d.ts +1 -0
- package/build/factories/core/ace.d.ts.map +1 -0
- package/build/factories/core/ignitor.d.ts +1 -0
- package/build/factories/core/ignitor.d.ts.map +1 -0
- package/build/factories/core/main.d.ts +1 -0
- package/build/factories/core/main.d.ts.map +1 -0
- package/build/factories/core/test_utils.d.ts +1 -0
- package/build/factories/core/test_utils.d.ts.map +1 -0
- package/build/factories/encryption.d.ts +1 -0
- package/build/factories/encryption.d.ts.map +1 -0
- package/build/factories/events.d.ts +1 -0
- package/build/factories/events.d.ts.map +1 -0
- package/build/factories/hash.d.ts +1 -0
- package/build/factories/hash.d.ts.map +1 -0
- package/build/factories/http.d.ts +1 -0
- package/build/factories/http.d.ts.map +1 -0
- package/build/factories/logger.d.ts +1 -0
- package/build/factories/logger.d.ts.map +1 -0
- package/build/factories/stubs.d.ts +1 -0
- package/build/factories/stubs.d.ts.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -0
- package/build/legacy/validator.d.ts +1 -0
- package/build/legacy/validator.d.ts.map +1 -0
- package/build/modules/ace/commands.d.ts +1 -0
- package/build/modules/ace/commands.d.ts.map +1 -0
- package/build/modules/ace/commands.js +4 -2
- package/build/modules/ace/create_kernel.d.ts +1 -0
- package/build/modules/ace/create_kernel.d.ts.map +1 -0
- package/build/modules/ace/kernel.d.ts +1 -0
- package/build/modules/ace/kernel.d.ts.map +1 -0
- package/build/modules/ace/main.d.ts +2 -1
- package/build/modules/ace/main.d.ts.map +1 -0
- package/build/modules/ace/main.js +1 -1
- package/build/modules/ace/shell.d.ts +1 -0
- package/build/modules/ace/shell.d.ts.map +1 -0
- package/build/modules/app.d.ts +1 -0
- package/build/modules/app.d.ts.map +1 -0
- package/build/modules/bodyparser/bodyparser_middleware.d.ts +1 -0
- package/build/modules/bodyparser/bodyparser_middleware.d.ts.map +1 -0
- package/build/modules/bodyparser/main.d.ts +1 -0
- package/build/modules/bodyparser/main.d.ts.map +1 -0
- package/build/modules/config.d.ts +1 -0
- package/build/modules/config.d.ts.map +1 -0
- package/build/modules/container.d.ts +1 -0
- package/build/modules/container.d.ts.map +1 -0
- package/build/modules/encryption.d.ts +1 -0
- package/build/modules/encryption.d.ts.map +1 -0
- package/build/modules/env.d.ts +1 -0
- package/build/modules/env.d.ts.map +1 -0
- package/build/modules/events.d.ts +1 -0
- package/build/modules/events.d.ts.map +1 -0
- package/build/modules/hash/define_config.d.ts +1 -0
- package/build/modules/hash/define_config.d.ts.map +1 -0
- package/build/modules/hash/drivers_collection.d.ts +4 -4
- package/build/modules/hash/drivers_collection.d.ts.map +1 -0
- package/build/modules/hash/drivers_collection.js +2 -8
- package/build/modules/hash/main.d.ts +2 -0
- package/build/modules/hash/main.d.ts.map +1 -0
- package/build/modules/hash/main.js +1 -0
- package/build/modules/http.d.ts +1 -0
- package/build/modules/http.d.ts.map +1 -0
- package/build/modules/logger.d.ts +1 -0
- package/build/modules/logger.d.ts.map +1 -0
- package/build/providers/app_provider.d.ts +1 -0
- package/build/providers/app_provider.d.ts.map +1 -0
- package/build/providers/app_provider.js +5 -7
- package/build/providers/hash_provider.d.ts +1 -0
- package/build/providers/hash_provider.d.ts.map +1 -0
- package/build/providers/hash_provider.js +7 -6
- package/build/providers/http_provider.d.ts +1 -0
- package/build/providers/http_provider.d.ts.map +1 -0
- package/build/services/ace.d.ts +1 -0
- package/build/services/ace.d.ts.map +1 -0
- package/build/services/app.d.ts +1 -0
- package/build/services/app.d.ts.map +1 -0
- package/build/services/config.d.ts +1 -0
- package/build/services/config.d.ts.map +1 -0
- package/build/services/emitter.d.ts +1 -0
- package/build/services/emitter.d.ts.map +1 -0
- package/build/services/emitter.js +1 -2
- package/build/services/encryption.d.ts +1 -0
- package/build/services/encryption.d.ts.map +1 -0
- package/build/services/encryption.js +1 -2
- package/build/services/hash.d.ts +1 -0
- package/build/services/hash.d.ts.map +1 -0
- package/build/services/hash.js +1 -2
- package/build/services/logger.d.ts +1 -0
- package/build/services/logger.d.ts.map +1 -0
- package/build/services/logger.js +1 -2
- package/build/services/router.d.ts +1 -0
- package/build/services/router.d.ts.map +1 -0
- package/build/services/router.js +1 -2
- package/build/services/server.d.ts +1 -0
- package/build/services/server.d.ts.map +1 -0
- package/build/services/server.js +1 -2
- package/build/services/test_utils.d.ts +1 -0
- package/build/services/test_utils.d.ts.map +1 -0
- package/build/src/cli_formatters/routes_list.d.ts +41 -0
- package/build/src/cli_formatters/routes_list.d.ts.map +1 -0
- package/build/src/cli_formatters/routes_list.js +258 -0
- package/build/src/debug.d.ts +1 -0
- package/build/src/debug.d.ts.map +1 -0
- package/build/src/helpers/is.d.ts +1 -0
- package/build/src/helpers/is.d.ts.map +1 -0
- package/build/src/helpers/main.d.ts +3 -0
- package/build/src/helpers/main.d.ts.map +1 -0
- package/build/src/helpers/main.js +2 -0
- package/build/src/helpers/parse_binding_reference.d.ts +6 -0
- package/build/src/helpers/parse_binding_reference.d.ts.map +1 -0
- package/build/src/helpers/parse_binding_reference.js +23 -0
- package/build/src/helpers/string.d.ts +3 -0
- package/build/src/helpers/string.d.ts.map +1 -0
- package/build/src/helpers/string.js +4 -0
- package/build/src/helpers/types.d.ts +1 -0
- package/build/src/helpers/types.d.ts.map +1 -0
- package/build/src/ignitor/ace.d.ts +1 -0
- package/build/src/ignitor/ace.d.ts.map +1 -0
- package/build/src/ignitor/http.d.ts +1 -0
- package/build/src/ignitor/http.d.ts.map +1 -0
- package/build/src/ignitor/main.d.ts +1 -0
- package/build/src/ignitor/main.d.ts.map +1 -0
- package/build/src/ignitor/test.d.ts +1 -0
- package/build/src/ignitor/test.d.ts.map +1 -0
- package/build/src/internal_helpers.d.ts +1 -0
- package/build/src/internal_helpers.d.ts.map +1 -0
- package/build/src/internal_helpers.js +3 -3
- package/build/src/test_utils/http.d.ts +1 -0
- package/build/src/test_utils/http.d.ts.map +1 -0
- package/build/src/test_utils/main.d.ts +2 -1
- package/build/src/test_utils/main.d.ts.map +1 -0
- package/build/src/types.d.ts +3 -2
- package/build/src/types.d.ts.map +1 -0
- package/build/stubs/index.d.ts +1 -0
- package/build/stubs/index.d.ts.map +1 -0
- package/build/stubs/make/preload_file/main.stub +4 -0
- package/build/stubs/make/service/main.stub +4 -0
- package/build/toolkit/commands/index_commands.d.ts +1 -0
- package/build/toolkit/commands/index_commands.d.ts.map +1 -0
- package/build/toolkit/commands/index_commands.js +2 -1
- package/build/toolkit/main.d.ts +1 -0
- package/build/toolkit/main.d.ts.map +1 -0
- package/build/types/ace.d.ts +1 -0
- package/build/types/ace.d.ts.map +1 -0
- package/build/types/app.d.ts +1 -0
- package/build/types/app.d.ts.map +1 -0
- package/build/types/bodyparser.d.ts +1 -0
- package/build/types/bodyparser.d.ts.map +1 -0
- package/build/types/container.d.ts +1 -0
- package/build/types/container.d.ts.map +1 -0
- package/build/types/encryption.d.ts +1 -0
- package/build/types/encryption.d.ts.map +1 -0
- package/build/types/events.d.ts +1 -0
- package/build/types/events.d.ts.map +1 -0
- package/build/types/hash.d.ts +1 -0
- package/build/types/hash.d.ts.map +1 -0
- package/build/types/http.d.ts +1 -0
- package/build/types/http.d.ts.map +1 -0
- package/build/types/logger.d.ts +1 -0
- package/build/types/logger.d.ts.map +1 -0
- package/commands/build.ts +122 -0
- package/commands/configure.ts +179 -0
- package/commands/eject.ts +39 -0
- package/commands/generate_key.ts +53 -0
- package/commands/inspect_rcfile.ts +23 -0
- package/commands/list/routes.ts +121 -0
- package/commands/make/_base.ts +55 -0
- package/commands/make/command.ts +33 -0
- package/commands/make/controller.ts +77 -0
- package/commands/make/event.ts +33 -0
- package/commands/make/listener.ts +63 -0
- package/commands/make/middleware.ts +34 -0
- package/commands/make/prldfile.ts +40 -0
- package/commands/make/provider.ts +40 -0
- package/commands/make/service.ts +33 -0
- package/commands/make/test.ts +115 -0
- package/commands/serve.ts +146 -0
- package/commands/test.ts +189 -0
- package/factories/app.ts +10 -0
- package/factories/bodyparser.ts +10 -0
- package/factories/core/ace.ts +38 -0
- package/factories/core/ignitor.ts +132 -0
- package/factories/core/main.ts +13 -0
- package/factories/core/test_utils.ts +34 -0
- package/factories/encryption.ts +10 -0
- package/factories/events.ts +10 -0
- package/factories/hash.ts +10 -0
- package/factories/http.ts +10 -0
- package/factories/logger.ts +10 -0
- package/factories/stubs.ts +53 -0
- package/index.ts +39 -0
- package/legacy/validator.ts +10 -0
- package/modules/ace/commands.ts +152 -0
- package/modules/ace/create_kernel.ts +73 -0
- package/modules/ace/kernel.ts +28 -0
- package/modules/ace/main.ts +22 -0
- package/modules/ace/shell.ts +49 -0
- package/modules/app.ts +10 -0
- package/modules/bodyparser/bodyparser_middleware.ts +16 -0
- package/modules/bodyparser/main.ts +10 -0
- package/modules/config.ts +10 -0
- package/modules/container.ts +10 -0
- package/modules/encryption.ts +10 -0
- package/modules/env.ts +10 -0
- package/modules/events.ts +10 -0
- package/modules/hash/define_config.ts +64 -0
- package/modules/hash/drivers_collection.ts +61 -0
- package/modules/hash/main.ts +12 -0
- package/modules/http.ts +10 -0
- package/modules/logger.ts +10 -0
- package/package.json +43 -36
- package/providers/app_provider.ts +125 -0
- package/providers/hash_provider.ts +58 -0
- package/providers/http_provider.ts +66 -0
- package/services/ace.ts +26 -0
- package/services/app.ts +26 -0
- package/services/config.ts +22 -0
- package/services/emitter.ts +23 -0
- package/services/encryption.ts +23 -0
- package/services/hash.ts +23 -0
- package/services/logger.ts +23 -0
- package/services/router.ts +23 -0
- package/services/server.ts +23 -0
- package/services/test_utils.ts +26 -0
- package/src/cli_formatters/routes_list.ts +480 -0
- package/src/debug.ts +12 -0
- package/src/helpers/is.ts +11 -0
- package/src/helpers/main.ts +13 -0
- package/src/helpers/parse_binding_reference.ts +93 -0
- package/src/helpers/string.ts +89 -0
- package/src/helpers/types.ts +46 -0
- package/src/ignitor/ace.ts +90 -0
- package/src/ignitor/http.ts +167 -0
- package/src/ignitor/main.ts +118 -0
- package/src/ignitor/test.ts +51 -0
- package/src/internal_helpers.ts +59 -0
- package/src/test_utils/http.ts +79 -0
- package/src/test_utils/main.ts +69 -0
- package/src/types.ts +136 -0
- package/types/ace.ts +15 -0
- package/types/app.ts +10 -0
- package/types/bodyparser.ts +10 -0
- package/types/container.ts +10 -0
- package/types/encryption.ts +10 -0
- package/types/events.ts +10 -0
- package/types/hash.ts +10 -0
- package/types/http.ts +10 -0
- package/types/logger.ts +10 -0
- package/build/src/helpers/string_builder.d.ts +0 -23
- package/build/src/helpers/string_builder.js +0 -86
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LazyImport, Constructor } from '../../types/http.js';
|
|
2
|
+
export declare function parseBindingReference(binding: string | [LazyImport<Constructor<any>> | Constructor<any>, any?]): Promise<{
|
|
3
|
+
moduleNameOrPath: string;
|
|
4
|
+
method: string;
|
|
5
|
+
}>;
|
|
6
|
+
//# sourceMappingURL=parse_binding_reference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse_binding_reference.d.ts","sourceRoot":"","sources":["../../../src/helpers/parse_binding_reference.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AA0C7D,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,MAAM,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,GACxE,OAAO,CAAC;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAsCvD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import parseImports from 'parse-imports';
|
|
2
|
+
export async function parseBindingReference(binding) {
|
|
3
|
+
if (typeof binding === 'string') {
|
|
4
|
+
const tokens = binding.split('.');
|
|
5
|
+
if (tokens.length === 1) {
|
|
6
|
+
return { moduleNameOrPath: binding, method: 'handle' };
|
|
7
|
+
}
|
|
8
|
+
return { method: tokens.pop(), moduleNameOrPath: tokens.join('.') };
|
|
9
|
+
}
|
|
10
|
+
const [bindingReference, method] = binding;
|
|
11
|
+
const imports = [...(await parseImports(bindingReference.toString()))];
|
|
12
|
+
const importedModule = imports.find(($import) => $import.isDynamicImport && $import.moduleSpecifier.value);
|
|
13
|
+
if (importedModule) {
|
|
14
|
+
return {
|
|
15
|
+
moduleNameOrPath: importedModule.moduleSpecifier.value,
|
|
16
|
+
method: method || 'handle',
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
moduleNameOrPath: bindingReference.name,
|
|
21
|
+
method: method || 'handle',
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { EncodeOptions } from 'he';
|
|
2
2
|
import string from '@poppinss/utils/string';
|
|
3
|
+
import StringBuilder from '@poppinss/utils/string_builder';
|
|
3
4
|
declare const stringHelpers: typeof string & {
|
|
5
|
+
create(value: string | StringBuilder): StringBuilder;
|
|
4
6
|
ordinalize: (typeof string)['ordinal'];
|
|
5
7
|
toSentence: (typeof string)['sentence'];
|
|
6
8
|
generateRandom: (typeof string)['random'];
|
|
@@ -15,3 +17,4 @@ declare const stringHelpers: typeof string & {
|
|
|
15
17
|
encodeSymbols(value: string, options?: EncodeOptions): string;
|
|
16
18
|
};
|
|
17
19
|
export default stringHelpers;
|
|
20
|
+
//# sourceMappingURL=string.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src/helpers/string.ts"],"names":[],"mappings":"AASA,OAAW,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;AAEtC,OAAO,MAAM,MAAM,wBAAwB,CAAA;AAC3C,OAAO,aAAa,MAAM,gCAAgC,CAAA;AAK1D,QAAA,MAAM,aAAa,EAAE,OAAO,MAAM,GAAG;IAInC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,aAAa,CAAA;IAEpD,UAAU,EAAE,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAA;IAKtC,UAAU,EAAE,CAAC,OAAO,MAAM,CAAC,CAAC,UAAU,CAAC,CAAA;IAKvC,cAAc,EAAE,CAAC,OAAO,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAA;IAKzC,YAAY,CACV,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EACtB,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KAAE,GACzE,MAAM,CAAA;IAKT,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;IAK/B,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM,CAAA;IAKxE,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAAA;CA8B9D,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import he from 'he';
|
|
2
2
|
import prettyHrTime from 'pretty-hrtime';
|
|
3
3
|
import string from '@poppinss/utils/string';
|
|
4
|
+
import StringBuilder from '@poppinss/utils/string_builder';
|
|
4
5
|
const stringHelpers = {
|
|
5
6
|
...string,
|
|
6
7
|
toSentence: string.sentence,
|
|
7
8
|
ordinalize: string.ordinal,
|
|
8
9
|
generateRandom: string.random,
|
|
10
|
+
create(value) {
|
|
11
|
+
return new StringBuilder(value);
|
|
12
|
+
},
|
|
9
13
|
prettyHrTime(time, options) {
|
|
10
14
|
return prettyHrTime(time, options);
|
|
11
15
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/helpers/types.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAOjC,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;mBAgBM,MAAM;qBAGJ,MAAM,GAAG,MAAM,YAAY;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO;CAQjF,CAAA;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ace.d.ts","sourceRoot":"","sources":["../../../src/ignitor/ace.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAMrD,qBAAa,UAAU;;gBAYT,OAAO,EAAE,OAAO;IAQ5B,SAAS,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI;IAStE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE;CA4C5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/ignitor/http.ts"],"names":[],"mappings":";;AASA,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,YAAY,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,IAAI,cAAc,EAAgB,MAAM,WAAW,CAAA;AAGnG,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAOnC,qBAAa,iBAAiB;;gBAMhB,OAAO,EAAE,OAAO;IA8FtB,KAAK,CACT,cAAc,CAAC,EAAE,CACf,OAAO,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,KAAK,GAAG,KACxD,eAAe,GAAG,cAAc;CA2CxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/ignitor/main.ts"],"names":[],"mappings":";AAUA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAG7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAMrE,qBAAa,OAAO;;gBA0BN,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc;IAiBjD,MAAM;IAON,SAAS,CAAC,WAAW,EAAE,eAAe;IAYtC,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,GAAG,IAAI;IAQtD,UAAU;IAOV,GAAG;IAOH,UAAU;IAQJ,SAAS;CAGhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/ignitor/test.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAKrD,qBAAa,iBAAiB;;gBAYhB,OAAO,EAAE,OAAO;IAQ5B,SAAS,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI;IAQtE,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;CAOtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal_helpers.d.ts","sourceRoot":"","sources":["../../src/internal_helpers.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAK/C,wBAAsB,eAAe,CACnC,GAAG,EAAE,kBAAkB,GACtB,OAAO,CAAC,cAAc,qBAAqB,CAAC,GAAG,SAAS,CAAC,CAI3D;AAKD,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,kBAAkB,GACtB,OAAO,CAAC,cAAc,YAAY,CAAC,GAAG,SAAS,CAAC,CAIlD;AAMD,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,kBAAkB;;;;eAoBhE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import fs from 'fs
|
|
1
|
+
import fs from 'node:fs';
|
|
2
2
|
export async function importAssembler(app) {
|
|
3
3
|
try {
|
|
4
4
|
return await app.import('@adonisjs/assembler');
|
|
@@ -15,14 +15,14 @@ export async function detectAssetsBundler(app) {
|
|
|
15
15
|
if (app.rcFile.assetsBundler) {
|
|
16
16
|
return app.rcFile.assetsBundler;
|
|
17
17
|
}
|
|
18
|
-
if (
|
|
18
|
+
if (fs.existsSync(app.makePath('vite.config.js'))) {
|
|
19
19
|
return {
|
|
20
20
|
name: 'vite',
|
|
21
21
|
devServerCommand: 'vite',
|
|
22
22
|
buildCommand: 'vite build',
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
if (
|
|
25
|
+
if (fs.existsSync(app.makePath('webpack.config.js'))) {
|
|
26
26
|
return {
|
|
27
27
|
name: 'encore',
|
|
28
28
|
devServerCommand: 'encore dev-server',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/test_utils/http.ts"],"names":[],"mappings":";;AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,YAAY,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,IAAI,cAAc,EAAgB,MAAM,WAAW,CAAA;AAMnG,qBAAa,eAAe;;gBAGd,KAAK,EAAE,SAAS;IA8BtB,KAAK,CACT,cAAc,CAAC,EAAE,CACf,OAAO,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,KAAK,GAAG,KACxD,eAAe,GAAG,cAAc,GACpC,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAuBhC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import Macroable from '@poppinss/macroable';
|
|
3
3
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
4
4
|
import { HttpServerUtils } from './http.js';
|
|
5
|
-
import type { ApplicationService } from '../types.js';
|
|
6
5
|
import { CookieClient } from '../../modules/http.js';
|
|
6
|
+
import type { ApplicationService } from '../types.js';
|
|
7
7
|
export declare class TestUtils extends Macroable {
|
|
8
8
|
#private;
|
|
9
9
|
app: ApplicationService;
|
|
@@ -17,3 +17,4 @@ export declare class TestUtils extends Macroable {
|
|
|
17
17
|
res?: ServerResponse;
|
|
18
18
|
}): Promise<import("../../modules/http.js").HttpContext>;
|
|
19
19
|
}
|
|
20
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/test_utils/main.ts"],"names":[],"mappings":";AAUA,OAAO,SAAS,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAMrD,qBAAa,SAAU,SAAQ,SAAS;;IAYnB,GAAG,EAAE,kBAAkB;IAN1C,IAAI,QAAQ,YAEX;IAEO,OAAO,EAAE,YAAY,CAAA;gBAEV,GAAG,EAAE,kBAAkB;IAQpC,IAAI;IAWV,UAAU;IAOJ,iBAAiB,CAAC,OAAO,GAAE;QAAE,GAAG,CAAC,EAAE,eAAe,CAAC;QAAC,GAAG,CAAC,EAAE,cAAc,CAAA;KAAO;CAStF"}
|
package/build/src/types.d.ts
CHANGED
|
@@ -7,14 +7,15 @@ import type { Router, Server } from '../modules/http.js';
|
|
|
7
7
|
import type { LoggerManager } from '../modules/logger.js';
|
|
8
8
|
import type { Encryption } from '../modules/encryption.js';
|
|
9
9
|
import type { HttpRequestFinishedPayload } from '../types/http.js';
|
|
10
|
+
import type { ContainerResolveEventData } from '../types/container.js';
|
|
10
11
|
import type { LoggerConfig, LoggerManagerConfig } from '../types/logger.js';
|
|
11
|
-
import type hashDriversCollection from '../modules/hash/drivers_collection.js';
|
|
12
12
|
import type { Argon, Bcrypt, HashManager, Scrypt } from '../modules/hash/main.js';
|
|
13
13
|
import type { ArgonConfig, BcryptConfig, ScryptConfig, ManagerDriverFactory } from '../types/hash.js';
|
|
14
14
|
export type IgnitorOptions = {
|
|
15
15
|
importer: Importer;
|
|
16
16
|
};
|
|
17
17
|
export interface EventsList {
|
|
18
|
+
'container:resolved': ContainerResolveEventData<ContainerBindings>;
|
|
18
19
|
'http:request_handled': HttpRequestFinishedPayload;
|
|
19
20
|
'http:server_ready': {
|
|
20
21
|
port: number;
|
|
@@ -56,8 +57,8 @@ export interface ContainerBindings {
|
|
|
56
57
|
emitter: EmitterService;
|
|
57
58
|
encryption: EncryptionService;
|
|
58
59
|
hash: HashService;
|
|
59
|
-
hashDrivers: typeof hashDriversCollection;
|
|
60
60
|
server: HttpServerService;
|
|
61
61
|
router: HttpRouterService;
|
|
62
62
|
testUtils: TestUtils;
|
|
63
63
|
}
|
|
64
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"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"}
|
package/build/stubs/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../stubs/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS,QAA8B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index_commands.d.ts","sourceRoot":"","sources":["../../../toolkit/commands/index_commands.ts"],"names":[],"mappings":"AAUA,OAAO,EAAQ,WAAW,EAAkB,MAAM,eAAe,CAAA;AAMjE,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,WAAW;IACnD,MAAM,CAAC,WAAW,SAAU;IAC5B,MAAM,CAAC,WAAW,EAAE,MAAM,CAAyD;IAG3E,WAAW,EAAE,MAAM,CAAA;IAErB,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CAG1B"}
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { join } from 'node:path';
|
|
11
11
|
import { args, BaseCommand, IndexGenerator } from '@adonisjs/ace';
|
|
12
|
-
|
|
12
|
+
class IndexCommand extends BaseCommand {
|
|
13
13
|
static commandName = 'index';
|
|
14
14
|
static description = 'Create an index of commands along with a lazy loader';
|
|
15
15
|
async run() {
|
|
@@ -20,3 +20,4 @@ __decorate([
|
|
|
20
20
|
args.string({ description: 'Relative path from cwd to the commands directory' }),
|
|
21
21
|
__metadata("design:type", String)
|
|
22
22
|
], IndexCommand.prototype, "commandsDir", void 0);
|
|
23
|
+
export default IndexCommand;
|
package/build/toolkit/main.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../toolkit/main.ts"],"names":[],"mappings":""}
|
package/build/types/ace.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ace.d.ts","sourceRoot":"","sources":["../../types/ace.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC/E,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,cAAc,qBAAqB,CAAA"}
|
package/build/types/app.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../types/app.ts"],"names":[],"mappings":"AASA,cAAc,6BAA6B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bodyparser.d.ts","sourceRoot":"","sources":["../../types/bodyparser.ts"],"names":[],"mappings":"AASA,cAAc,4BAA4B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../types/container.ts"],"names":[],"mappings":"AASA,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../../types/encryption.ts"],"names":[],"mappings":"AASA,cAAc,4BAA4B,CAAA"}
|
package/build/types/events.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../types/events.ts"],"names":[],"mappings":"AASA,cAAc,wBAAwB,CAAA"}
|
package/build/types/hash.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../types/hash.ts"],"names":[],"mappings":"AASA,cAAc,sBAAsB,CAAA"}
|
package/build/types/http.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../types/http.ts"],"names":[],"mappings":"AASA,cAAc,6BAA6B,CAAA"}
|
package/build/types/logger.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../types/logger.ts"],"names":[],"mappings":"AASA,cAAc,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @adonisjs/core
|
|
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
|
+
|
|
10
|
+
import { BaseCommand, flags } from '../modules/ace/main.js'
|
|
11
|
+
import { detectAssetsBundler, importAssembler, importTypeScript } from '../src/internal_helpers.js'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Serve command is used to run the AdonisJS HTTP server during development. The
|
|
15
|
+
* command under the hood runs the "bin/server.ts" file and watches for file
|
|
16
|
+
* system changes
|
|
17
|
+
*/
|
|
18
|
+
export default class Build extends BaseCommand {
|
|
19
|
+
static commandName = 'build'
|
|
20
|
+
static description =
|
|
21
|
+
'Build application for production by compiling frontend assets and TypeScript source to JavaScript'
|
|
22
|
+
|
|
23
|
+
static help = [
|
|
24
|
+
'Create the production build using the following command.',
|
|
25
|
+
'```',
|
|
26
|
+
'{{ binaryName }} build',
|
|
27
|
+
'```',
|
|
28
|
+
'',
|
|
29
|
+
'The assets bundler dev server runs automatically after detecting vite config or webpack config files',
|
|
30
|
+
'You may pass vite CLI args using the --assets-args command line flag.',
|
|
31
|
+
'```',
|
|
32
|
+
'{{ binaryName }} build --assets-args="--debug --base=/public"',
|
|
33
|
+
'```',
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
@flags.boolean({ description: 'Watch filesystem and restart the HTTP server on file change' })
|
|
37
|
+
declare watch?: boolean
|
|
38
|
+
|
|
39
|
+
@flags.boolean({ description: 'Ignore TypeScript errors and continue with the build process' })
|
|
40
|
+
declare ignoreTsErrors?: boolean
|
|
41
|
+
|
|
42
|
+
@flags.string({
|
|
43
|
+
description: 'Select the package manager you want to use to install production dependencies',
|
|
44
|
+
})
|
|
45
|
+
declare packageManager?: 'npm' | 'pnpm' | 'yarn'
|
|
46
|
+
|
|
47
|
+
@flags.boolean({
|
|
48
|
+
description: 'Build frontend assets',
|
|
49
|
+
showNegatedVariantInHelp: true,
|
|
50
|
+
default: true,
|
|
51
|
+
})
|
|
52
|
+
declare assets?: boolean
|
|
53
|
+
|
|
54
|
+
@flags.array({
|
|
55
|
+
description: 'Define CLI arguments to pass to the assets bundler',
|
|
56
|
+
})
|
|
57
|
+
declare assetsArgs?: string[]
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Log a development dependency is missing
|
|
61
|
+
*/
|
|
62
|
+
#logMissingDevelopmentDependency(dependency: string) {
|
|
63
|
+
this.logger.error(
|
|
64
|
+
[
|
|
65
|
+
`Cannot find package "${dependency}"`,
|
|
66
|
+
'',
|
|
67
|
+
`The "${dependency}" package is a development dependency and therefore you should use the build command with development dependencies installed.`,
|
|
68
|
+
'',
|
|
69
|
+
'If you are using the build command inside a CI or with a deployment platform, make sure the NODE_ENV is set to "development"',
|
|
70
|
+
].join('\n')
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Build application
|
|
76
|
+
*/
|
|
77
|
+
async run() {
|
|
78
|
+
const assembler = await importAssembler(this.app)
|
|
79
|
+
if (!assembler) {
|
|
80
|
+
this.#logMissingDevelopmentDependency('@adonisjs/assembler')
|
|
81
|
+
this.exitCode = 1
|
|
82
|
+
return
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const ts = await importTypeScript(this.app)
|
|
86
|
+
if (!ts) {
|
|
87
|
+
this.#logMissingDevelopmentDependency('typescript')
|
|
88
|
+
this.exitCode = 1
|
|
89
|
+
return
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const assetsBundler = await detectAssetsBundler(this.app)
|
|
93
|
+
const bundler = new assembler.Bundler(this.app.appRoot, ts, {
|
|
94
|
+
assets: assetsBundler
|
|
95
|
+
? {
|
|
96
|
+
serve: this.assets === false ? false : true,
|
|
97
|
+
driver: assetsBundler.name,
|
|
98
|
+
cmd: assetsBundler.buildCommand,
|
|
99
|
+
args: this.assetsArgs || [],
|
|
100
|
+
}
|
|
101
|
+
: {
|
|
102
|
+
serve: false,
|
|
103
|
+
},
|
|
104
|
+
metaFiles: this.app.rcFile.metaFiles,
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Share command logger with assembler, so that CLI flags like --no-ansi has
|
|
109
|
+
* similar impact for assembler logs as well.
|
|
110
|
+
*/
|
|
111
|
+
bundler.setLogger(this.logger)
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Bundle project for production
|
|
115
|
+
*/
|
|
116
|
+
const stopOnError = this.ignoreTsErrors === true ? false : true
|
|
117
|
+
const builtSuccessfully = await bundler.bundle(stopOnError, this.packageManager)
|
|
118
|
+
if (!builtSuccessfully) {
|
|
119
|
+
this.exitCode = 1
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|