@adonisjs/assembler 5.9.4 → 6.0.0-0

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 (97) hide show
  1. package/LICENSE.md +1 -1
  2. package/build/index.d.ts +2 -0
  3. package/build/index.js +2 -0
  4. package/build/src/bundler.d.ts +10 -0
  5. package/build/src/bundler.js +133 -0
  6. package/build/src/dev_server.d.ts +13 -0
  7. package/build/src/dev_server.js +189 -0
  8. package/build/src/run.d.ts +3 -0
  9. package/build/src/run.js +19 -0
  10. package/build/src/types.d.ts +26 -0
  11. package/build/src/watch.d.ts +8 -0
  12. package/build/src/watch.js +18 -0
  13. package/package.json +77 -99
  14. package/build/ace-manifest.json +0 -521
  15. package/build/commands/Build.d.ts +0 -37
  16. package/build/commands/Build.js +0 -138
  17. package/build/commands/Invoke.d.ts +0 -34
  18. package/build/commands/Invoke.js +0 -234
  19. package/build/commands/Make/Base.d.ts +0 -30
  20. package/build/commands/Make/Base.js +0 -75
  21. package/build/commands/Make/Command.d.ts +0 -35
  22. package/build/commands/Make/Command.js +0 -82
  23. package/build/commands/Make/Controller.d.ts +0 -37
  24. package/build/commands/Make/Controller.js +0 -89
  25. package/build/commands/Make/Exception.d.ts +0 -32
  26. package/build/commands/Make/Exception.js +0 -75
  27. package/build/commands/Make/Listener.d.ts +0 -30
  28. package/build/commands/Make/Listener.js +0 -70
  29. package/build/commands/Make/Middleware.d.ts +0 -31
  30. package/build/commands/Make/Middleware.js +0 -87
  31. package/build/commands/Make/PreloadFile.d.ts +0 -38
  32. package/build/commands/Make/PreloadFile.js +0 -157
  33. package/build/commands/Make/Provider.d.ts +0 -31
  34. package/build/commands/Make/Provider.js +0 -114
  35. package/build/commands/Make/Suite.d.ts +0 -41
  36. package/build/commands/Make/Suite.js +0 -120
  37. package/build/commands/Make/Test.d.ts +0 -35
  38. package/build/commands/Make/Test.js +0 -96
  39. package/build/commands/Make/Validator.d.ts +0 -31
  40. package/build/commands/Make/Validator.js +0 -71
  41. package/build/commands/Make/View.d.ts +0 -30
  42. package/build/commands/Make/View.js +0 -70
  43. package/build/commands/Serve.d.ts +0 -33
  44. package/build/commands/Serve.js +0 -112
  45. package/build/commands/Test.d.ts +0 -57
  46. package/build/commands/Test.js +0 -159
  47. package/build/commands/TypeCheck.d.ts +0 -16
  48. package/build/commands/TypeCheck.js +0 -85
  49. package/build/config/paths.d.ts +0 -7
  50. package/build/config/paths.js +0 -18
  51. package/build/register.js +0 -15
  52. package/build/src/AssetsBundler/index.d.ts +0 -76
  53. package/build/src/AssetsBundler/index.js +0 -216
  54. package/build/src/Compiler/index.d.ts +0 -62
  55. package/build/src/Compiler/index.js +0 -287
  56. package/build/src/Contracts/index.d.ts +0 -8
  57. package/build/src/Contracts/index.js +0 -10
  58. package/build/src/DevServer/index.d.ts +0 -70
  59. package/build/src/DevServer/index.js +0 -306
  60. package/build/src/EnvParser/index.d.ts +0 -21
  61. package/build/src/EnvParser/index.js +0 -48
  62. package/build/src/HttpServer/index.d.ts +0 -34
  63. package/build/src/HttpServer/index.js +0 -87
  64. package/build/src/Manifest/index.d.ts +0 -32
  65. package/build/src/Manifest/index.js +0 -88
  66. package/build/src/RcFile/index.d.ts +0 -72
  67. package/build/src/RcFile/index.js +0 -174
  68. package/build/src/Test/index.d.ts +0 -75
  69. package/build/src/Test/index.js +0 -346
  70. package/build/src/Test/process.d.ts +0 -22
  71. package/build/src/Test/process.js +0 -68
  72. package/build/src/Ts/index.d.ts +0 -24
  73. package/build/src/Ts/index.js +0 -55
  74. package/build/src/requireHook/index.d.ts +0 -5
  75. package/build/src/requireHook/index.js +0 -28
  76. package/build/src/requireHook/ioc-transformer.d.ts +0 -6
  77. package/build/src/requireHook/ioc-transformer.js +0 -21
  78. package/build/templates/command.txt +0 -33
  79. package/build/templates/controller.txt +0 -3
  80. package/build/templates/event-listener.txt +0 -3
  81. package/build/templates/exception.txt +0 -15
  82. package/build/templates/middleware.txt +0 -8
  83. package/build/templates/preload-file.txt +0 -9
  84. package/build/templates/provider.txt +0 -40
  85. package/build/templates/resource-controller.txt +0 -17
  86. package/build/templates/self-handle-exception.txt +0 -32
  87. package/build/templates/test-entrypoint.txt +0 -45
  88. package/build/templates/test.txt +0 -5
  89. package/build/templates/tests/bootstrap.txt +0 -69
  90. package/build/templates/tests/functional/hello_world_api.spec.txt +0 -8
  91. package/build/templates/tests/functional/hello_world_slim.spec.txt +0 -8
  92. package/build/templates/tests/functional/hello_world_web.spec.txt +0 -8
  93. package/build/templates/tests-contract.txt +0 -18
  94. package/build/templates/validator.txt +0 -40
  95. package/build/templates/view.txt +0 -0
  96. package/build/templates/webpack.config.txt +0 -214
  97. /package/build/{register.d.ts → src/types.js} +0 -0
@@ -1,120 +0,0 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/assembler
4
- *
5
- * (c) AdonisJS
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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
11
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
12
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
13
- 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;
14
- return c > 3 && r && Object.defineProperty(target, key, r), r;
15
- };
16
- var __metadata = (this && this.__metadata) || function (k, v) {
17
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
18
- };
19
- var __importDefault = (this && this.__importDefault) || function (mod) {
20
- return (mod && mod.__esModule) ? mod : { "default": mod };
21
- };
22
- Object.defineProperty(exports, "__esModule", { value: true });
23
- const standalone_1 = require("@adonisjs/core/build/standalone");
24
- const sink_1 = require("@adonisjs/sink");
25
- const glob_parent_1 = __importDefault(require("glob-parent"));
26
- const path_1 = require("path");
27
- /**
28
- * Create a new test suite
29
- */
30
- class CreateSuite extends standalone_1.BaseCommand {
31
- constructor() {
32
- super(...arguments);
33
- /**
34
- * Glob pattern for the test suite, or only location to the test suite
35
- */
36
- this.location = '';
37
- /**
38
- * Should add a sample test file
39
- */
40
- this.withExampleTest = true;
41
- }
42
- /**
43
- * Get the destination path for the sample test file
44
- */
45
- getExampleTestDestinationPath() {
46
- return (0, glob_parent_1.default)(this.location) + '/test.spec.ts';
47
- }
48
- /**
49
- * Generate suite glob pattern based on `location` argument
50
- */
51
- generateSuiteGlobPattern() {
52
- if (!this.location) {
53
- this.location = `tests/${this.suite}`;
54
- }
55
- if (!['*', '.js', '.ts'].find((keyword) => this.location.includes(keyword))) {
56
- this.location = `${this.location}/**/*.spec(.ts|.js)`;
57
- }
58
- }
59
- /**
60
- * Check if the suite name is already defined in RcFile
61
- */
62
- checkIfSuiteExists(rcFile) {
63
- const existingSuites = rcFile.get('tests.suites') || [];
64
- const existingSuitesNames = existingSuites.map((suite) => suite.name);
65
- return existingSuitesNames.includes(this.suite);
66
- }
67
- /**
68
- * Add the new test suite to the AdonisRC File and save it
69
- */
70
- async addSuiteToRcFile() {
71
- const rcFile = new sink_1.files.AdonisRcFile(this.application.appRoot);
72
- const existingSuites = rcFile.get('tests.suites') || [];
73
- if (this.checkIfSuiteExists(rcFile)) {
74
- return sink_1.logger.action('update').skipped(`Suite ${this.suite} already exists`);
75
- }
76
- rcFile.set('tests.suites', [
77
- ...existingSuites,
78
- {
79
- name: this.suite,
80
- files: [this.location],
81
- timeout: 60 * 1000,
82
- },
83
- ]);
84
- rcFile.commit();
85
- sink_1.logger.action('update').succeeded('.adonisrc.json');
86
- }
87
- /**
88
- * Add a sample test file to the new suite folder
89
- */
90
- createSampleTestFile() {
91
- const path = this.getExampleTestDestinationPath();
92
- const testFile = new sink_1.files.MustacheFile(this.application.appRoot, path, (0, path_1.join)(__dirname, '../..', 'templates/test.txt'));
93
- if (!testFile.exists()) {
94
- testFile.apply({}).commit();
95
- sink_1.logger.action('create').succeeded(path);
96
- }
97
- }
98
- async run() {
99
- this.generateSuiteGlobPattern();
100
- await this.addSuiteToRcFile();
101
- if (this.withExampleTest) {
102
- this.createSampleTestFile();
103
- }
104
- }
105
- }
106
- CreateSuite.commandName = 'make:suite';
107
- CreateSuite.description = 'Create a new test suite';
108
- __decorate([
109
- standalone_1.args.string({ description: 'Name of the test suite' }),
110
- __metadata("design:type", String)
111
- ], CreateSuite.prototype, "suite", void 0);
112
- __decorate([
113
- standalone_1.args.string({ description: 'Path to the test suite directory', required: false }),
114
- __metadata("design:type", String)
115
- ], CreateSuite.prototype, "location", void 0);
116
- __decorate([
117
- standalone_1.flags.boolean({ description: 'Add a sample test file' }),
118
- __metadata("design:type", Boolean)
119
- ], CreateSuite.prototype, "withExampleTest", void 0);
120
- exports.default = CreateSuite;
@@ -1,35 +0,0 @@
1
- import { BaseGenerator } from './Base';
2
- /**
3
- * Command to make a new test
4
- */
5
- export default class MakeTest extends BaseGenerator {
6
- /**
7
- * Required by BaseGenerator
8
- */
9
- protected extname: string;
10
- protected form: "singular";
11
- protected pattern: "snakecase";
12
- protected resourceName: string;
13
- protected createExact: boolean;
14
- /**
15
- * Command meta data
16
- */
17
- static commandName: string;
18
- static description: string;
19
- suite: string;
20
- name: string;
21
- exact: boolean;
22
- /**
23
- * Returns the template stub path
24
- */
25
- protected getStub(): string;
26
- /**
27
- * The file is created inside the parent directory of the first
28
- * glob pattern
29
- */
30
- protected getDestinationPath(): string;
31
- protected templateData(): {
32
- name: string;
33
- };
34
- run(): Promise<void>;
35
- }
@@ -1,96 +0,0 @@
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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
11
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
12
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
13
- 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;
14
- return c > 3 && r && Object.defineProperty(target, key, r), r;
15
- };
16
- var __metadata = (this && this.__metadata) || function (k, v) {
17
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
18
- };
19
- var __importDefault = (this && this.__importDefault) || function (mod) {
20
- return (mod && mod.__esModule) ? mod : { "default": mod };
21
- };
22
- Object.defineProperty(exports, "__esModule", { value: true });
23
- const path_1 = require("path");
24
- const glob_parent_1 = __importDefault(require("glob-parent"));
25
- const helpers_1 = require("@poppinss/utils/build/helpers");
26
- const standalone_1 = require("@adonisjs/core/build/standalone");
27
- const Base_1 = require("./Base");
28
- /**
29
- * Command to make a new test
30
- */
31
- class MakeTest extends Base_1.BaseGenerator {
32
- constructor() {
33
- super(...arguments);
34
- /**
35
- * Required by BaseGenerator
36
- */
37
- this.extname = '.spec.ts';
38
- this.form = 'singular';
39
- this.pattern = 'snakecase';
40
- }
41
- /**
42
- * Returns the template stub path
43
- */
44
- getStub() {
45
- return (0, path_1.join)(__dirname, '..', '..', 'templates', 'test.txt');
46
- }
47
- /**
48
- * The file is created inside the parent directory of the first
49
- * glob pattern
50
- */
51
- getDestinationPath() {
52
- const testSuites = this.application.rcFile.tests.suites;
53
- const mentionedSuite = testSuites.find(({ name }) => this.suite === name);
54
- const suiteGlob = Array.isArray(mentionedSuite.files)
55
- ? mentionedSuite.files[0]
56
- : mentionedSuite.files;
57
- return (0, glob_parent_1.default)(suiteGlob);
58
- }
59
- templateData() {
60
- return {
61
- name: helpers_1.string.sentenceCase(this.name),
62
- };
63
- }
64
- async run() {
65
- const testSuites = this.application.rcFile.tests.suites;
66
- const mentionedSuite = testSuites.find(({ name }) => this.suite === name);
67
- if (!mentionedSuite) {
68
- this.logger.error(`Invalid suite "${this.suite}". Make sure the suite is registered inside the .adonisrc.json file`);
69
- return;
70
- }
71
- this.resourceName = this.name;
72
- this.createExact = this.exact;
73
- await super.generate();
74
- }
75
- }
76
- /**
77
- * Command meta data
78
- */
79
- MakeTest.commandName = 'make:test';
80
- MakeTest.description = 'Make a new test';
81
- __decorate([
82
- standalone_1.args.string({ description: 'Name of the test suite' }),
83
- __metadata("design:type", String)
84
- ], MakeTest.prototype, "suite", void 0);
85
- __decorate([
86
- standalone_1.args.string({ description: 'Name of the test file' }),
87
- __metadata("design:type", String)
88
- ], MakeTest.prototype, "name", void 0);
89
- __decorate([
90
- standalone_1.flags.boolean({
91
- description: 'Create the test file with the exact name as provided',
92
- alias: 'e',
93
- }),
94
- __metadata("design:type", Boolean)
95
- ], MakeTest.prototype, "exact", void 0);
96
- exports.default = MakeTest;
@@ -1,31 +0,0 @@
1
- import { BaseGenerator } from './Base';
2
- /**
3
- * Command to make a new validator
4
- */
5
- export default class MakeValidator extends BaseGenerator {
6
- /**
7
- * Required by BaseGenerator
8
- */
9
- protected suffix: string;
10
- protected form: "singular";
11
- protected pattern: "pascalcase";
12
- protected resourceName: string;
13
- protected createExact: boolean;
14
- /**
15
- * Command meta data
16
- */
17
- static commandName: string;
18
- static description: string;
19
- name: string;
20
- exact: boolean;
21
- /**
22
- * Returns the template stub path
23
- */
24
- protected getStub(): string;
25
- /**
26
- * Pull path for the `validators` directory declaration from
27
- * the `.adonisrc.json` file or fallback to `app/Validators`
28
- */
29
- protected getDestinationPath(): string;
30
- run(): Promise<void>;
31
- }
@@ -1,71 +0,0 @@
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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
11
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
12
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
13
- 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;
14
- return c > 3 && r && Object.defineProperty(target, key, r), r;
15
- };
16
- var __metadata = (this && this.__metadata) || function (k, v) {
17
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- const path_1 = require("path");
21
- const standalone_1 = require("@adonisjs/core/build/standalone");
22
- const Base_1 = require("./Base");
23
- /**
24
- * Command to make a new validator
25
- */
26
- class MakeValidator extends Base_1.BaseGenerator {
27
- constructor() {
28
- super(...arguments);
29
- /**
30
- * Required by BaseGenerator
31
- */
32
- this.suffix = 'Validator';
33
- this.form = 'singular';
34
- this.pattern = 'pascalcase';
35
- }
36
- /**
37
- * Returns the template stub path
38
- */
39
- getStub() {
40
- return (0, path_1.join)(__dirname, '..', '..', 'templates', 'validator.txt');
41
- }
42
- /**
43
- * Pull path for the `validators` directory declaration from
44
- * the `.adonisrc.json` file or fallback to `app/Validators`
45
- */
46
- getDestinationPath() {
47
- return this.getPathForNamespace('validators') || 'app/Validators';
48
- }
49
- async run() {
50
- this.resourceName = this.name;
51
- this.createExact = this.exact;
52
- await super.generate();
53
- }
54
- }
55
- /**
56
- * Command meta data
57
- */
58
- MakeValidator.commandName = 'make:validator';
59
- MakeValidator.description = 'Make a new validator';
60
- __decorate([
61
- standalone_1.args.string({ description: 'Name of the validator class' }),
62
- __metadata("design:type", String)
63
- ], MakeValidator.prototype, "name", void 0);
64
- __decorate([
65
- standalone_1.flags.boolean({
66
- description: 'Create the validator with the exact name as provided',
67
- alias: 'e',
68
- }),
69
- __metadata("design:type", Boolean)
70
- ], MakeValidator.prototype, "exact", void 0);
71
- exports.default = MakeValidator;
@@ -1,30 +0,0 @@
1
- import { BaseGenerator } from './Base';
2
- /**
3
- * Command to make a new view
4
- */
5
- export default class MakeView extends BaseGenerator {
6
- /**
7
- * Required by BaseGenerator
8
- */
9
- protected suffix: string;
10
- protected extname: string;
11
- protected pattern: "snakecase";
12
- protected resourceName: string;
13
- protected createExact: boolean;
14
- /**
15
- * Command meta data
16
- */
17
- static commandName: string;
18
- static description: string;
19
- name: string;
20
- exact: boolean;
21
- /**
22
- * Returns the template stub path
23
- */
24
- protected getStub(): string;
25
- /**
26
- * Path to the providers directory
27
- */
28
- protected getDestinationPath(): string;
29
- run(): Promise<void>;
30
- }
@@ -1,70 +0,0 @@
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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
11
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
12
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
13
- 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;
14
- return c > 3 && r && Object.defineProperty(target, key, r), r;
15
- };
16
- var __metadata = (this && this.__metadata) || function (k, v) {
17
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- const path_1 = require("path");
21
- const standalone_1 = require("@adonisjs/core/build/standalone");
22
- const Base_1 = require("./Base");
23
- /**
24
- * Command to make a new view
25
- */
26
- class MakeView extends Base_1.BaseGenerator {
27
- constructor() {
28
- super(...arguments);
29
- /**
30
- * Required by BaseGenerator
31
- */
32
- this.suffix = '';
33
- this.extname = '.edge';
34
- this.pattern = 'snakecase';
35
- }
36
- /**
37
- * Returns the template stub path
38
- */
39
- getStub() {
40
- return (0, path_1.join)(__dirname, '..', '..', 'templates', 'view.txt');
41
- }
42
- /**
43
- * Path to the providers directory
44
- */
45
- getDestinationPath() {
46
- return this.application.rcFile.directories.views || 'resources/views';
47
- }
48
- async run() {
49
- this.resourceName = this.name;
50
- this.createExact = this.exact;
51
- await super.generate();
52
- }
53
- }
54
- /**
55
- * Command meta data
56
- */
57
- MakeView.commandName = 'make:view';
58
- MakeView.description = 'Make a new view template';
59
- __decorate([
60
- standalone_1.args.string({ description: 'Name of the view' }),
61
- __metadata("design:type", String)
62
- ], MakeView.prototype, "name", void 0);
63
- __decorate([
64
- standalone_1.flags.boolean({
65
- description: 'Create the template file with the exact name as provided',
66
- alias: 'e',
67
- }),
68
- __metadata("design:type", Boolean)
69
- ], MakeView.prototype, "exact", void 0);
70
- exports.default = MakeView;
@@ -1,33 +0,0 @@
1
- import { BaseCommand } from '@adonisjs/core/build/standalone';
2
- /**
3
- * Compile typescript project to Javascript and start
4
- * the HTTP server
5
- */
6
- export default class Serve extends BaseCommand {
7
- static commandName: string;
8
- static description: string;
9
- static settings: {
10
- stayAlive: boolean;
11
- };
12
- /**
13
- * Bundle frontend assets. Defaults to true
14
- */
15
- assets: boolean;
16
- /**
17
- * Allows watching for file changes
18
- */
19
- watch: boolean;
20
- /**
21
- * Detect changes by polling files
22
- */
23
- poll: boolean;
24
- /**
25
- * Arguments to pass to the `node` binary
26
- */
27
- nodeArgs: string[];
28
- /**
29
- * Arguments to pass to the `encore` binary
30
- */
31
- encoreArgs: string[];
32
- run(): Promise<void>;
33
- }
@@ -1,112 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
43
- const standalone_1 = require("@adonisjs/core/build/standalone");
44
- /**
45
- * Compile typescript project to Javascript and start
46
- * the HTTP server
47
- */
48
- class Serve extends standalone_1.BaseCommand {
49
- constructor() {
50
- super(...arguments);
51
- /**
52
- * Bundle frontend assets. Defaults to true
53
- */
54
- this.assets = true;
55
- /**
56
- * Arguments to pass to the `node` binary
57
- */
58
- this.nodeArgs = [];
59
- /**
60
- * Arguments to pass to the `encore` binary
61
- */
62
- this.encoreArgs = [];
63
- }
64
- async run() {
65
- const { DevServer } = await Promise.resolve().then(() => __importStar(require('../src/DevServer')));
66
- try {
67
- if (this.watch) {
68
- await new DevServer(this.application.appRoot, this.nodeArgs, this.encoreArgs, this.assets, this.logger).watch(this.poll);
69
- }
70
- else {
71
- await new DevServer(this.application.appRoot, this.nodeArgs, this.encoreArgs, this.assets, this.logger).start();
72
- }
73
- }
74
- catch (error) {
75
- this.logger.fatal(error);
76
- }
77
- }
78
- }
79
- Serve.commandName = 'serve';
80
- Serve.description = 'Start the AdonisJS HTTP server, along with the file watcher. Also starts the webpack dev server when webpack encore is installed';
81
- Serve.settings = {
82
- stayAlive: true,
83
- };
84
- __decorate([
85
- standalone_1.flags.boolean({
86
- description: 'Start webpack dev server when encore is installed. Use "--no-assets" to disable',
87
- }),
88
- __metadata("design:type", Boolean)
89
- ], Serve.prototype, "assets", void 0);
90
- __decorate([
91
- standalone_1.flags.boolean({
92
- description: 'Watch for file changes and re-start the HTTP server on change',
93
- alias: 'w',
94
- }),
95
- __metadata("design:type", Boolean)
96
- ], Serve.prototype, "watch", void 0);
97
- __decorate([
98
- standalone_1.flags.boolean({
99
- description: 'Detect file changes by polling files instead of listening to filesystem events',
100
- alias: 'p',
101
- }),
102
- __metadata("design:type", Boolean)
103
- ], Serve.prototype, "poll", void 0);
104
- __decorate([
105
- standalone_1.flags.array({ description: 'CLI options to pass to the node command line' }),
106
- __metadata("design:type", Array)
107
- ], Serve.prototype, "nodeArgs", void 0);
108
- __decorate([
109
- standalone_1.flags.array({ description: 'CLI options to pass to the encore command line' }),
110
- __metadata("design:type", Array)
111
- ], Serve.prototype, "encoreArgs", void 0);
112
- exports.default = Serve;
@@ -1,57 +0,0 @@
1
- import { BaseCommand } from '@adonisjs/core/build/standalone';
2
- /**
3
- * Run tests
4
- */
5
- export default class Test extends BaseCommand {
6
- static commandName: string;
7
- static description: string;
8
- static settings: {
9
- stayAlive: boolean;
10
- };
11
- suites: string[];
12
- /**
13
- * Allows watching for file changes
14
- */
15
- files: string[];
16
- /**
17
- * Allows watching for file changes
18
- */
19
- watch: boolean;
20
- /**
21
- * Detect changes by polling files
22
- */
23
- poll: boolean;
24
- /**
25
- * Arguments to pass to the `node` binary
26
- */
27
- nodeArgs: string[];
28
- /**
29
- * Filter by tags
30
- */
31
- tags: string[];
32
- /**
33
- * Filter by tags
34
- */
35
- ignoreTags: string[];
36
- /**
37
- * Filter by test title
38
- */
39
- tests: string[];
40
- /**
41
- * Filter by group title
42
- */
43
- groups: string[];
44
- /**
45
- * Customize tests timeout
46
- */
47
- timeout: number;
48
- /**
49
- * Force exit the tests runner
50
- */
51
- forceExit: boolean;
52
- /**
53
- * Convert command flags to test filters
54
- */
55
- private getTestFilters;
56
- run(): Promise<void>;
57
- }