@adonisjs/assembler 5.9.0 → 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 +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 +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 +1 -1
@@ -1,287 +1,287 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/assembler
4
- *
5
- * (c) Harminder Virk <virk@adonisjs.com>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- var __importDefault = (this && this.__importDefault) || function (mod) {
11
- return (mod && mod.__esModule) ? mod : { "default": mod };
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.Compiler = void 0;
15
- const slash_1 = __importDefault(require("slash"));
16
- const cpy_1 = __importDefault(require("cpy"));
17
- const path_1 = require("path");
18
- const fs_extra_1 = require("fs-extra");
19
- const ioc_transformer_1 = require("@adonisjs/ioc-transformer");
20
- const cliui_1 = require("@poppinss/cliui");
21
- const Ts_1 = require("../Ts");
22
- const RcFile_1 = require("../RcFile");
23
- const Manifest_1 = require("../Manifest");
24
- const paths_1 = require("../../config/paths");
25
- const AssetsBundler_1 = require("../AssetsBundler");
26
- /**
27
- * Exposes the API to build the AdonisJs project for development or
28
- * production. The production build has it's own set of node_modules
29
- */
30
- class Compiler {
31
- constructor(appRoot, encoreArgs, buildAssets, logger = cliui_1.logger, tsconfig) {
32
- this.appRoot = appRoot;
33
- this.encoreArgs = encoreArgs;
34
- this.buildAssets = buildAssets;
35
- this.logger = logger;
36
- /**
37
- * Reference to rc File
38
- */
39
- this.rcFile = new RcFile_1.RcFile(this.appRoot);
40
- this.ts = new Ts_1.Ts(this.appRoot, this.logger, tsconfig);
41
- this.ts.tsCompiler.use(() => {
42
- return (0, ioc_transformer_1.iocTransformer)(this.ts.tsCompiler.ts, this.rcFile.application.rcFile);
43
- }, 'after');
44
- }
45
- /**
46
- * Returns relative unix path from the project root. Used for
47
- * display only
48
- */
49
- getRelativeUnixPath(absPath) {
50
- return (0, slash_1.default)((0, path_1.relative)(this.appRoot, absPath));
51
- }
52
- /**
53
- * Cleans up the build directory
54
- */
55
- async cleanupBuildDirectory(outDir) {
56
- this.getRelativeUnixPath(outDir);
57
- this.logger.info(`cleaning up ${this.logger.colors
58
- .dim()
59
- .yellow(`"./${this.getRelativeUnixPath(outDir)}"`)} directory`);
60
- await (0, fs_extra_1.remove)(outDir);
61
- }
62
- /**
63
- * Copies .adonisrc.json file to the destination
64
- */
65
- async copyAdonisRcFile(outDir) {
66
- this.logger.info(`copy { ${this.logger.colors
67
- .dim()
68
- .yellow(`${paths_1.RCFILE_NAME} => ${this.getRelativeUnixPath(outDir)}`)} }`);
69
- await (0, fs_extra_1.outputJSON)((0, path_1.join)(outDir, paths_1.RCFILE_NAME), Object.assign({}, this.rcFile.getDiskContents(), {
70
- typescript: false,
71
- lastCompiledAt: new Date().toISOString(),
72
- }), { spaces: 2 });
73
- }
74
- /**
75
- * Copy all meta files to the build directory
76
- */
77
- async copyMetaFiles(outDir, extraFiles) {
78
- const metaFiles = this.rcFile.getMetaFilesGlob().concat(extraFiles || []);
79
- this.logger.info(`copy { ${this.logger.colors
80
- .dim()
81
- .yellow(`${metaFiles.join(',')} => ${this.getRelativeUnixPath(outDir)}`)} }`);
82
- await this.copyFiles(metaFiles, outDir);
83
- }
84
- /**
85
- * Copy files to destination directory
86
- */
87
- async copyFiles(files, outDir) {
88
- try {
89
- await (0, cpy_1.default)(files, outDir, { cwd: this.appRoot, parents: true });
90
- }
91
- catch (error) {
92
- if (!error.message.includes("the file doesn't exist")) {
93
- throw error;
94
- }
95
- }
96
- }
97
- /**
98
- * Build typescript source files
99
- */
100
- buildTypescriptSource(config) {
101
- this.logger.info('compiling typescript source files');
102
- const builder = this.ts.tsCompiler.builder(config);
103
- const { skipped, diagnostics } = builder.build();
104
- if (skipped) {
105
- this.logger.warning('typescript emit skipped');
106
- }
107
- if (diagnostics.length) {
108
- this.logger.error('typescript compiler errors');
109
- this.ts.renderDiagnostics(diagnostics, builder.host);
110
- }
111
- return {
112
- skipped,
113
- hasErrors: diagnostics.length > 0,
114
- };
115
- }
116
- /**
117
- * Log the message that ts build and failed
118
- */
119
- logTsBuildFailed() {
120
- this.logger.logError('');
121
- this.logger.logError(this.logger.colors.bgRed(`Cannot complete the build process as there are typescript errors. Use "--ignore-ts-errors" flag to ignore Typescript errors`));
122
- }
123
- /**
124
- * Typecheck the project without emit
125
- */
126
- async typeCheck() {
127
- const config = this.ts.parseConfig();
128
- if (!config) {
129
- return false;
130
- }
131
- this.logger.info('type checking typescript source files');
132
- config.options.noEmit = true;
133
- const builder = this.ts.tsCompiler.builder(config);
134
- const { diagnostics } = builder.build();
135
- if (diagnostics.length) {
136
- this.logger.error('typescript compiler errors');
137
- this.ts.renderDiagnostics(diagnostics, builder.host);
138
- return false;
139
- }
140
- this.logger.success('built successfully');
141
- return true;
142
- }
143
- /**
144
- * Compile project. See [[Compiler.compileForProduction]] for
145
- * production build
146
- */
147
- async compile(stopOnError = true, extraFiles) {
148
- const config = this.ts.parseConfig();
149
- if (!config) {
150
- return false;
151
- }
152
- /**
153
- * Bundle frontend assets when encore is installed
154
- */
155
- const encore = await new AssetsBundler_1.AssetsBundler(this.appRoot, this.encoreArgs, this.buildAssets, this.logger).build();
156
- /**
157
- * Skipped, coz of frontend errors
158
- */
159
- if (encore.hasErrors) {
160
- return false;
161
- }
162
- /**
163
- * Always cleanup the out directory
164
- */
165
- await this.cleanupBuildDirectory(config.options.outDir);
166
- /**
167
- * Build typescript source
168
- */
169
- const ts = this.buildTypescriptSource(config);
170
- /**
171
- * Do not continue when output was skipped
172
- */
173
- if (ts.skipped) {
174
- return false;
175
- }
176
- /**
177
- * Do not continue when has errors and "stopOnError" is true
178
- */
179
- if (stopOnError && ts.hasErrors) {
180
- this.logTsBuildFailed();
181
- await this.cleanupBuildDirectory(config.options.outDir);
182
- return false;
183
- }
184
- /**
185
- * Begin by copying meta files
186
- */
187
- await this.copyMetaFiles(config.options.outDir, extraFiles);
188
- /**
189
- * Copy `.adonisrc.json` file
190
- */
191
- await this.copyAdonisRcFile(config.options.outDir);
192
- /**
193
- * Manifest instance to generate ace manifest file
194
- */
195
- const manifest = new Manifest_1.Manifest(config.options.outDir, this.logger);
196
- const created = await manifest.generate();
197
- /**
198
- * Do not continue when unable to generate the manifest file as commands
199
- * won't be available
200
- */
201
- if (!created) {
202
- await this.cleanupBuildDirectory(config.options.outDir);
203
- return false;
204
- }
205
- this.logger.success('built successfully');
206
- return true;
207
- }
208
- /**
209
- * Compile project. See [[Compiler.compile]] for development build
210
- */
211
- async compileForProduction(stopOnError = true, client) {
212
- const config = this.ts.parseConfig();
213
- if (!config) {
214
- return false;
215
- }
216
- /**
217
- * Bundle frontend assets when encore is installed
218
- */
219
- const encore = await new AssetsBundler_1.AssetsBundler(this.appRoot, this.encoreArgs, this.buildAssets, this.logger).buildForProduction();
220
- /**
221
- * Skipped, coz of frontend errors
222
- */
223
- if (encore.hasErrors) {
224
- return false;
225
- }
226
- const pkgFiles = client === 'npm' ? ['package.json', 'package-lock.json'] : ['package.json', 'yarn.lock'];
227
- /**
228
- * Always cleanup the out directory
229
- */
230
- await this.cleanupBuildDirectory(config.options.outDir);
231
- /**
232
- * Build typescript source
233
- */
234
- const { skipped, hasErrors } = this.buildTypescriptSource(config);
235
- /**
236
- * Do not continue when output was skipped
237
- */
238
- if (skipped) {
239
- return false;
240
- }
241
- /**
242
- * Do not continue when has errors and "stopOnError" is true and cleanup
243
- * the build directory
244
- */
245
- if (stopOnError && hasErrors) {
246
- this.logTsBuildFailed();
247
- await this.cleanupBuildDirectory(config.options.outDir);
248
- return false;
249
- }
250
- /**
251
- * Begin by copying meta files
252
- */
253
- await this.copyMetaFiles(config.options.outDir, pkgFiles);
254
- /**
255
- * Copy `.adonisrc.json` file
256
- */
257
- await this.copyAdonisRcFile(config.options.outDir);
258
- /**
259
- * Generate commands manifest
260
- */
261
- const manifest = new Manifest_1.Manifest(config.options.outDir, this.logger);
262
- const created = await manifest.generate();
263
- /**
264
- * Do not continue when unable to generate the manifest file as commands
265
- * won't be available
266
- */
267
- if (!created) {
268
- await this.cleanupBuildDirectory(config.options.outDir);
269
- return false;
270
- }
271
- /**
272
- * Print usage instructions
273
- */
274
- const installCommand = client === 'npm' ? 'npm ci --production' : 'yarn install --production';
275
- const relativeBuildPath = this.getRelativeUnixPath(config.options.outDir);
276
- this.logger.success('built successfully');
277
- this.logger.log('');
278
- (0, cliui_1.instructions)()
279
- .heading('Run the following commands to start the server in production')
280
- .add(this.logger.colors.cyan(`cd ${relativeBuildPath}`))
281
- .add(this.logger.colors.cyan(installCommand))
282
- .add(this.logger.colors.cyan('node server.js'))
283
- .render();
284
- return true;
285
- }
286
- }
287
- exports.Compiler = Compiler;
1
+ "use strict";
2
+ /*
3
+ * @adonisjs/assembler
4
+ *
5
+ * (c) Harminder Virk <virk@adonisjs.com>
6
+ *
7
+ * For the full copyright and license information, please view the LICENSE
8
+ * file that was distributed with this source code.
9
+ */
10
+ var __importDefault = (this && this.__importDefault) || function (mod) {
11
+ return (mod && mod.__esModule) ? mod : { "default": mod };
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.Compiler = void 0;
15
+ const slash_1 = __importDefault(require("slash"));
16
+ const cpy_1 = __importDefault(require("cpy"));
17
+ const path_1 = require("path");
18
+ const fs_extra_1 = require("fs-extra");
19
+ const ioc_transformer_1 = require("@adonisjs/ioc-transformer");
20
+ const cliui_1 = require("@poppinss/cliui");
21
+ const Ts_1 = require("../Ts");
22
+ const RcFile_1 = require("../RcFile");
23
+ const Manifest_1 = require("../Manifest");
24
+ const paths_1 = require("../../config/paths");
25
+ const AssetsBundler_1 = require("../AssetsBundler");
26
+ /**
27
+ * Exposes the API to build the AdonisJs project for development or
28
+ * production. The production build has it's own set of node_modules
29
+ */
30
+ class Compiler {
31
+ constructor(appRoot, encoreArgs, buildAssets, logger = cliui_1.logger, tsconfig) {
32
+ this.appRoot = appRoot;
33
+ this.encoreArgs = encoreArgs;
34
+ this.buildAssets = buildAssets;
35
+ this.logger = logger;
36
+ /**
37
+ * Reference to rc File
38
+ */
39
+ this.rcFile = new RcFile_1.RcFile(this.appRoot);
40
+ this.ts = new Ts_1.Ts(this.appRoot, this.logger, tsconfig);
41
+ this.ts.tsCompiler.use(() => {
42
+ return (0, ioc_transformer_1.iocTransformer)(this.ts.tsCompiler.ts, this.rcFile.application.rcFile);
43
+ }, 'after');
44
+ }
45
+ /**
46
+ * Returns relative unix path from the project root. Used for
47
+ * display only
48
+ */
49
+ getRelativeUnixPath(absPath) {
50
+ return (0, slash_1.default)((0, path_1.relative)(this.appRoot, absPath));
51
+ }
52
+ /**
53
+ * Cleans up the build directory
54
+ */
55
+ async cleanupBuildDirectory(outDir) {
56
+ this.getRelativeUnixPath(outDir);
57
+ this.logger.info(`cleaning up ${this.logger.colors
58
+ .dim()
59
+ .yellow(`"./${this.getRelativeUnixPath(outDir)}"`)} directory`);
60
+ await (0, fs_extra_1.remove)(outDir);
61
+ }
62
+ /**
63
+ * Copies .adonisrc.json file to the destination
64
+ */
65
+ async copyAdonisRcFile(outDir) {
66
+ this.logger.info(`copy { ${this.logger.colors
67
+ .dim()
68
+ .yellow(`${paths_1.RCFILE_NAME} => ${this.getRelativeUnixPath(outDir)}`)} }`);
69
+ await (0, fs_extra_1.outputJSON)((0, path_1.join)(outDir, paths_1.RCFILE_NAME), Object.assign({}, this.rcFile.getDiskContents(), {
70
+ typescript: false,
71
+ lastCompiledAt: new Date().toISOString(),
72
+ }), { spaces: 2 });
73
+ }
74
+ /**
75
+ * Copy all meta files to the build directory
76
+ */
77
+ async copyMetaFiles(outDir, extraFiles) {
78
+ const metaFiles = this.rcFile.getMetaFilesGlob().concat(extraFiles || []);
79
+ this.logger.info(`copy { ${this.logger.colors
80
+ .dim()
81
+ .yellow(`${metaFiles.join(',')} => ${this.getRelativeUnixPath(outDir)}`)} }`);
82
+ await this.copyFiles(metaFiles, outDir);
83
+ }
84
+ /**
85
+ * Copy files to destination directory
86
+ */
87
+ async copyFiles(files, outDir) {
88
+ try {
89
+ await (0, cpy_1.default)(files, outDir, { cwd: this.appRoot, parents: true });
90
+ }
91
+ catch (error) {
92
+ if (!error.message.includes("the file doesn't exist")) {
93
+ throw error;
94
+ }
95
+ }
96
+ }
97
+ /**
98
+ * Build typescript source files
99
+ */
100
+ buildTypescriptSource(config) {
101
+ this.logger.info('compiling typescript source files');
102
+ const builder = this.ts.tsCompiler.builder(config);
103
+ const { skipped, diagnostics } = builder.build();
104
+ if (skipped) {
105
+ this.logger.warning('typescript emit skipped');
106
+ }
107
+ if (diagnostics.length) {
108
+ this.logger.error('typescript compiler errors');
109
+ this.ts.renderDiagnostics(diagnostics, builder.host);
110
+ }
111
+ return {
112
+ skipped,
113
+ hasErrors: diagnostics.length > 0,
114
+ };
115
+ }
116
+ /**
117
+ * Log the message that ts build and failed
118
+ */
119
+ logTsBuildFailed() {
120
+ this.logger.logError('');
121
+ this.logger.logError(this.logger.colors.bgRed(`Cannot complete the build process as there are typescript errors. Use "--ignore-ts-errors" flag to ignore Typescript errors`));
122
+ }
123
+ /**
124
+ * Typecheck the project without emit
125
+ */
126
+ async typeCheck() {
127
+ const config = this.ts.parseConfig();
128
+ if (!config) {
129
+ return false;
130
+ }
131
+ this.logger.info('type checking typescript source files');
132
+ config.options.noEmit = true;
133
+ const builder = this.ts.tsCompiler.builder(config);
134
+ const { diagnostics } = builder.build();
135
+ if (diagnostics.length) {
136
+ this.logger.error('typescript compiler errors');
137
+ this.ts.renderDiagnostics(diagnostics, builder.host);
138
+ return false;
139
+ }
140
+ this.logger.success('built successfully');
141
+ return true;
142
+ }
143
+ /**
144
+ * Compile project. See [[Compiler.compileForProduction]] for
145
+ * production build
146
+ */
147
+ async compile(stopOnError = true, extraFiles) {
148
+ const config = this.ts.parseConfig();
149
+ if (!config) {
150
+ return false;
151
+ }
152
+ /**
153
+ * Bundle frontend assets when encore is installed
154
+ */
155
+ const encore = await new AssetsBundler_1.AssetsBundler(this.appRoot, this.encoreArgs, this.buildAssets, this.logger).build();
156
+ /**
157
+ * Skipped, coz of frontend errors
158
+ */
159
+ if (encore.hasErrors) {
160
+ return false;
161
+ }
162
+ /**
163
+ * Always cleanup the out directory
164
+ */
165
+ await this.cleanupBuildDirectory(config.options.outDir);
166
+ /**
167
+ * Build typescript source
168
+ */
169
+ const ts = this.buildTypescriptSource(config);
170
+ /**
171
+ * Do not continue when output was skipped
172
+ */
173
+ if (ts.skipped) {
174
+ return false;
175
+ }
176
+ /**
177
+ * Do not continue when has errors and "stopOnError" is true
178
+ */
179
+ if (stopOnError && ts.hasErrors) {
180
+ this.logTsBuildFailed();
181
+ await this.cleanupBuildDirectory(config.options.outDir);
182
+ return false;
183
+ }
184
+ /**
185
+ * Begin by copying meta files
186
+ */
187
+ await this.copyMetaFiles(config.options.outDir, extraFiles);
188
+ /**
189
+ * Copy `.adonisrc.json` file
190
+ */
191
+ await this.copyAdonisRcFile(config.options.outDir);
192
+ /**
193
+ * Manifest instance to generate ace manifest file
194
+ */
195
+ const manifest = new Manifest_1.Manifest(config.options.outDir, this.logger);
196
+ const created = await manifest.generate();
197
+ /**
198
+ * Do not continue when unable to generate the manifest file as commands
199
+ * won't be available
200
+ */
201
+ if (!created) {
202
+ await this.cleanupBuildDirectory(config.options.outDir);
203
+ return false;
204
+ }
205
+ this.logger.success('built successfully');
206
+ return true;
207
+ }
208
+ /**
209
+ * Compile project. See [[Compiler.compile]] for development build
210
+ */
211
+ async compileForProduction(stopOnError = true, client) {
212
+ const config = this.ts.parseConfig();
213
+ if (!config) {
214
+ return false;
215
+ }
216
+ /**
217
+ * Bundle frontend assets when encore is installed
218
+ */
219
+ const encore = await new AssetsBundler_1.AssetsBundler(this.appRoot, this.encoreArgs, this.buildAssets, this.logger).buildForProduction();
220
+ /**
221
+ * Skipped, coz of frontend errors
222
+ */
223
+ if (encore.hasErrors) {
224
+ return false;
225
+ }
226
+ const pkgFiles = client === 'npm' ? ['package.json', 'package-lock.json'] : ['package.json', 'yarn.lock'];
227
+ /**
228
+ * Always cleanup the out directory
229
+ */
230
+ await this.cleanupBuildDirectory(config.options.outDir);
231
+ /**
232
+ * Build typescript source
233
+ */
234
+ const { skipped, hasErrors } = this.buildTypescriptSource(config);
235
+ /**
236
+ * Do not continue when output was skipped
237
+ */
238
+ if (skipped) {
239
+ return false;
240
+ }
241
+ /**
242
+ * Do not continue when has errors and "stopOnError" is true and cleanup
243
+ * the build directory
244
+ */
245
+ if (stopOnError && hasErrors) {
246
+ this.logTsBuildFailed();
247
+ await this.cleanupBuildDirectory(config.options.outDir);
248
+ return false;
249
+ }
250
+ /**
251
+ * Begin by copying meta files
252
+ */
253
+ await this.copyMetaFiles(config.options.outDir, pkgFiles);
254
+ /**
255
+ * Copy `.adonisrc.json` file
256
+ */
257
+ await this.copyAdonisRcFile(config.options.outDir);
258
+ /**
259
+ * Generate commands manifest
260
+ */
261
+ const manifest = new Manifest_1.Manifest(config.options.outDir, this.logger);
262
+ const created = await manifest.generate();
263
+ /**
264
+ * Do not continue when unable to generate the manifest file as commands
265
+ * won't be available
266
+ */
267
+ if (!created) {
268
+ await this.cleanupBuildDirectory(config.options.outDir);
269
+ return false;
270
+ }
271
+ /**
272
+ * Print usage instructions
273
+ */
274
+ const installCommand = client === 'npm' ? 'npm ci --production' : 'yarn install --production';
275
+ const relativeBuildPath = this.getRelativeUnixPath(config.options.outDir);
276
+ this.logger.success('built successfully');
277
+ this.logger.log('');
278
+ (0, cliui_1.instructions)()
279
+ .heading('Run the following commands to start the server in production')
280
+ .add(this.logger.colors.cyan(`cd ${relativeBuildPath}`))
281
+ .add(this.logger.colors.cyan(installCommand))
282
+ .add(this.logger.colors.cyan('node server.js'))
283
+ .render();
284
+ return true;
285
+ }
286
+ }
287
+ exports.Compiler = Compiler;
@@ -1,8 +1,8 @@
1
- export declare type JapaFlags = Partial<{
2
- '_': string[];
3
- '--tags': string[];
4
- '--ignore-tags': string[];
5
- '--files': string[];
6
- '--timeout': number;
7
- '--force-exit': boolean;
8
- }>;
1
+ export declare type JapaFlags = Partial<{
2
+ '_': string[];
3
+ '--tags': string[];
4
+ '--ignore-tags': string[];
5
+ '--files': string[];
6
+ '--timeout': number;
7
+ '--force-exit': boolean;
8
+ }>;
@@ -1,10 +1,10 @@
1
- "use strict";
2
- /*
3
- * @adonisjs/assembler
4
- *
5
- * (c) Harminder Virk <virk@adonisjs.com>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ /*
3
+ * @adonisjs/assembler
4
+ *
5
+ * (c) Harminder Virk <virk@adonisjs.com>
6
+ *
7
+ * For the full copyright and license information, please view the LICENSE
8
+ * file that was distributed with this source code.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });