@adonisjs/assembler 5.9.2 → 5.9.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.
Files changed (65) hide show
  1. package/build/commands/Build.d.ts +37 -37
  2. package/build/commands/Build.js +138 -138
  3. package/build/commands/Invoke.d.ts +34 -34
  4. package/build/commands/Invoke.js +221 -221
  5. package/build/commands/Make/Base.d.ts +30 -30
  6. package/build/commands/Make/Base.js +75 -75
  7. package/build/commands/Make/Command.d.ts +35 -35
  8. package/build/commands/Make/Command.js +82 -82
  9. package/build/commands/Make/Controller.d.ts +37 -37
  10. package/build/commands/Make/Controller.js +89 -89
  11. package/build/commands/Make/Exception.d.ts +32 -32
  12. package/build/commands/Make/Exception.js +75 -75
  13. package/build/commands/Make/Listener.d.ts +30 -30
  14. package/build/commands/Make/Listener.js +70 -70
  15. package/build/commands/Make/Middleware.d.ts +31 -31
  16. package/build/commands/Make/Middleware.js +87 -87
  17. package/build/commands/Make/PreloadFile.d.ts +38 -38
  18. package/build/commands/Make/PreloadFile.js +157 -157
  19. package/build/commands/Make/Provider.d.ts +31 -31
  20. package/build/commands/Make/Provider.js +114 -114
  21. package/build/commands/Make/Suite.d.ts +41 -41
  22. package/build/commands/Make/Suite.js +120 -120
  23. package/build/commands/Make/Test.d.ts +35 -35
  24. package/build/commands/Make/Test.js +96 -96
  25. package/build/commands/Make/Validator.d.ts +31 -31
  26. package/build/commands/Make/Validator.js +71 -71
  27. package/build/commands/Make/View.d.ts +30 -30
  28. package/build/commands/Make/View.js +70 -70
  29. package/build/commands/Serve.d.ts +33 -33
  30. package/build/commands/Serve.js +112 -112
  31. package/build/commands/Test.d.ts +57 -57
  32. package/build/commands/Test.js +159 -159
  33. package/build/commands/TypeCheck.d.ts +16 -16
  34. package/build/commands/TypeCheck.js +85 -85
  35. package/build/config/paths.d.ts +7 -7
  36. package/build/config/paths.js +18 -18
  37. package/build/register.d.ts +1 -1
  38. package/build/register.js +15 -15
  39. package/build/src/AssetsBundler/index.d.ts +76 -76
  40. package/build/src/AssetsBundler/index.js +216 -216
  41. package/build/src/Compiler/index.d.ts +62 -62
  42. package/build/src/Compiler/index.js +287 -287
  43. package/build/src/Contracts/index.d.ts +8 -8
  44. package/build/src/Contracts/index.js +10 -10
  45. package/build/src/DevServer/index.d.ts +70 -70
  46. package/build/src/DevServer/index.js +306 -306
  47. package/build/src/EnvParser/index.d.ts +21 -23
  48. package/build/src/EnvParser/index.js +48 -52
  49. package/build/src/HttpServer/index.d.ts +34 -34
  50. package/build/src/HttpServer/index.js +87 -87
  51. package/build/src/Manifest/index.d.ts +32 -32
  52. package/build/src/Manifest/index.js +88 -88
  53. package/build/src/RcFile/index.d.ts +72 -72
  54. package/build/src/RcFile/index.js +174 -174
  55. package/build/src/Test/index.d.ts +75 -75
  56. package/build/src/Test/index.js +346 -346
  57. package/build/src/Test/process.d.ts +22 -22
  58. package/build/src/Test/process.js +68 -68
  59. package/build/src/Ts/index.d.ts +24 -24
  60. package/build/src/Ts/index.js +55 -55
  61. package/build/src/requireHook/index.d.ts +5 -5
  62. package/build/src/requireHook/index.js +28 -28
  63. package/build/src/requireHook/ioc-transformer.d.ts +6 -6
  64. package/build/src/requireHook/ioc-transformer.js +21 -21
  65. package/package.json +5 -5
@@ -1,22 +1,22 @@
1
- import { logger as uiLogger } from '@poppinss/cliui';
2
- import { JapaFlags } from '../Contracts';
3
- /**
4
- * Exposes the API to run tests as a child process.
5
- */
6
- export declare class TestProcess {
7
- private sourceFile;
8
- private projectRoot;
9
- private filters;
10
- private logger;
11
- private env;
12
- private nodeArgs;
13
- constructor(sourceFile: string, projectRoot: string, filters: JapaFlags, nodeArgs: string[] | undefined, logger: typeof uiLogger, env?: {
14
- [key: string]: string;
15
- });
16
- /**
17
- * Start the HTTP server as a child process.
18
- */
19
- run(): Promise<{
20
- hasErrors: boolean;
21
- }>;
22
- }
1
+ import { logger as uiLogger } from '@poppinss/cliui';
2
+ import { JapaFlags } from '../Contracts';
3
+ /**
4
+ * Exposes the API to run tests as a child process.
5
+ */
6
+ export declare class TestProcess {
7
+ private sourceFile;
8
+ private projectRoot;
9
+ private filters;
10
+ private logger;
11
+ private env;
12
+ private nodeArgs;
13
+ constructor(sourceFile: string, projectRoot: string, filters: JapaFlags, nodeArgs: string[] | undefined, logger: typeof uiLogger, env?: {
14
+ [key: string]: string;
15
+ });
16
+ /**
17
+ * Start the HTTP server as a child process.
18
+ */
19
+ run(): Promise<{
20
+ hasErrors: boolean;
21
+ }>;
22
+ }
@@ -1,68 +1,68 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/assembler
4
- *
5
- * (c) Harminder Virk <virk@adonisjs.com>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- var __importDefault = (this && this.__importDefault) || function (mod) {
11
- return (mod && mod.__esModule) ? mod : { "default": mod };
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.TestProcess = void 0;
15
- const execa_1 = __importDefault(require("execa"));
16
- /**
17
- * Exposes the API to run tests as a child process.
18
- */
19
- class TestProcess {
20
- constructor(sourceFile, projectRoot, filters, nodeArgs = [], logger, env = {}) {
21
- this.sourceFile = sourceFile;
22
- this.projectRoot = projectRoot;
23
- this.filters = filters;
24
- this.logger = logger;
25
- this.env = env;
26
- this.nodeArgs = nodeArgs.reduce((result, arg) => {
27
- result = result.concat(arg.split(' '));
28
- return result;
29
- }, []);
30
- }
31
- /**
32
- * Start the HTTP server as a child process.
33
- */
34
- async run() {
35
- this.logger.info('running tests...');
36
- const filters = Object.keys(this.filters).reduce((result, filter) => {
37
- const value = this.filters[filter];
38
- if (filter === '_') {
39
- result.push(...value);
40
- return result;
41
- }
42
- result.push(filter);
43
- if (Array.isArray(value)) {
44
- result.push(value.join(','));
45
- }
46
- else {
47
- result.push(value);
48
- }
49
- return result;
50
- }, []);
51
- try {
52
- await execa_1.default.node(this.sourceFile, filters, {
53
- stdio: 'inherit',
54
- cwd: this.projectRoot,
55
- env: {
56
- FORCE_COLOR: 'true',
57
- ...this.env,
58
- },
59
- nodeOptions: ['-r', '@adonisjs/assembler/build/register'].concat(this.nodeArgs),
60
- });
61
- return { hasErrors: false };
62
- }
63
- catch {
64
- return { hasErrors: true };
65
- }
66
- }
67
- }
68
- exports.TestProcess = TestProcess;
1
+ "use strict";
2
+ /*
3
+ * @adonisjs/assembler
4
+ *
5
+ * (c) Harminder Virk <virk@adonisjs.com>
6
+ *
7
+ * For the full copyright and license information, please view the LICENSE
8
+ * file that was distributed with this source code.
9
+ */
10
+ var __importDefault = (this && this.__importDefault) || function (mod) {
11
+ return (mod && mod.__esModule) ? mod : { "default": mod };
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.TestProcess = void 0;
15
+ const execa_1 = __importDefault(require("execa"));
16
+ /**
17
+ * Exposes the API to run tests as a child process.
18
+ */
19
+ class TestProcess {
20
+ constructor(sourceFile, projectRoot, filters, nodeArgs = [], logger, env = {}) {
21
+ this.sourceFile = sourceFile;
22
+ this.projectRoot = projectRoot;
23
+ this.filters = filters;
24
+ this.logger = logger;
25
+ this.env = env;
26
+ this.nodeArgs = nodeArgs.reduce((result, arg) => {
27
+ result = result.concat(arg.split(' '));
28
+ return result;
29
+ }, []);
30
+ }
31
+ /**
32
+ * Start the HTTP server as a child process.
33
+ */
34
+ async run() {
35
+ this.logger.info('running tests...');
36
+ const filters = Object.keys(this.filters).reduce((result, filter) => {
37
+ const value = this.filters[filter];
38
+ if (filter === '_') {
39
+ result.push(...value);
40
+ return result;
41
+ }
42
+ result.push(filter);
43
+ if (Array.isArray(value)) {
44
+ result.push(value.join(','));
45
+ }
46
+ else {
47
+ result.push(value);
48
+ }
49
+ return result;
50
+ }, []);
51
+ try {
52
+ await execa_1.default.node(this.sourceFile, filters, {
53
+ stdio: 'inherit',
54
+ cwd: this.projectRoot,
55
+ env: {
56
+ FORCE_COLOR: 'true',
57
+ ...this.env,
58
+ },
59
+ nodeOptions: ['-r', '@adonisjs/assembler/build/register'].concat(this.nodeArgs),
60
+ });
61
+ return { hasErrors: false };
62
+ }
63
+ catch {
64
+ return { hasErrors: true };
65
+ }
66
+ }
67
+ }
68
+ exports.TestProcess = TestProcess;
@@ -1,24 +1,24 @@
1
- import tsStatic from 'typescript';
2
- import { logger as uiLogger } from '@poppinss/cliui';
3
- import { TypescriptCompiler } from '@poppinss/chokidar-ts';
4
- /**
5
- * Exposes the API to work with the Typescript compiler API
6
- */
7
- export declare class Ts {
8
- private appRoot;
9
- private logger;
10
- private tsconfig;
11
- /**
12
- * Reference to the typescript compiler
13
- */
14
- tsCompiler: TypescriptCompiler;
15
- constructor(appRoot: string, logger: typeof uiLogger, tsconfig?: string);
16
- /**
17
- * Render ts diagnostics
18
- */
19
- renderDiagnostics(diagnostics: tsStatic.Diagnostic[], host: tsStatic.CompilerHost): void;
20
- /**
21
- * Parses the tsconfig file
22
- */
23
- parseConfig(): undefined | tsStatic.ParsedCommandLine;
24
- }
1
+ import tsStatic from 'typescript';
2
+ import { logger as uiLogger } from '@poppinss/cliui';
3
+ import { TypescriptCompiler } from '@poppinss/chokidar-ts';
4
+ /**
5
+ * Exposes the API to work with the Typescript compiler API
6
+ */
7
+ export declare class Ts {
8
+ private appRoot;
9
+ private logger;
10
+ private tsconfig;
11
+ /**
12
+ * Reference to the typescript compiler
13
+ */
14
+ tsCompiler: TypescriptCompiler;
15
+ constructor(appRoot: string, logger: typeof uiLogger, tsconfig?: string);
16
+ /**
17
+ * Render ts diagnostics
18
+ */
19
+ renderDiagnostics(diagnostics: tsStatic.Diagnostic[], host: tsStatic.CompilerHost): void;
20
+ /**
21
+ * Parses the tsconfig file
22
+ */
23
+ parseConfig(): undefined | tsStatic.ParsedCommandLine;
24
+ }
@@ -1,55 +1,55 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/assembler
4
- *
5
- * (c) Harminder Virk <virk@adonisjs.com>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.Ts = void 0;
12
- const path_1 = require("path");
13
- const chokidar_ts_1 = require("@poppinss/chokidar-ts");
14
- const helpers_1 = require("@poppinss/utils/build/helpers");
15
- const paths_1 = require("../../config/paths");
16
- /**
17
- * Exposes the API to work with the Typescript compiler API
18
- */
19
- class Ts {
20
- constructor(appRoot, logger, tsconfig = paths_1.TSCONFIG_FILE_NAME) {
21
- this.appRoot = appRoot;
22
- this.logger = logger;
23
- this.tsconfig = tsconfig;
24
- /**
25
- * Reference to the typescript compiler
26
- */
27
- this.tsCompiler = new chokidar_ts_1.TypescriptCompiler(this.appRoot, this.tsconfig, require((0, helpers_1.resolveFrom)(this.appRoot, 'typescript/lib/typescript')));
28
- }
29
- /**
30
- * Render ts diagnostics
31
- */
32
- renderDiagnostics(diagnostics, host) {
33
- console.error(this.tsCompiler.ts.formatDiagnosticsWithColorAndContext(diagnostics, host));
34
- }
35
- /**
36
- * Parses the tsconfig file
37
- */
38
- parseConfig() {
39
- const { error, config } = this.tsCompiler.configParser().parse();
40
- if (error) {
41
- this.logger.error(`unable to parse ${this.tsconfig}`);
42
- this.renderDiagnostics([error], this.tsCompiler.ts.createCompilerHost({}));
43
- return;
44
- }
45
- if (config && config.errors.length) {
46
- this.logger.error(`unable to parse ${this.tsconfig}`);
47
- this.renderDiagnostics(config.errors, this.tsCompiler.ts.createCompilerHost(config.options));
48
- return;
49
- }
50
- config.options.rootDir = config.options.rootDir || this.appRoot;
51
- config.options.outDir = config.options.outDir || (0, path_1.join)(this.appRoot, paths_1.DEFAULT_BUILD_DIR);
52
- return config;
53
- }
54
- }
55
- exports.Ts = Ts;
1
+ "use strict";
2
+ /*
3
+ * @adonisjs/assembler
4
+ *
5
+ * (c) Harminder Virk <virk@adonisjs.com>
6
+ *
7
+ * For the full copyright and license information, please view the LICENSE
8
+ * file that was distributed with this source code.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.Ts = void 0;
12
+ const path_1 = require("path");
13
+ const chokidar_ts_1 = require("@poppinss/chokidar-ts");
14
+ const helpers_1 = require("@poppinss/utils/build/helpers");
15
+ const paths_1 = require("../../config/paths");
16
+ /**
17
+ * Exposes the API to work with the Typescript compiler API
18
+ */
19
+ class Ts {
20
+ constructor(appRoot, logger, tsconfig = paths_1.TSCONFIG_FILE_NAME) {
21
+ this.appRoot = appRoot;
22
+ this.logger = logger;
23
+ this.tsconfig = tsconfig;
24
+ /**
25
+ * Reference to the typescript compiler
26
+ */
27
+ this.tsCompiler = new chokidar_ts_1.TypescriptCompiler(this.appRoot, this.tsconfig, require((0, helpers_1.resolveFrom)(this.appRoot, 'typescript/lib/typescript')));
28
+ }
29
+ /**
30
+ * Render ts diagnostics
31
+ */
32
+ renderDiagnostics(diagnostics, host) {
33
+ console.error(this.tsCompiler.ts.formatDiagnosticsWithColorAndContext(diagnostics, host));
34
+ }
35
+ /**
36
+ * Parses the tsconfig file
37
+ */
38
+ parseConfig() {
39
+ const { error, config } = this.tsCompiler.configParser().parse();
40
+ if (error) {
41
+ this.logger.error(`unable to parse ${this.tsconfig}`);
42
+ this.renderDiagnostics([error], this.tsCompiler.ts.createCompilerHost({}));
43
+ return;
44
+ }
45
+ if (config && config.errors.length) {
46
+ this.logger.error(`unable to parse ${this.tsconfig}`);
47
+ this.renderDiagnostics(config.errors, this.tsCompiler.ts.createCompilerHost(config.options));
48
+ return;
49
+ }
50
+ config.options.rootDir = config.options.rootDir || this.appRoot;
51
+ config.options.outDir = config.options.outDir || (0, path_1.join)(this.appRoot, paths_1.DEFAULT_BUILD_DIR);
52
+ return config;
53
+ }
54
+ }
55
+ exports.Ts = Ts;
@@ -1,5 +1,5 @@
1
- /**
2
- * Exports the function to be used for registering require hook
3
- * for AdonisJS applications
4
- */
5
- export default function registerForAdonis(appRoot: string): void;
1
+ /**
2
+ * Exports the function to be used for registering require hook
3
+ * for AdonisJS applications
4
+ */
5
+ export default function registerForAdonis(appRoot: string): void;
@@ -1,28 +1,28 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/assembler
4
- *
5
- * (c) Harminder Virk <virk@adonisjs.com>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- const require_ts_1 = require("@adonisjs/require-ts");
12
- /**
13
- * Exports the function to be used for registering require hook
14
- * for AdonisJS applications
15
- */
16
- function registerForAdonis(appRoot) {
17
- return (0, require_ts_1.register)(appRoot, {
18
- cache: true,
19
- transformers: {
20
- after: [
21
- {
22
- transform: '@adonisjs/assembler/build/src/requireHook/ioc-transformer',
23
- },
24
- ],
25
- },
26
- });
27
- }
28
- exports.default = registerForAdonis;
1
+ "use strict";
2
+ /*
3
+ * @adonisjs/assembler
4
+ *
5
+ * (c) Harminder Virk <virk@adonisjs.com>
6
+ *
7
+ * For the full copyright and license information, please view the LICENSE
8
+ * file that was distributed with this source code.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ const require_ts_1 = require("@adonisjs/require-ts");
12
+ /**
13
+ * Exports the function to be used for registering require hook
14
+ * for AdonisJS applications
15
+ */
16
+ function registerForAdonis(appRoot) {
17
+ return (0, require_ts_1.register)(appRoot, {
18
+ cache: true,
19
+ transformers: {
20
+ after: [
21
+ {
22
+ transform: '@adonisjs/assembler/build/src/requireHook/ioc-transformer',
23
+ },
24
+ ],
25
+ },
26
+ });
27
+ }
28
+ exports.default = registerForAdonis;
@@ -1,6 +1,6 @@
1
- import type tsStatic from 'typescript';
2
- /**
3
- * Transformer to transform AdonisJS IoC container import
4
- * statements
5
- */
6
- export default function (ts: typeof tsStatic, appRoot: string): (ctx: tsStatic.TransformationContext) => (sourceFile: tsStatic.SourceFile) => tsStatic.SourceFile;
1
+ import type tsStatic from 'typescript';
2
+ /**
3
+ * Transformer to transform AdonisJS IoC container import
4
+ * statements
5
+ */
6
+ export default function (ts: typeof tsStatic, appRoot: string): (ctx: tsStatic.TransformationContext) => (sourceFile: tsStatic.SourceFile) => tsStatic.SourceFile;
@@ -1,21 +1,21 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/assembler
4
- *
5
- * (c) Harminder Virk <virk@adonisjs.com>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- const path_1 = require("path");
12
- const application_1 = require("@adonisjs/application");
13
- const ioc_transformer_1 = require("@adonisjs/ioc-transformer");
14
- /**
15
- * Transformer to transform AdonisJS IoC container import
16
- * statements
17
- */
18
- function default_1(ts, appRoot) {
19
- return (0, ioc_transformer_1.iocTransformer)(ts, application_1.rcParser.parse(require((0, path_1.join)(appRoot, '.adonisrc.json'))));
20
- }
21
- exports.default = default_1;
1
+ "use strict";
2
+ /*
3
+ * @adonisjs/assembler
4
+ *
5
+ * (c) Harminder Virk <virk@adonisjs.com>
6
+ *
7
+ * For the full copyright and license information, please view the LICENSE
8
+ * file that was distributed with this source code.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ const path_1 = require("path");
12
+ const application_1 = require("@adonisjs/application");
13
+ const ioc_transformer_1 = require("@adonisjs/ioc-transformer");
14
+ /**
15
+ * Transformer to transform AdonisJS IoC container import
16
+ * statements
17
+ */
18
+ function default_1(ts, appRoot) {
19
+ return (0, ioc_transformer_1.iocTransformer)(ts, application_1.rcParser.parse(require((0, path_1.join)(appRoot, '.adonisrc.json'))));
20
+ }
21
+ exports.default = default_1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adonisjs/assembler",
3
- "version": "5.9.2",
3
+ "version": "5.9.3",
4
4
  "description": "Core commands to compiler and build AdonisJs project",
5
5
  "main": "build/ace-manifest.json",
6
6
  "files": [
@@ -52,13 +52,13 @@
52
52
  "@japa/runner": "^2.2.1",
53
53
  "@japa/spec-reporter": "^1.3.1",
54
54
  "@poppinss/dev-utils": "^2.0.3",
55
- "@types/node": "^18.7.18",
55
+ "@types/node": "^18.8.3",
56
56
  "commitizen": "^4.2.5",
57
57
  "copyfiles": "^2.4.1",
58
58
  "cross-env": "^7.0.3",
59
59
  "cz-conventional-changelog": "^3.3.0",
60
60
  "del-cli": "^5.0.0",
61
- "eslint": "^8.23.1",
61
+ "eslint": "^8.24.0",
62
62
  "eslint-config-prettier": "^8.5.0",
63
63
  "eslint-plugin-adonis": "^2.1.1",
64
64
  "eslint-plugin-prettier": "^4.2.1",
@@ -67,7 +67,7 @@
67
67
  "mrm": "^4.1.6",
68
68
  "np": "^7.6.2",
69
69
  "prettier": "^2.7.1",
70
- "typescript": "^4.8.3"
70
+ "typescript": "^4.8.4"
71
71
  },
72
72
  "nyc": {
73
73
  "exclude": [
@@ -98,7 +98,7 @@
98
98
  "@adonisjs/require-ts": "^2.0.13",
99
99
  "@adonisjs/sink": "^5.4.1",
100
100
  "@poppinss/chokidar-ts": "^3.3.5",
101
- "@poppinss/cliui": "^3.0.2",
101
+ "@poppinss/cliui": "^3.0.4",
102
102
  "@poppinss/utils": "^5.0.0",
103
103
  "cpy": "^8.1.2",
104
104
  "emittery": "^0.13.1",