@adonisjs/assembler 5.9.2 → 5.9.4

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/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 +234 -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/build/templates/tests/bootstrap.txt +4 -4
  66. package/package.json +11 -11
@@ -1,221 +1,234 @@
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 sink_1 = require("@adonisjs/sink");
22
- const standalone_1 = require("@adonisjs/core/build/standalone");
23
- const Manifest_1 = require("../src/Manifest");
24
- /**
25
- * Configure a package
26
- */
27
- class Configure extends standalone_1.BaseCommand {
28
- constructor() {
29
- super(...arguments);
30
- this.appType = process.env['ADONIS_CREATE_APP_BOILERPLATE'] || 'web';
31
- }
32
- /**
33
- * Returns package manager for installing dependencies
34
- */
35
- getPackageManager() {
36
- if (process.env['ADONIS_CREATE_APP_CLIENT']) {
37
- return process.env['ADONIS_CREATE_APP_CLIENT'];
38
- }
39
- return sink_1.utils.getPackageManager(this.application.appRoot);
40
- }
41
- /**
42
- * Configure encore
43
- */
44
- async configureEncore() {
45
- /**
46
- * Create the webpack config file
47
- */
48
- const webpackConfigFile = new sink_1.files.MustacheFile(this.application.appRoot, 'webpack.config.js', (0, path_1.join)(__dirname, '..', 'templates/webpack.config.txt'));
49
- if (!webpackConfigFile.exists()) {
50
- webpackConfigFile.apply({}).commit();
51
- sink_1.logger.action('create').succeeded('webpack.config.js');
52
- }
53
- /**
54
- * Create app.js entrypoint
55
- */
56
- const entryPointFile = new sink_1.files.NewLineFile(this.application.appRoot, 'resources/js/app.js');
57
- if (!entryPointFile.exists()) {
58
- entryPointFile.add('// app entrypoint').commit();
59
- sink_1.logger.action('create').succeeded('resources/js/app.js');
60
- }
61
- /**
62
- * Install Encore
63
- */
64
- const pkgFile = new sink_1.files.PackageJsonFile(this.application.appRoot);
65
- pkgFile.install('@symfony/webpack-encore');
66
- pkgFile.install('webpack');
67
- pkgFile.install('webpack-cli');
68
- pkgFile.install('@babel/core');
69
- pkgFile.install('@babel/preset-env');
70
- pkgFile.useClient(this.getPackageManager());
71
- const spinner = sink_1.logger.await(sink_1.logger.colors.gray('configure @symfony/webpack-encore'));
72
- try {
73
- await pkgFile.commitAsync();
74
- spinner.update('Configured');
75
- spinner.stop();
76
- }
77
- catch (error) {
78
- spinner.update('Unable to install the package');
79
- spinner.stop();
80
- sink_1.logger.fatal(error);
81
- }
82
- }
83
- /**
84
- * Configure tests
85
- */
86
- async configureTests() {
87
- /**
88
- * Create "test.ts" file
89
- */
90
- const testsEntryPointFile = new sink_1.files.MustacheFile(this.application.appRoot, 'test.ts', (0, path_1.join)(__dirname, '..', 'templates/test-entrypoint.txt'));
91
- if (!testsEntryPointFile.exists()) {
92
- testsEntryPointFile.apply({}).commit();
93
- sink_1.logger.action('create').succeeded('test.ts');
94
- }
95
- /**
96
- * Create "tests/bootstrap.ts" file
97
- */
98
- const testsBootstrapFile = new sink_1.files.MustacheFile(this.application.appRoot, 'tests/bootstrap.ts', (0, path_1.join)(__dirname, '..', 'templates/tests/bootstrap.txt'));
99
- if (!testsBootstrapFile.exists()) {
100
- testsBootstrapFile.apply({}).commit();
101
- sink_1.logger.action('create').succeeded('tests/bootstrap.ts');
102
- }
103
- /**
104
- * Create "tests/functional/hello_world.spec.ts" file
105
- */
106
- const helloWorldTestFile = new sink_1.files.MustacheFile(this.application.appRoot, 'tests/functional/hello_world.spec.ts', (0, path_1.join)(__dirname, '..', `templates/tests/functional/hello_world_${this.appType}.spec.txt`));
107
- if (!helloWorldTestFile.exists()) {
108
- helloWorldTestFile.apply({}).commit();
109
- sink_1.logger.action('create').succeeded('tests/functional/hello_world.spec.ts');
110
- }
111
- /**
112
- * Create "contracts/tests.ts" file
113
- */
114
- const testsContractsFile = new sink_1.files.MustacheFile(this.application.appRoot, 'contracts/tests.ts', (0, path_1.join)(__dirname, '..', 'templates/tests-contract.txt'));
115
- if (!testsContractsFile.exists()) {
116
- testsContractsFile.apply({}).commit();
117
- sink_1.logger.action('create').succeeded('contracts/tests.ts');
118
- }
119
- /**
120
- * Update AdonisRc file with test suites
121
- */
122
- const rcFile = new sink_1.files.AdonisRcFile(this.application.appRoot);
123
- rcFile.set('tests', {
124
- suites: [
125
- {
126
- name: 'functional',
127
- files: ['tests/functional/**/*.spec(.ts|.js)'],
128
- timeout: 60 * 1000,
129
- },
130
- ],
131
- });
132
- rcFile.addTestProvider('@japa/preset-adonis/TestsProvider');
133
- rcFile.commit();
134
- sink_1.logger.action('update').succeeded('.adonisrc.json');
135
- /**
136
- * Create ".env.test" file
137
- */
138
- const testEnvFile = new sink_1.files.NewLineFile(this.application.appRoot, '.env.test');
139
- if (!testEnvFile.exists()) {
140
- testEnvFile.add('NODE_ENV=test');
141
- /**
142
- * Set additional .env variables for "web" boilerplate
143
- */
144
- if (this.appType === 'web') {
145
- testEnvFile.add(['ASSETS_DRIVER=fake', 'SESSION_DRIVER=memory']);
146
- }
147
- testEnvFile.commit();
148
- sink_1.logger.action('create').succeeded('.env.test');
149
- }
150
- /**
151
- * Update "tsconfig.json"
152
- */
153
- const tsConfig = new sink_1.files.JsonFile(this.application.appRoot, 'tsconfig.json');
154
- const existingTypes = tsConfig.get('compilerOptions.types') || [];
155
- if (!existingTypes.includes('@japa/preset-adonis/build/adonis-typings')) {
156
- existingTypes.push('@japa/preset-adonis/build/adonis-typings');
157
- }
158
- tsConfig.set('compilerOptions.types', existingTypes);
159
- tsConfig.commit();
160
- sink_1.logger.action('update').succeeded('tsconfig.json');
161
- /**
162
- * Set additional .env variables for "web" boilerplate
163
- */
164
- if (this.appType === 'web') {
165
- testEnvFile.add(['ASSETS_DRIVER=fake', 'SESSION_DRIVER=memory']);
166
- }
167
- testEnvFile.commit();
168
- sink_1.logger.action('create').succeeded('.env.test');
169
- /**
170
- * Install required dependencies
171
- */
172
- const pkgFile = new sink_1.files.PackageJsonFile(this.application.appRoot);
173
- pkgFile.install('@japa/runner');
174
- pkgFile.install('@japa/preset-adonis');
175
- pkgFile.useClient(this.getPackageManager());
176
- const spinner = sink_1.logger.await(sink_1.logger.colors.gray('installing @japa/runner, @japa/preset-adonis'));
177
- try {
178
- await pkgFile.commitAsync();
179
- spinner.update('Installed');
180
- spinner.stop();
181
- }
182
- catch (error) {
183
- spinner.update('Unable to install packages');
184
- spinner.stop();
185
- sink_1.logger.fatal(error);
186
- }
187
- }
188
- /**
189
- * Configure a give package
190
- */
191
- async configurePackage(name) {
192
- if (name === 'encore') {
193
- await this.configureEncore();
194
- return;
195
- }
196
- if (name === 'tests') {
197
- await this.configureTests();
198
- return;
199
- }
200
- await new sink_1.tasks.Instructions(name, this.application.appRoot, this.application, true).execute();
201
- await new Manifest_1.Manifest(this.application.appRoot, this.logger).generate();
202
- }
203
- /**
204
- * Invoked automatically by ace
205
- */
206
- async run() {
207
- for (let name of this.packages) {
208
- await this.configurePackage(name);
209
- }
210
- }
211
- }
212
- Configure.commandName = 'configure';
213
- Configure.description = 'Configure one or more AdonisJS packages';
214
- Configure.aliases = ['invoke'];
215
- __decorate([
216
- standalone_1.args.spread({
217
- description: 'Name of the package(s) you want to configure',
218
- }),
219
- __metadata("design:type", Array)
220
- ], Configure.prototype, "packages", void 0);
221
- exports.default = Configure;
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 sink_1 = require("@adonisjs/sink");
22
+ const standalone_1 = require("@adonisjs/core/build/standalone");
23
+ const Manifest_1 = require("../src/Manifest");
24
+ /**
25
+ * Configure a package
26
+ */
27
+ class Configure extends standalone_1.BaseCommand {
28
+ constructor() {
29
+ super(...arguments);
30
+ this.appType = process.env['ADONIS_CREATE_APP_BOILERPLATE'] || 'web';
31
+ }
32
+ /**
33
+ * Returns package manager for installing dependencies
34
+ */
35
+ getPackageManager() {
36
+ if (process.env['ADONIS_CREATE_APP_CLIENT']) {
37
+ return process.env['ADONIS_CREATE_APP_CLIENT'];
38
+ }
39
+ return sink_1.utils.getPackageManager(this.application.appRoot);
40
+ }
41
+ /**
42
+ * Configure encore
43
+ */
44
+ async configureEncore() {
45
+ /**
46
+ * Create the webpack config file
47
+ */
48
+ const webpackConfigFile = new sink_1.files.MustacheFile(this.application.appRoot, 'webpack.config.js', (0, path_1.join)(__dirname, '..', 'templates/webpack.config.txt'));
49
+ if (!webpackConfigFile.exists()) {
50
+ webpackConfigFile.apply({}).commit();
51
+ sink_1.logger.action('create').succeeded('webpack.config.js');
52
+ }
53
+ /**
54
+ * Create app.js entrypoint
55
+ */
56
+ const entryPointFile = new sink_1.files.NewLineFile(this.application.appRoot, 'resources/js/app.js');
57
+ if (!entryPointFile.exists()) {
58
+ entryPointFile.add('// app entrypoint').commit();
59
+ sink_1.logger.action('create').succeeded('resources/js/app.js');
60
+ }
61
+ /**
62
+ * Install Encore
63
+ */
64
+ const pkgFile = new sink_1.files.PackageJsonFile(this.application.appRoot);
65
+ pkgFile.install('@symfony/webpack-encore@4.1.1');
66
+ pkgFile.install('webpack@5.72');
67
+ pkgFile.install('webpack-cli@4.9.1');
68
+ pkgFile.install('@babel/core@7.17.0');
69
+ pkgFile.install('@babel/preset-env@7.16.0');
70
+ pkgFile.useClient(this.getPackageManager());
71
+ const spinner = sink_1.logger.await(sink_1.logger.colors.gray('configure @symfony/webpack-encore'));
72
+ try {
73
+ const response = await pkgFile.commitAsync();
74
+ if (response && response.status === 1) {
75
+ spinner.stop();
76
+ sink_1.logger.fatal({ message: 'Unable to configure encore', stack: response.stderr.toString() });
77
+ }
78
+ else {
79
+ spinner.stop();
80
+ sink_1.logger.success('Configured encore successfully');
81
+ }
82
+ }
83
+ catch (error) {
84
+ spinner.stop();
85
+ sink_1.logger.fatal(error);
86
+ }
87
+ }
88
+ /**
89
+ * Configure tests
90
+ */
91
+ async configureTests() {
92
+ /**
93
+ * Create "test.ts" file
94
+ */
95
+ const testsEntryPointFile = new sink_1.files.MustacheFile(this.application.appRoot, 'test.ts', (0, path_1.join)(__dirname, '..', 'templates/test-entrypoint.txt'));
96
+ if (!testsEntryPointFile.exists()) {
97
+ testsEntryPointFile.apply({}).commit();
98
+ sink_1.logger.action('create').succeeded('test.ts');
99
+ }
100
+ /**
101
+ * Create "tests/bootstrap.ts" file
102
+ */
103
+ const testsBootstrapFile = new sink_1.files.MustacheFile(this.application.appRoot, 'tests/bootstrap.ts', (0, path_1.join)(__dirname, '..', 'templates/tests/bootstrap.txt'));
104
+ if (!testsBootstrapFile.exists()) {
105
+ testsBootstrapFile.apply({}).commit();
106
+ sink_1.logger.action('create').succeeded('tests/bootstrap.ts');
107
+ }
108
+ /**
109
+ * Create "tests/functional/hello_world.spec.ts" file
110
+ */
111
+ const helloWorldTestFile = new sink_1.files.MustacheFile(this.application.appRoot, 'tests/functional/hello_world.spec.ts', (0, path_1.join)(__dirname, '..', `templates/tests/functional/hello_world_${this.appType}.spec.txt`));
112
+ if (!helloWorldTestFile.exists()) {
113
+ helloWorldTestFile.apply({}).commit();
114
+ sink_1.logger.action('create').succeeded('tests/functional/hello_world.spec.ts');
115
+ }
116
+ /**
117
+ * Create "contracts/tests.ts" file
118
+ */
119
+ const testsContractsFile = new sink_1.files.MustacheFile(this.application.appRoot, 'contracts/tests.ts', (0, path_1.join)(__dirname, '..', 'templates/tests-contract.txt'));
120
+ if (!testsContractsFile.exists()) {
121
+ testsContractsFile.apply({}).commit();
122
+ sink_1.logger.action('create').succeeded('contracts/tests.ts');
123
+ }
124
+ /**
125
+ * Update AdonisRc file with test suites
126
+ */
127
+ const rcFile = new sink_1.files.AdonisRcFile(this.application.appRoot);
128
+ rcFile.set('tests', {
129
+ suites: [
130
+ {
131
+ name: 'functional',
132
+ files: ['tests/functional/**/*.spec(.ts|.js)'],
133
+ timeout: 60 * 1000,
134
+ },
135
+ ],
136
+ });
137
+ rcFile.addTestProvider('@japa/preset-adonis/TestsProvider');
138
+ rcFile.commit();
139
+ sink_1.logger.action('update').succeeded('.adonisrc.json');
140
+ /**
141
+ * Create ".env.test" file
142
+ */
143
+ const testEnvFile = new sink_1.files.NewLineFile(this.application.appRoot, '.env.test');
144
+ if (!testEnvFile.exists()) {
145
+ testEnvFile.add('NODE_ENV=test');
146
+ /**
147
+ * Set additional .env variables for "web" boilerplate
148
+ */
149
+ if (this.appType === 'web') {
150
+ testEnvFile.add(['ASSETS_DRIVER=fake', 'SESSION_DRIVER=memory']);
151
+ }
152
+ testEnvFile.commit();
153
+ sink_1.logger.action('create').succeeded('.env.test');
154
+ }
155
+ /**
156
+ * Update "tsconfig.json"
157
+ */
158
+ const tsConfig = new sink_1.files.JsonFile(this.application.appRoot, 'tsconfig.json');
159
+ const existingTypes = tsConfig.get('compilerOptions.types') || [];
160
+ if (!existingTypes.includes('@japa/preset-adonis/build/adonis-typings')) {
161
+ existingTypes.push('@japa/preset-adonis/build/adonis-typings');
162
+ }
163
+ tsConfig.set('compilerOptions.types', existingTypes);
164
+ tsConfig.commit();
165
+ sink_1.logger.action('update').succeeded('tsconfig.json');
166
+ /**
167
+ * Set additional .env variables for "web" boilerplate
168
+ */
169
+ if (this.appType === 'web') {
170
+ testEnvFile.add(['ASSETS_DRIVER=fake', 'SESSION_DRIVER=memory']);
171
+ }
172
+ testEnvFile.commit();
173
+ sink_1.logger.action('create').succeeded('.env.test');
174
+ /**
175
+ * Install required dependencies
176
+ */
177
+ const pkgFile = new sink_1.files.PackageJsonFile(this.application.appRoot);
178
+ pkgFile.install('@japa/runner');
179
+ pkgFile.install('@japa/preset-adonis');
180
+ pkgFile.useClient(this.getPackageManager());
181
+ const spinner = sink_1.logger.await(sink_1.logger.colors.gray('installing @japa/runner, @japa/preset-adonis'));
182
+ try {
183
+ const response = await pkgFile.commitAsync();
184
+ if (response && response.status === 1) {
185
+ spinner.stop();
186
+ sink_1.logger.fatal({
187
+ message: 'Unable to configure tests runner',
188
+ stack: response.stderr.toString(),
189
+ });
190
+ }
191
+ else {
192
+ spinner.stop();
193
+ sink_1.logger.success('Configured tests runner successfully');
194
+ }
195
+ }
196
+ catch (error) {
197
+ spinner.stop();
198
+ sink_1.logger.fatal(error);
199
+ }
200
+ }
201
+ /**
202
+ * Configure a give package
203
+ */
204
+ async configurePackage(name) {
205
+ if (name === 'encore') {
206
+ await this.configureEncore();
207
+ return;
208
+ }
209
+ if (name === 'tests') {
210
+ await this.configureTests();
211
+ return;
212
+ }
213
+ await new sink_1.tasks.Instructions(name, this.application.appRoot, this.application, true).execute();
214
+ await new Manifest_1.Manifest(this.application.appRoot, this.logger).generate();
215
+ }
216
+ /**
217
+ * Invoked automatically by ace
218
+ */
219
+ async run() {
220
+ for (let name of this.packages) {
221
+ await this.configurePackage(name);
222
+ }
223
+ }
224
+ }
225
+ Configure.commandName = 'configure';
226
+ Configure.description = 'Configure one or more AdonisJS packages';
227
+ Configure.aliases = ['invoke'];
228
+ __decorate([
229
+ standalone_1.args.spread({
230
+ description: 'Name of the package(s) you want to configure',
231
+ }),
232
+ __metadata("design:type", Array)
233
+ ], Configure.prototype, "packages", void 0);
234
+ exports.default = Configure;
@@ -1,30 +1,30 @@
1
- import { BaseCommand } from '@adonisjs/core/build/standalone';
2
- /**
3
- * Base class to generate framework entities
4
- */
5
- export declare abstract class BaseGenerator extends BaseCommand {
6
- protected abstract resourceName: string;
7
- protected abstract createExact: boolean;
8
- protected abstract getStub(): string;
9
- protected abstract getDestinationPath(): string;
10
- protected suffix?: string;
11
- protected extname: string;
12
- protected form?: 'singular' | 'plural';
13
- protected pattern?: 'camelcase' | 'snakecase' | 'pascalcase';
14
- protected formIgnoreList?: string[];
15
- protected templateData(): any;
16
- /**
17
- * Returns path for a given namespace by replacing the base namespace
18
- * with the defined directories map inside the `.adonisrc.json`
19
- * file
20
- */
21
- protected getPathForNamespace(namespaceFor: string): string | null;
22
- /**
23
- * Returns contents of the rcFile
24
- */
25
- protected hasRcFile(cwd: string): Promise<boolean>;
26
- /**
27
- * Handle command
28
- */
29
- generate(): Promise<import("@adonisjs/ace/build/src/Contracts").GeneratorFileContract | undefined>;
30
- }
1
+ import { BaseCommand } from '@adonisjs/core/build/standalone';
2
+ /**
3
+ * Base class to generate framework entities
4
+ */
5
+ export declare abstract class BaseGenerator extends BaseCommand {
6
+ protected abstract resourceName: string;
7
+ protected abstract createExact: boolean;
8
+ protected abstract getStub(): string;
9
+ protected abstract getDestinationPath(): string;
10
+ protected suffix?: string;
11
+ protected extname: string;
12
+ protected form?: 'singular' | 'plural';
13
+ protected pattern?: 'camelcase' | 'snakecase' | 'pascalcase';
14
+ protected formIgnoreList?: string[];
15
+ protected templateData(): any;
16
+ /**
17
+ * Returns path for a given namespace by replacing the base namespace
18
+ * with the defined directories map inside the `.adonisrc.json`
19
+ * file
20
+ */
21
+ protected getPathForNamespace(namespaceFor: string): string | null;
22
+ /**
23
+ * Returns contents of the rcFile
24
+ */
25
+ protected hasRcFile(cwd: string): Promise<boolean>;
26
+ /**
27
+ * Handle command
28
+ */
29
+ generate(): Promise<import("@adonisjs/ace/build/src/Contracts").GeneratorFileContract | undefined>;
30
+ }