@adonisjs/assembler 5.8.1 → 5.9.1

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 +17 -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 -217
  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 -53
  33. package/build/commands/Test.js +159 -152
  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 +23 -23
  49. package/build/src/EnvParser/index.js +52 -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 +16 -16
@@ -1,217 +1,221 @@
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.useClient(this.getPackageManager());
67
- const spinner = sink_1.logger.await(sink_1.logger.colors.gray('installing @symfony/webpack-encore'));
68
- try {
69
- await pkgFile.commitAsync();
70
- spinner.update('Installed');
71
- spinner.stop();
72
- }
73
- catch (error) {
74
- spinner.update('Unable to install the package');
75
- spinner.stop();
76
- sink_1.logger.fatal(error);
77
- }
78
- }
79
- /**
80
- * Configure tests
81
- */
82
- async configureTests() {
83
- /**
84
- * Create "test.ts" file
85
- */
86
- const testsEntryPointFile = new sink_1.files.MustacheFile(this.application.appRoot, 'test.ts', (0, path_1.join)(__dirname, '..', 'templates/test-entrypoint.txt'));
87
- if (!testsEntryPointFile.exists()) {
88
- testsEntryPointFile.apply({}).commit();
89
- sink_1.logger.action('create').succeeded('test.ts');
90
- }
91
- /**
92
- * Create "tests/bootstrap.ts" file
93
- */
94
- const testsBootstrapFile = new sink_1.files.MustacheFile(this.application.appRoot, 'tests/bootstrap.ts', (0, path_1.join)(__dirname, '..', 'templates/tests/bootstrap.txt'));
95
- if (!testsBootstrapFile.exists()) {
96
- testsBootstrapFile.apply({}).commit();
97
- sink_1.logger.action('create').succeeded('tests/bootstrap.ts');
98
- }
99
- /**
100
- * Create "tests/functional/hello_world.spec.ts" file
101
- */
102
- 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`));
103
- if (!helloWorldTestFile.exists()) {
104
- helloWorldTestFile.apply({}).commit();
105
- sink_1.logger.action('create').succeeded('tests/functional/hello_world.spec.ts');
106
- }
107
- /**
108
- * Create "contracts/tests.ts" file
109
- */
110
- const testsContractsFile = new sink_1.files.MustacheFile(this.application.appRoot, 'contracts/tests.ts', (0, path_1.join)(__dirname, '..', 'templates/tests-contract.txt'));
111
- if (!testsContractsFile.exists()) {
112
- testsContractsFile.apply({}).commit();
113
- sink_1.logger.action('create').succeeded('contracts/tests.ts');
114
- }
115
- /**
116
- * Update AdonisRc file with test suites
117
- */
118
- const rcFile = new sink_1.files.AdonisRcFile(this.application.appRoot);
119
- rcFile.set('tests', {
120
- suites: [
121
- {
122
- name: 'functional',
123
- files: ['tests/functional/**/*.spec(.ts|.js)'],
124
- timeout: 60 * 1000,
125
- },
126
- ],
127
- });
128
- rcFile.addTestProvider('@japa/preset-adonis/TestsProvider');
129
- rcFile.commit();
130
- sink_1.logger.action('update').succeeded('.adonisrc.json');
131
- /**
132
- * Create ".env.test" file
133
- */
134
- const testEnvFile = new sink_1.files.NewLineFile(this.application.appRoot, '.env.test');
135
- if (!testEnvFile.exists()) {
136
- testEnvFile.add('NODE_ENV=test');
137
- /**
138
- * Set additional .env variables for "web" boilerplate
139
- */
140
- if (this.appType === 'web') {
141
- testEnvFile.add(['ASSETS_DRIVER=fake', 'SESSION_DRIVER=memory']);
142
- }
143
- testEnvFile.commit();
144
- sink_1.logger.action('create').succeeded('.env.test');
145
- }
146
- /**
147
- * Update "tsconfig.json"
148
- */
149
- const tsConfig = new sink_1.files.JsonFile(this.application.appRoot, 'tsconfig.json');
150
- const existingTypes = tsConfig.get('compilerOptions.types') || [];
151
- if (!existingTypes.includes('@japa/preset-adonis/build/adonis-typings')) {
152
- existingTypes.push('@japa/preset-adonis/build/adonis-typings');
153
- }
154
- tsConfig.set('compilerOptions.types', existingTypes);
155
- tsConfig.commit();
156
- sink_1.logger.action('update').succeeded('tsconfig.json');
157
- /**
158
- * Set additional .env variables for "web" boilerplate
159
- */
160
- if (this.appType === 'web') {
161
- testEnvFile.add(['ASSETS_DRIVER=fake', 'SESSION_DRIVER=memory']);
162
- }
163
- testEnvFile.commit();
164
- sink_1.logger.action('create').succeeded('.env.test');
165
- /**
166
- * Install required dependencies
167
- */
168
- const pkgFile = new sink_1.files.PackageJsonFile(this.application.appRoot);
169
- pkgFile.install('@japa/runner');
170
- pkgFile.install('@japa/preset-adonis');
171
- pkgFile.useClient(this.getPackageManager());
172
- const spinner = sink_1.logger.await(sink_1.logger.colors.gray('installing @japa/runner, @japa/preset-adonis'));
173
- try {
174
- await pkgFile.commitAsync();
175
- spinner.update('Installed');
176
- spinner.stop();
177
- }
178
- catch (error) {
179
- spinner.update('Unable to install packages');
180
- spinner.stop();
181
- sink_1.logger.fatal(error);
182
- }
183
- }
184
- /**
185
- * Configure a give package
186
- */
187
- async configurePackage(name) {
188
- if (name === 'encore') {
189
- await this.configureEncore();
190
- return;
191
- }
192
- if (name === 'tests') {
193
- await this.configureTests();
194
- return;
195
- }
196
- await new sink_1.tasks.Instructions(name, this.application.appRoot, this.application, true).execute();
197
- await new Manifest_1.Manifest(this.application.appRoot, this.logger).generate();
198
- }
199
- /**
200
- * Invoked automatically by ace
201
- */
202
- async run() {
203
- for (let name of this.packages) {
204
- await this.configurePackage(name);
205
- }
206
- }
207
- }
208
- Configure.commandName = 'configure';
209
- Configure.description = 'Configure one or more AdonisJS packages';
210
- Configure.aliases = ['invoke'];
211
- __decorate([
212
- standalone_1.args.spread({
213
- description: 'Name of the package(s) you want to configure',
214
- }),
215
- __metadata("design:type", Array)
216
- ], Configure.prototype, "packages", void 0);
217
- 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');
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,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
+ }