@adonisjs/assembler 5.9.1 → 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 (66) hide show
  1. package/build/ace-manifest.json +11 -11
  2. package/build/commands/Build.d.ts +37 -37
  3. package/build/commands/Build.js +138 -138
  4. package/build/commands/Invoke.d.ts +34 -34
  5. package/build/commands/Invoke.js +221 -221
  6. package/build/commands/Make/Base.d.ts +30 -30
  7. package/build/commands/Make/Base.js +75 -75
  8. package/build/commands/Make/Command.d.ts +35 -35
  9. package/build/commands/Make/Command.js +82 -82
  10. package/build/commands/Make/Controller.d.ts +37 -37
  11. package/build/commands/Make/Controller.js +89 -89
  12. package/build/commands/Make/Exception.d.ts +32 -32
  13. package/build/commands/Make/Exception.js +75 -75
  14. package/build/commands/Make/Listener.d.ts +30 -30
  15. package/build/commands/Make/Listener.js +70 -70
  16. package/build/commands/Make/Middleware.d.ts +31 -31
  17. package/build/commands/Make/Middleware.js +87 -87
  18. package/build/commands/Make/PreloadFile.d.ts +38 -38
  19. package/build/commands/Make/PreloadFile.js +157 -157
  20. package/build/commands/Make/Provider.d.ts +31 -31
  21. package/build/commands/Make/Provider.js +114 -114
  22. package/build/commands/Make/Suite.d.ts +41 -41
  23. package/build/commands/Make/Suite.js +120 -120
  24. package/build/commands/Make/Test.d.ts +35 -35
  25. package/build/commands/Make/Test.js +96 -96
  26. package/build/commands/Make/Validator.d.ts +31 -31
  27. package/build/commands/Make/Validator.js +71 -71
  28. package/build/commands/Make/View.d.ts +30 -30
  29. package/build/commands/Make/View.js +70 -70
  30. package/build/commands/Serve.d.ts +33 -33
  31. package/build/commands/Serve.js +112 -112
  32. package/build/commands/Test.d.ts +57 -57
  33. package/build/commands/Test.js +159 -159
  34. package/build/commands/TypeCheck.d.ts +16 -16
  35. package/build/commands/TypeCheck.js +85 -85
  36. package/build/config/paths.d.ts +7 -7
  37. package/build/config/paths.js +18 -18
  38. package/build/register.d.ts +1 -1
  39. package/build/register.js +15 -15
  40. package/build/src/AssetsBundler/index.d.ts +76 -76
  41. package/build/src/AssetsBundler/index.js +216 -216
  42. package/build/src/Compiler/index.d.ts +62 -62
  43. package/build/src/Compiler/index.js +287 -287
  44. package/build/src/Contracts/index.d.ts +8 -8
  45. package/build/src/Contracts/index.js +10 -10
  46. package/build/src/DevServer/index.d.ts +70 -70
  47. package/build/src/DevServer/index.js +306 -306
  48. package/build/src/EnvParser/index.d.ts +21 -23
  49. package/build/src/EnvParser/index.js +48 -52
  50. package/build/src/HttpServer/index.d.ts +34 -34
  51. package/build/src/HttpServer/index.js +87 -87
  52. package/build/src/Manifest/index.d.ts +32 -32
  53. package/build/src/Manifest/index.js +88 -88
  54. package/build/src/RcFile/index.d.ts +72 -72
  55. package/build/src/RcFile/index.js +174 -174
  56. package/build/src/Test/index.d.ts +75 -75
  57. package/build/src/Test/index.js +346 -346
  58. package/build/src/Test/process.d.ts +22 -22
  59. package/build/src/Test/process.js +68 -68
  60. package/build/src/Ts/index.d.ts +24 -24
  61. package/build/src/Ts/index.js +55 -55
  62. package/build/src/requireHook/index.d.ts +5 -5
  63. package/build/src/requireHook/index.js +28 -28
  64. package/build/src/requireHook/ioc-transformer.d.ts +6 -6
  65. package/build/src/requireHook/ioc-transformer.js +21 -21
  66. package/package.json +5 -5
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "make:command": {
70
70
  "settings": {},
71
- "commandPath": "./commands/Make\\Command",
71
+ "commandPath": "./commands/Make/Command",
72
72
  "commandName": "make:command",
73
73
  "description": "Make a new ace command",
74
74
  "args": [
@@ -93,7 +93,7 @@
93
93
  },
94
94
  "make:controller": {
95
95
  "settings": {},
96
- "commandPath": "./commands/Make\\Controller",
96
+ "commandPath": "./commands/Make/Controller",
97
97
  "commandName": "make:controller",
98
98
  "description": "Make a new HTTP controller",
99
99
  "args": [
@@ -125,7 +125,7 @@
125
125
  },
126
126
  "make:exception": {
127
127
  "settings": {},
128
- "commandPath": "./commands/Make\\Exception",
128
+ "commandPath": "./commands/Make/Exception",
129
129
  "commandName": "make:exception",
130
130
  "description": "Make a new custom exception class",
131
131
  "args": [
@@ -156,7 +156,7 @@
156
156
  },
157
157
  "make:listener": {
158
158
  "settings": {},
159
- "commandPath": "./commands/Make\\Listener",
159
+ "commandPath": "./commands/Make/Listener",
160
160
  "commandName": "make:listener",
161
161
  "description": "Make a new event listener class",
162
162
  "args": [
@@ -181,7 +181,7 @@
181
181
  },
182
182
  "make:middleware": {
183
183
  "settings": {},
184
- "commandPath": "./commands/Make\\Middleware",
184
+ "commandPath": "./commands/Make/Middleware",
185
185
  "commandName": "make:middleware",
186
186
  "description": "Make a new middleware",
187
187
  "args": [
@@ -206,7 +206,7 @@
206
206
  },
207
207
  "make:prldfile": {
208
208
  "settings": {},
209
- "commandPath": "./commands/Make\\PreloadFile",
209
+ "commandPath": "./commands/Make/PreloadFile",
210
210
  "commandName": "make:prldfile",
211
211
  "description": "Make a new preload file",
212
212
  "args": [
@@ -230,7 +230,7 @@
230
230
  },
231
231
  "make:provider": {
232
232
  "settings": {},
233
- "commandPath": "./commands/Make\\Provider",
233
+ "commandPath": "./commands/Make/Provider",
234
234
  "commandName": "make:provider",
235
235
  "description": "Make a new provider class",
236
236
  "args": [
@@ -261,7 +261,7 @@
261
261
  },
262
262
  "make:suite": {
263
263
  "settings": {},
264
- "commandPath": "./commands/Make\\Suite",
264
+ "commandPath": "./commands/Make/Suite",
265
265
  "commandName": "make:suite",
266
266
  "description": "Create a new test suite",
267
267
  "args": [
@@ -292,7 +292,7 @@
292
292
  },
293
293
  "make:test": {
294
294
  "settings": {},
295
- "commandPath": "./commands/Make\\Test",
295
+ "commandPath": "./commands/Make/Test",
296
296
  "commandName": "make:test",
297
297
  "description": "Make a new test",
298
298
  "args": [
@@ -324,7 +324,7 @@
324
324
  },
325
325
  "make:validator": {
326
326
  "settings": {},
327
- "commandPath": "./commands/Make\\Validator",
327
+ "commandPath": "./commands/Make/Validator",
328
328
  "commandName": "make:validator",
329
329
  "description": "Make a new validator",
330
330
  "args": [
@@ -349,7 +349,7 @@
349
349
  },
350
350
  "make:view": {
351
351
  "settings": {},
352
- "commandPath": "./commands/Make\\View",
352
+ "commandPath": "./commands/Make/View",
353
353
  "commandName": "make:view",
354
354
  "description": "Make a new view template",
355
355
  "args": [
@@ -1,37 +1,37 @@
1
- import { BaseCommand } from '@adonisjs/core/build/standalone';
2
- /**
3
- * Compile typescript project Javascript
4
- */
5
- export default class Build extends BaseCommand {
6
- static commandName: string;
7
- static description: string;
8
- /**
9
- * Build for production
10
- */
11
- production: boolean;
12
- /**
13
- * Bundle frontend assets. Defaults to true
14
- */
15
- assets: boolean;
16
- /**
17
- * Ignore ts errors and complete the build process. Defaults to false
18
- */
19
- ignoreTsErrors: boolean;
20
- /**
21
- * Path to the TypeScript project configuration file. Defaults to "tsconfig.json"
22
- */
23
- tsconfig: string;
24
- /**
25
- * Arguments to pass to the `encore` binary
26
- */
27
- encoreArgs: string[];
28
- /**
29
- * Select the client for deciding the lock file to copy to the
30
- * build folder
31
- */
32
- client: string;
33
- /**
34
- * Invoked automatically by ace
35
- */
36
- run(): Promise<void>;
37
- }
1
+ import { BaseCommand } from '@adonisjs/core/build/standalone';
2
+ /**
3
+ * Compile typescript project Javascript
4
+ */
5
+ export default class Build extends BaseCommand {
6
+ static commandName: string;
7
+ static description: string;
8
+ /**
9
+ * Build for production
10
+ */
11
+ production: boolean;
12
+ /**
13
+ * Bundle frontend assets. Defaults to true
14
+ */
15
+ assets: boolean;
16
+ /**
17
+ * Ignore ts errors and complete the build process. Defaults to false
18
+ */
19
+ ignoreTsErrors: boolean;
20
+ /**
21
+ * Path to the TypeScript project configuration file. Defaults to "tsconfig.json"
22
+ */
23
+ tsconfig: string;
24
+ /**
25
+ * Arguments to pass to the `encore` binary
26
+ */
27
+ encoreArgs: string[];
28
+ /**
29
+ * Select the client for deciding the lock file to copy to the
30
+ * build folder
31
+ */
32
+ client: string;
33
+ /**
34
+ * Invoked automatically by ace
35
+ */
36
+ run(): Promise<void>;
37
+ }
@@ -1,138 +1,138 @@
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- var desc = Object.getOwnPropertyDescriptor(m, k);
13
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14
- desc = { enumerable: true, get: function() { return m[k]; } };
15
- }
16
- Object.defineProperty(o, k2, desc);
17
- }) : (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- o[k2] = m[k];
20
- }));
21
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
22
- Object.defineProperty(o, "default", { enumerable: true, value: v });
23
- }) : function(o, v) {
24
- o["default"] = v;
25
- });
26
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
27
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
28
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
29
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
30
- return c > 3 && r && Object.defineProperty(target, key, r), r;
31
- };
32
- var __importStar = (this && this.__importStar) || function (mod) {
33
- if (mod && mod.__esModule) return mod;
34
- var result = {};
35
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
36
- __setModuleDefault(result, mod);
37
- return result;
38
- };
39
- var __metadata = (this && this.__metadata) || function (k, v) {
40
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
41
- };
42
- var __importDefault = (this && this.__importDefault) || function (mod) {
43
- return (mod && mod.__esModule) ? mod : { "default": mod };
44
- };
45
- Object.defineProperty(exports, "__esModule", { value: true });
46
- const has_yarn_1 = __importDefault(require("has-yarn"));
47
- const standalone_1 = require("@adonisjs/core/build/standalone");
48
- const paths_1 = require("../config/paths");
49
- /**
50
- * Compile typescript project Javascript
51
- */
52
- class Build extends standalone_1.BaseCommand {
53
- constructor() {
54
- super(...arguments);
55
- /**
56
- * Bundle frontend assets. Defaults to true
57
- */
58
- this.assets = true;
59
- /**
60
- * Path to the TypeScript project configuration file. Defaults to "tsconfig.json"
61
- */
62
- this.tsconfig = paths_1.TSCONFIG_FILE_NAME;
63
- /**
64
- * Arguments to pass to the `encore` binary
65
- */
66
- this.encoreArgs = [];
67
- }
68
- /**
69
- * Invoked automatically by ace
70
- */
71
- async run() {
72
- const { Compiler } = await Promise.resolve().then(() => __importStar(require('../src/Compiler')));
73
- /**
74
- * Deciding the client to use for installing dependencies
75
- */
76
- this.client = this.client || (0, has_yarn_1.default)(this.application.appRoot) ? 'yarn' : 'npm';
77
- if (this.client !== 'npm' && this.client !== 'yarn') {
78
- this.logger.warning('--client must be set to "npm" or "yarn"');
79
- this.exitCode = 1;
80
- return;
81
- }
82
- /**
83
- * Stop on error when "ignoreTsErrors" is not set
84
- */
85
- const stopOnError = !this.ignoreTsErrors;
86
- try {
87
- const compiler = new Compiler(this.application.appRoot, this.encoreArgs, this.assets, this.logger, this.tsconfig);
88
- const compiled = this.production
89
- ? await compiler.compileForProduction(stopOnError, this.client)
90
- : await compiler.compile(stopOnError);
91
- /**
92
- * Set exitCode based upon the compiled status
93
- */
94
- if (!compiled) {
95
- this.exitCode = 1;
96
- }
97
- }
98
- catch (error) {
99
- this.logger.fatal(error);
100
- this.exitCode = 1;
101
- }
102
- }
103
- }
104
- Build.commandName = 'build';
105
- Build.description = 'Compile project from Typescript to Javascript. Also compiles the frontend assets if using webpack encore';
106
- __decorate([
107
- standalone_1.flags.boolean({ description: 'Build for production', alias: 'prod' }),
108
- __metadata("design:type", Boolean)
109
- ], Build.prototype, "production", void 0);
110
- __decorate([
111
- standalone_1.flags.boolean({
112
- description: 'Build frontend assets when webpack encore is installed. Use --no-assets to disable',
113
- }),
114
- __metadata("design:type", Boolean)
115
- ], Build.prototype, "assets", void 0);
116
- __decorate([
117
- standalone_1.flags.boolean({
118
- description: 'Ignore typescript errors and complete the build process',
119
- }),
120
- __metadata("design:type", Boolean)
121
- ], Build.prototype, "ignoreTsErrors", void 0);
122
- __decorate([
123
- standalone_1.flags.string({
124
- description: 'Path to the TypeScript project configuration file',
125
- }),
126
- __metadata("design:type", String)
127
- ], Build.prototype, "tsconfig", void 0);
128
- __decorate([
129
- standalone_1.flags.array({ description: 'CLI options to pass to the encore command line' }),
130
- __metadata("design:type", Array)
131
- ], Build.prototype, "encoreArgs", void 0);
132
- __decorate([
133
- standalone_1.flags.string({
134
- description: 'Select the package manager to decide which lock file to copy to the build folder',
135
- }),
136
- __metadata("design:type", String)
137
- ], Build.prototype, "client", void 0);
138
- exports.default = Build;
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ var desc = Object.getOwnPropertyDescriptor(m, k);
13
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14
+ desc = { enumerable: true, get: function() { return m[k]; } };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
22
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
23
+ }) : function(o, v) {
24
+ o["default"] = v;
25
+ });
26
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
27
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
28
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
29
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
30
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
31
+ };
32
+ var __importStar = (this && this.__importStar) || function (mod) {
33
+ if (mod && mod.__esModule) return mod;
34
+ var result = {};
35
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
36
+ __setModuleDefault(result, mod);
37
+ return result;
38
+ };
39
+ var __metadata = (this && this.__metadata) || function (k, v) {
40
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
41
+ };
42
+ var __importDefault = (this && this.__importDefault) || function (mod) {
43
+ return (mod && mod.__esModule) ? mod : { "default": mod };
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ const has_yarn_1 = __importDefault(require("has-yarn"));
47
+ const standalone_1 = require("@adonisjs/core/build/standalone");
48
+ const paths_1 = require("../config/paths");
49
+ /**
50
+ * Compile typescript project Javascript
51
+ */
52
+ class Build extends standalone_1.BaseCommand {
53
+ constructor() {
54
+ super(...arguments);
55
+ /**
56
+ * Bundle frontend assets. Defaults to true
57
+ */
58
+ this.assets = true;
59
+ /**
60
+ * Path to the TypeScript project configuration file. Defaults to "tsconfig.json"
61
+ */
62
+ this.tsconfig = paths_1.TSCONFIG_FILE_NAME;
63
+ /**
64
+ * Arguments to pass to the `encore` binary
65
+ */
66
+ this.encoreArgs = [];
67
+ }
68
+ /**
69
+ * Invoked automatically by ace
70
+ */
71
+ async run() {
72
+ const { Compiler } = await Promise.resolve().then(() => __importStar(require('../src/Compiler')));
73
+ /**
74
+ * Deciding the client to use for installing dependencies
75
+ */
76
+ this.client = this.client || (0, has_yarn_1.default)(this.application.appRoot) ? 'yarn' : 'npm';
77
+ if (this.client !== 'npm' && this.client !== 'yarn') {
78
+ this.logger.warning('--client must be set to "npm" or "yarn"');
79
+ this.exitCode = 1;
80
+ return;
81
+ }
82
+ /**
83
+ * Stop on error when "ignoreTsErrors" is not set
84
+ */
85
+ const stopOnError = !this.ignoreTsErrors;
86
+ try {
87
+ const compiler = new Compiler(this.application.appRoot, this.encoreArgs, this.assets, this.logger, this.tsconfig);
88
+ const compiled = this.production
89
+ ? await compiler.compileForProduction(stopOnError, this.client)
90
+ : await compiler.compile(stopOnError);
91
+ /**
92
+ * Set exitCode based upon the compiled status
93
+ */
94
+ if (!compiled) {
95
+ this.exitCode = 1;
96
+ }
97
+ }
98
+ catch (error) {
99
+ this.logger.fatal(error);
100
+ this.exitCode = 1;
101
+ }
102
+ }
103
+ }
104
+ Build.commandName = 'build';
105
+ Build.description = 'Compile project from Typescript to Javascript. Also compiles the frontend assets if using webpack encore';
106
+ __decorate([
107
+ standalone_1.flags.boolean({ description: 'Build for production', alias: 'prod' }),
108
+ __metadata("design:type", Boolean)
109
+ ], Build.prototype, "production", void 0);
110
+ __decorate([
111
+ standalone_1.flags.boolean({
112
+ description: 'Build frontend assets when webpack encore is installed. Use --no-assets to disable',
113
+ }),
114
+ __metadata("design:type", Boolean)
115
+ ], Build.prototype, "assets", void 0);
116
+ __decorate([
117
+ standalone_1.flags.boolean({
118
+ description: 'Ignore typescript errors and complete the build process',
119
+ }),
120
+ __metadata("design:type", Boolean)
121
+ ], Build.prototype, "ignoreTsErrors", void 0);
122
+ __decorate([
123
+ standalone_1.flags.string({
124
+ description: 'Path to the TypeScript project configuration file',
125
+ }),
126
+ __metadata("design:type", String)
127
+ ], Build.prototype, "tsconfig", void 0);
128
+ __decorate([
129
+ standalone_1.flags.array({ description: 'CLI options to pass to the encore command line' }),
130
+ __metadata("design:type", Array)
131
+ ], Build.prototype, "encoreArgs", void 0);
132
+ __decorate([
133
+ standalone_1.flags.string({
134
+ description: 'Select the package manager to decide which lock file to copy to the build folder',
135
+ }),
136
+ __metadata("design:type", String)
137
+ ], Build.prototype, "client", void 0);
138
+ exports.default = Build;
@@ -1,34 +1,34 @@
1
- import { BaseCommand } from '@adonisjs/core/build/standalone';
2
- /**
3
- * Configure a package
4
- */
5
- export default class Configure extends BaseCommand {
6
- static commandName: string;
7
- static description: string;
8
- static aliases: string[];
9
- private appType;
10
- /**
11
- * Use yarn when building for production to install dependencies
12
- */
13
- packages: string[];
14
- /**
15
- * Returns package manager for installing dependencies
16
- */
17
- private getPackageManager;
18
- /**
19
- * Configure encore
20
- */
21
- private configureEncore;
22
- /**
23
- * Configure tests
24
- */
25
- private configureTests;
26
- /**
27
- * Configure a give package
28
- */
29
- private configurePackage;
30
- /**
31
- * Invoked automatically by ace
32
- */
33
- run(): Promise<void>;
34
- }
1
+ import { BaseCommand } from '@adonisjs/core/build/standalone';
2
+ /**
3
+ * Configure a package
4
+ */
5
+ export default class Configure extends BaseCommand {
6
+ static commandName: string;
7
+ static description: string;
8
+ static aliases: string[];
9
+ private appType;
10
+ /**
11
+ * Use yarn when building for production to install dependencies
12
+ */
13
+ packages: string[];
14
+ /**
15
+ * Returns package manager for installing dependencies
16
+ */
17
+ private getPackageManager;
18
+ /**
19
+ * Configure encore
20
+ */
21
+ private configureEncore;
22
+ /**
23
+ * Configure tests
24
+ */
25
+ private configureTests;
26
+ /**
27
+ * Configure a give package
28
+ */
29
+ private configurePackage;
30
+ /**
31
+ * Invoked automatically by ace
32
+ */
33
+ run(): Promise<void>;
34
+ }