@adonisjs/assembler 5.3.4 → 5.3.8

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 (34) hide show
  1. package/README.md +2 -2
  2. package/build/commands/Build.js +1 -1
  3. package/build/commands/Invoke.js +1 -1
  4. package/build/commands/Make/Base.js +2 -2
  5. package/build/commands/Make/Command.js +1 -1
  6. package/build/commands/Make/Controller.js +1 -1
  7. package/build/commands/Make/Exception.js +1 -1
  8. package/build/commands/Make/Listener.js +1 -1
  9. package/build/commands/Make/Middleware.js +1 -1
  10. package/build/commands/Make/PreloadFile.js +3 -3
  11. package/build/commands/Make/Provider.js +3 -3
  12. package/build/commands/Make/Validator.js +1 -1
  13. package/build/commands/Make/View.js +1 -1
  14. package/build/register.js +1 -1
  15. package/build/src/AssetsBundler/index.js +4 -4
  16. package/build/src/Compiler/index.js +6 -6
  17. package/build/src/DevServer/index.js +3 -3
  18. package/build/src/EnvParser/index.js +1 -1
  19. package/build/src/HttpServer/index.js +2 -1
  20. package/build/src/Manifest/index.js +1 -1
  21. package/build/src/RcFile/index.js +6 -6
  22. package/build/src/Ts/index.js +2 -2
  23. package/build/src/requireHook/index.js +1 -1
  24. package/build/src/requireHook/ioc-transformer.js +1 -1
  25. package/build/templates/command.txt +1 -2
  26. package/build/templates/controller.txt +1 -2
  27. package/build/templates/event-listener.txt +1 -2
  28. package/build/templates/exception.txt +1 -2
  29. package/build/templates/middleware.txt +1 -1
  30. package/build/templates/provider.txt +5 -6
  31. package/build/templates/resource-controller.txt +7 -14
  32. package/build/templates/self-handle-exception.txt +1 -1
  33. package/build/templates/validator.txt +32 -34
  34. package/package.json +25 -25
package/README.md CHANGED
@@ -21,11 +21,11 @@
21
21
 
22
22
  <div align="center">
23
23
  <h3>
24
- <a href="https://preview.adonisjs.com">
24
+ <a href="https://adonisjs.com">
25
25
  Website
26
26
  </a>
27
27
  <span> | </span>
28
- <a href="https://preview.adonisjs.com/guides">
28
+ <a href="https://docs.adonisjs.com/guides/installation">
29
29
  Guides
30
30
  </a>
31
31
  <span> | </span>
@@ -69,7 +69,7 @@ class Build extends standalone_1.BaseCommand {
69
69
  /**
70
70
  * Deciding the client to use for installing dependencies
71
71
  */
72
- this.client = this.client || has_yarn_1.default(this.application.appRoot) ? 'yarn' : 'npm';
72
+ this.client = this.client || (0, has_yarn_1.default)(this.application.appRoot) ? 'yarn' : 'npm';
73
73
  if (this.client !== 'npm' && this.client !== 'yarn') {
74
74
  this.logger.warning('--client must be set to "npm" or "yarn"');
75
75
  this.exitCode = 1;
@@ -51,7 +51,7 @@ class Configure extends standalone_1.BaseCommand {
51
51
  /**
52
52
  * Create the webpack config file
53
53
  */
54
- const webpackConfigFile = new files.MustacheFile(this.application.appRoot, 'webpack.config.js', path_1.join(__dirname, '..', 'templates/webpack.config.txt'));
54
+ const webpackConfigFile = new files.MustacheFile(this.application.appRoot, 'webpack.config.js', (0, path_1.join)(__dirname, '..', 'templates/webpack.config.txt'));
55
55
  if (!webpackConfigFile.exists()) {
56
56
  webpackConfigFile.apply({}).commit();
57
57
  logger.action('create').succeeded('webpack.config.js');
@@ -35,8 +35,8 @@ class BaseGenerator extends standalone_1.BaseCommand {
35
35
  * Returns contents of the rcFile
36
36
  */
37
37
  async hasRcFile(cwd) {
38
- const filePath = path_1.join(cwd, '.adonisrc.json');
39
- return fs_extra_1.pathExists(filePath);
38
+ const filePath = (0, path_1.join)(cwd, '.adonisrc.json');
39
+ return (0, fs_extra_1.pathExists)(filePath);
40
40
  }
41
41
  /**
42
42
  * Handle command
@@ -37,7 +37,7 @@ class MakeCommand extends Base_1.BaseGenerator {
37
37
  * flag value
38
38
  */
39
39
  getStub() {
40
- return path_1.join(__dirname, '..', '..', 'templates', 'command.txt');
40
+ return (0, path_1.join)(__dirname, '..', '..', 'templates', 'command.txt');
41
41
  }
42
42
  /**
43
43
  * Path to the commands directory
@@ -50,7 +50,7 @@ class MakeController extends Base_1.BaseGenerator {
50
50
  * flag value
51
51
  */
52
52
  getStub() {
53
- return path_1.join(__dirname, '..', '..', 'templates', this.resource ? 'resource-controller.txt' : 'controller.txt');
53
+ return (0, path_1.join)(__dirname, '..', '..', 'templates', this.resource ? 'resource-controller.txt' : 'controller.txt');
54
54
  }
55
55
  /**
56
56
  * Pull path from the `httpControllers` directory declaration from
@@ -37,7 +37,7 @@ class MakeException extends Base_1.BaseGenerator {
37
37
  * Returns the template stub
38
38
  */
39
39
  getStub() {
40
- return path_1.join(__dirname, '..', '..', 'templates', this.selfHandle ? 'self-handle-exception.txt' : 'exception.txt');
40
+ return (0, path_1.join)(__dirname, '..', '..', 'templates', this.selfHandle ? 'self-handle-exception.txt' : 'exception.txt');
41
41
  }
42
42
  /**
43
43
  * Pull path from the `exceptions` namespace declaration from
@@ -36,7 +36,7 @@ class MakeListener extends Base_1.BaseGenerator {
36
36
  * Returns the template stub
37
37
  */
38
38
  getStub() {
39
- return path_1.join(__dirname, '..', '..', 'templates', 'event-listener.txt');
39
+ return (0, path_1.join)(__dirname, '..', '..', 'templates', 'event-listener.txt');
40
40
  }
41
41
  /**
42
42
  * Pull path from the `listeners` directory declaration from
@@ -37,7 +37,7 @@ class MakeMiddleware extends Base_1.BaseGenerator {
37
37
  * Returns the template stub path
38
38
  */
39
39
  getStub() {
40
- return path_1.join(__dirname, '..', '..', 'templates', 'middleware.txt');
40
+ return (0, path_1.join)(__dirname, '..', '..', 'templates', 'middleware.txt');
41
41
  }
42
42
  /**
43
43
  * Middleware are always created inside `app/Middleware` directory.
@@ -66,7 +66,7 @@ class MakePreloadFile extends Base_1.BaseGenerator {
66
66
  * Returns the template stub path
67
67
  */
68
68
  getStub() {
69
- return path_1.join(__dirname, '..', '..', 'templates', 'preload-file.txt');
69
+ return (0, path_1.join)(__dirname, '..', '..', 'templates', 'preload-file.txt');
70
70
  }
71
71
  /**
72
72
  * Path to the start directory
@@ -123,10 +123,10 @@ class MakePreloadFile extends Base_1.BaseGenerator {
123
123
  const relativePath = file.toJSON().relativepath;
124
124
  const rcFile = new files.AdonisRcFile(this.application.appRoot);
125
125
  if (environments && environments.length) {
126
- rcFile.setPreload(`./${slash_1.default(relativePath).replace(path_1.extname(relativePath), '')}`, environments);
126
+ rcFile.setPreload(`./${(0, slash_1.default)(relativePath).replace((0, path_1.extname)(relativePath), '')}`, environments);
127
127
  }
128
128
  else {
129
- rcFile.setPreload(`./${slash_1.default(relativePath).replace(path_1.extname(relativePath), '')}`);
129
+ rcFile.setPreload(`./${(0, slash_1.default)(relativePath).replace((0, path_1.extname)(relativePath), '')}`);
130
130
  }
131
131
  rcFile.commit();
132
132
  }
@@ -60,7 +60,7 @@ class MakeProvider extends Base_1.BaseGenerator {
60
60
  * Returns the template stub path
61
61
  */
62
62
  getStub() {
63
- return path_1.join(__dirname, '..', '..', 'templates', 'provider.txt');
63
+ return (0, path_1.join)(__dirname, '..', '..', 'templates', 'provider.txt');
64
64
  }
65
65
  /**
66
66
  * Path to the providers directory
@@ -79,10 +79,10 @@ class MakeProvider extends Base_1.BaseGenerator {
79
79
  const relativePath = file.toJSON().relativepath;
80
80
  const rcFile = new files.AdonisRcFile(this.application.appRoot);
81
81
  if (this.ace) {
82
- rcFile.addAceProvider(`./${slash_1.default(relativePath).replace(path_1.extname(relativePath), '')}`);
82
+ rcFile.addAceProvider(`./${(0, slash_1.default)(relativePath).replace((0, path_1.extname)(relativePath), '')}`);
83
83
  }
84
84
  else {
85
- rcFile.addProvider(`./${slash_1.default(relativePath).replace(path_1.extname(relativePath), '')}`);
85
+ rcFile.addProvider(`./${(0, slash_1.default)(relativePath).replace((0, path_1.extname)(relativePath), '')}`);
86
86
  }
87
87
  rcFile.commit();
88
88
  }
@@ -37,7 +37,7 @@ class MakeValidator extends Base_1.BaseGenerator {
37
37
  * Returns the template stub path
38
38
  */
39
39
  getStub() {
40
- return path_1.join(__dirname, '..', '..', 'templates', 'validator.txt');
40
+ return (0, path_1.join)(__dirname, '..', '..', 'templates', 'validator.txt');
41
41
  }
42
42
  /**
43
43
  * Pull path for the `validators` directory declaration from
@@ -37,7 +37,7 @@ class MakeView extends Base_1.BaseGenerator {
37
37
  * Returns the template stub path
38
38
  */
39
39
  getStub() {
40
- return path_1.join(__dirname, '..', '..', 'templates', 'view.txt');
40
+ return (0, path_1.join)(__dirname, '..', '..', 'templates', 'view.txt');
41
41
  }
42
42
  /**
43
43
  * Path to the providers directory
package/build/register.js CHANGED
@@ -12,4 +12,4 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  const requireHook_1 = __importDefault(require("./src/requireHook"));
15
- requireHook_1.default(process.env.ADONIS_ACE_CWD || process.cwd());
15
+ (0, requireHook_1.default)(process.env.ADONIS_ACE_CWD || process.cwd());
@@ -56,7 +56,7 @@ class AssetsBundler extends emittery_1.default {
56
56
  */
57
57
  isEncoreInstalled() {
58
58
  try {
59
- helpers_1.resolveDir(this.projectRoot, '@symfony/webpack-encore');
59
+ (0, helpers_1.resolveDir)(this.projectRoot, '@symfony/webpack-encore');
60
60
  return true;
61
61
  }
62
62
  catch {
@@ -127,7 +127,7 @@ class AssetsBundler extends emittery_1.default {
127
127
  */
128
128
  exec(args) {
129
129
  return new Promise((resolve, reject) => {
130
- const childProcess = execa_1.default(this.binaryName, args, this.execaOptions);
130
+ const childProcess = (0, execa_1.default)(this.binaryName, args, this.execaOptions);
131
131
  childProcess.stdout?.on('data', (line) => this.log(line));
132
132
  childProcess.stderr?.on('data', (line) => this.logError(line));
133
133
  childProcess.on('error', (error) => reject(error));
@@ -201,11 +201,11 @@ class AssetsBundler extends emittery_1.default {
201
201
  */
202
202
  let customPort = this.findCustomPort();
203
203
  if (!customPort) {
204
- const randomPort = await get_port_1.default({ port: 8080 });
204
+ const randomPort = await (0, get_port_1.default)({ port: 8080 });
205
205
  customPort = String(randomPort);
206
206
  this.encoreArgs.push('--port', customPort);
207
207
  }
208
- const childProcess = execa_1.default(this.binaryName, ['dev-server'].concat(this.encoreArgs), this.execaOptions);
208
+ const childProcess = (0, execa_1.default)(this.binaryName, ['dev-server'].concat(this.encoreArgs), this.execaOptions);
209
209
  childProcess.stdout?.on('data', (line) => this.log(line));
210
210
  childProcess.stderr?.on('data', (line) => this.logError(line));
211
211
  childProcess.on('close', (code, signal) => this.emit('close', { code, signal }));
@@ -39,7 +39,7 @@ class Compiler {
39
39
  this.rcFile = new RcFile_1.RcFile(this.appRoot);
40
40
  this.ts = new Ts_1.Ts(this.appRoot, this.logger, tsconfig);
41
41
  this.ts.tsCompiler.use(() => {
42
- return ioc_transformer_1.iocTransformer(this.ts.tsCompiler.ts, this.rcFile.application.rcFile);
42
+ return (0, ioc_transformer_1.iocTransformer)(this.ts.tsCompiler.ts, this.rcFile.application.rcFile);
43
43
  }, 'after');
44
44
  }
45
45
  /**
@@ -47,7 +47,7 @@ class Compiler {
47
47
  * display only
48
48
  */
49
49
  getRelativeUnixPath(absPath) {
50
- return slash_1.default(path_1.relative(this.appRoot, absPath));
50
+ return (0, slash_1.default)((0, path_1.relative)(this.appRoot, absPath));
51
51
  }
52
52
  /**
53
53
  * Cleans up the build directory
@@ -57,7 +57,7 @@ class Compiler {
57
57
  this.logger.info(`cleaning up ${this.logger.colors
58
58
  .dim()
59
59
  .yellow(`"./${this.getRelativeUnixPath(outDir)}"`)} directory`);
60
- await fs_extra_1.remove(outDir);
60
+ await (0, fs_extra_1.remove)(outDir);
61
61
  }
62
62
  /**
63
63
  * Copies .adonisrc.json file to the destination
@@ -66,7 +66,7 @@ class Compiler {
66
66
  this.logger.info(`copy { ${this.logger.colors
67
67
  .dim()
68
68
  .yellow(`${paths_1.RCFILE_NAME} => ${this.getRelativeUnixPath(outDir)}`)} }`);
69
- await fs_extra_1.outputJSON(path_1.join(outDir, paths_1.RCFILE_NAME), Object.assign({}, this.rcFile.getDiskContents(), {
69
+ await (0, fs_extra_1.outputJSON)((0, path_1.join)(outDir, paths_1.RCFILE_NAME), Object.assign({}, this.rcFile.getDiskContents(), {
70
70
  typescript: false,
71
71
  lastCompiledAt: new Date().toISOString(),
72
72
  }), { spaces: 2 });
@@ -86,7 +86,7 @@ class Compiler {
86
86
  */
87
87
  async copyFiles(files, outDir) {
88
88
  try {
89
- await cpy_1.default(files, outDir, { cwd: this.appRoot, parents: true });
89
+ await (0, cpy_1.default)(files, outDir, { cwd: this.appRoot, parents: true });
90
90
  }
91
91
  catch (error) {
92
92
  if (!error.message.includes("the file doesn't exist")) {
@@ -255,7 +255,7 @@ class Compiler {
255
255
  const relativeBuildPath = this.getRelativeUnixPath(config.options.outDir);
256
256
  this.logger.success('built successfully');
257
257
  this.logger.log('');
258
- cliui_1.instructions()
258
+ (0, cliui_1.instructions)()
259
259
  .heading('Run the following commands to start the server in production')
260
260
  .add(this.logger.colors.cyan(`cd ${relativeBuildPath}`))
261
261
  .add(this.logger.colors.cyan(installCommand))
@@ -55,7 +55,7 @@ class DevServer {
55
55
  /**
56
56
  * Require-ts watch helpers
57
57
  */
58
- this.watchHelpers = require_ts_1.getWatcherHelpers(this.appRoot);
58
+ this.watchHelpers = (0, require_ts_1.getWatcherHelpers)(this.appRoot);
59
59
  }
60
60
  /**
61
61
  * Kill current process
@@ -83,7 +83,7 @@ class DevServer {
83
83
  * original port is in use.
84
84
  */
85
85
  if (!isNaN(Number(PORT))) {
86
- PORT = String(await get_port_1.default({
86
+ PORT = String(await (0, get_port_1.default)({
87
87
  port: [Number(PORT)],
88
88
  host: HOST,
89
89
  }));
@@ -104,7 +104,7 @@ class DevServer {
104
104
  if (this.watchingFileSystem && this.watcherState === 'pending') {
105
105
  return;
106
106
  }
107
- const stickerInstance = cliui_1.sticker();
107
+ const stickerInstance = (0, cliui_1.sticker)();
108
108
  stickerInstance
109
109
  .add(`Server address: ${this.logger.colors.cyan(`http://${this.serverHost === '0.0.0.0' ? '127.0.0.1' : this.serverHost}:${this.serverPort}`)}`)
110
110
  .add(`Watching filesystem for changes: ${this.logger.colors.cyan(this.watchingFileSystem ? 'YES' : 'NO')}`);
@@ -25,7 +25,7 @@ class EnvParser {
25
25
  */
26
26
  async parse(rootDir) {
27
27
  try {
28
- this.envContents = this.parser.parse(await fs_extra_1.readFile(path_1.join(rootDir, '.env'), 'utf-8'));
28
+ this.envContents = this.parser.parse(await (0, fs_extra_1.readFile)((0, path_1.join)(rootDir, '.env'), 'utf-8'));
29
29
  }
30
30
  catch { }
31
31
  }
@@ -46,7 +46,7 @@ class HttpServer extends emittery_1.default {
46
46
  throw new Error('Http server is already connected. Call restart instead');
47
47
  }
48
48
  this.logger.info(this.childProcess ? 're-starting http server...' : 'starting http server...');
49
- this.childProcess = execa_1.default(process.execPath, ['-r', '@adonisjs/assembler/build/register'].concat(this.nodeArgs).concat([this.sourceFile]), {
49
+ this.childProcess = execa_1.default.node(this.sourceFile, [], {
50
50
  buffer: false,
51
51
  stdio: 'inherit',
52
52
  cwd: this.projectRoot,
@@ -54,6 +54,7 @@ class HttpServer extends emittery_1.default {
54
54
  FORCE_COLOR: 'true',
55
55
  ...this.env,
56
56
  },
57
+ nodeOptions: ['-r', '@adonisjs/assembler/build/register'].concat(this.nodeArgs),
57
58
  });
58
59
  /**
59
60
  * Notify about server events
@@ -51,7 +51,7 @@ class Manifest {
51
51
  */
52
52
  async generate() {
53
53
  try {
54
- const response = await execa_1.default('node', ['ace', 'generate:manifest'], {
54
+ const response = await (0, execa_1.default)(process.execPath, ['ace', 'generate:manifest'], {
55
55
  buffer: true,
56
56
  cwd: this.appRoot,
57
57
  env: {
@@ -26,7 +26,7 @@ const paths_1 = require("../../config/paths");
26
26
  class RcFile {
27
27
  constructor(appRoot) {
28
28
  this.appRoot = appRoot;
29
- this.rcFilePath = helpers_1.resolveFrom(this.appRoot, `./${paths_1.RCFILE_NAME}`);
29
+ this.rcFilePath = (0, helpers_1.resolveFrom)(this.appRoot, `./${paths_1.RCFILE_NAME}`);
30
30
  /**
31
31
  * Raw rcfile contents
32
32
  */
@@ -38,16 +38,16 @@ class RcFile {
38
38
  /**
39
39
  * A matcher to know if a file is part of the meta files globs
40
40
  */
41
- this.isMetaFile = picomatch_1.default(this.getMetaFilesGlob());
41
+ this.isMetaFile = (0, picomatch_1.default)(this.getMetaFilesGlob());
42
42
  /**
43
43
  * A matcher to know if a file is part of the restart server files globs
44
44
  */
45
- this.isRestartServerFile = picomatch_1.default(this.getRestartServerFilesGlob());
45
+ this.isRestartServerFile = (0, picomatch_1.default)(this.getRestartServerFilesGlob());
46
46
  /**
47
47
  * Commands match to know, if file path is part of the commands paths defined
48
48
  * inside `.adonisrc.json` file
49
49
  */
50
- this.isCommandsPath = picomatch_1.default(this.commandsGlob());
50
+ this.isCommandsPath = (0, picomatch_1.default)(this.commandsGlob());
51
51
  }
52
52
  /**
53
53
  * Returns an array of globs for the meta files that has `reloadServer`
@@ -67,7 +67,7 @@ class RcFile {
67
67
  commandsGlob() {
68
68
  const commands = this.application.rcFile.commands.reduce((result, commandPath) => {
69
69
  if (/^(.){1,2}\//.test(commandPath)) {
70
- commandPath = slash_1.default(path_1.relative(this.appRoot, path_1.join(this.appRoot, commandPath)));
70
+ commandPath = (0, slash_1.default)((0, path_1.relative)(this.appRoot, (0, path_1.join)(this.appRoot, commandPath)));
71
71
  result = result.concat([`${commandPath}.*`, `${commandPath}/**/*`]);
72
72
  }
73
73
  return result;
@@ -94,7 +94,7 @@ class RcFile {
94
94
  * Reloads the rcfile.json
95
95
  */
96
96
  getDiskContents() {
97
- return fs_extra_1.readJSONSync(this.rcFilePath);
97
+ return (0, fs_extra_1.readJSONSync)(this.rcFilePath);
98
98
  }
99
99
  /**
100
100
  * Returns metadata for a given file path. The metadata can
@@ -24,7 +24,7 @@ class Ts {
24
24
  /**
25
25
  * Reference to the typescript compiler
26
26
  */
27
- this.tsCompiler = new chokidar_ts_1.TypescriptCompiler(this.appRoot, this.tsconfig, require(helpers_1.resolveFrom(this.appRoot, 'typescript/lib/typescript')));
27
+ this.tsCompiler = new chokidar_ts_1.TypescriptCompiler(this.appRoot, this.tsconfig, require((0, helpers_1.resolveFrom)(this.appRoot, 'typescript/lib/typescript')));
28
28
  }
29
29
  /**
30
30
  * Render ts diagnostics
@@ -48,7 +48,7 @@ class Ts {
48
48
  return;
49
49
  }
50
50
  config.options.rootDir = config.options.rootDir || this.appRoot;
51
- config.options.outDir = config.options.outDir || path_1.join(this.appRoot, paths_1.DEFAULT_BUILD_DIR);
51
+ config.options.outDir = config.options.outDir || (0, path_1.join)(this.appRoot, paths_1.DEFAULT_BUILD_DIR);
52
52
  return config;
53
53
  }
54
54
  }
@@ -14,7 +14,7 @@ const require_ts_1 = require("@adonisjs/require-ts");
14
14
  * for AdonisJS applications
15
15
  */
16
16
  function registerForAdonis(appRoot) {
17
- return require_ts_1.register(appRoot, {
17
+ return (0, require_ts_1.register)(appRoot, {
18
18
  cache: true,
19
19
  transformers: {
20
20
  after: [
@@ -16,6 +16,6 @@ const ioc_transformer_1 = require("@adonisjs/ioc-transformer");
16
16
  * statements
17
17
  */
18
18
  function default_1(ts, appRoot) {
19
- return ioc_transformer_1.iocTransformer(ts, application_1.rcParser.parse(require(path_1.join(appRoot, '.adonisrc.json'))));
19
+ return (0, ioc_transformer_1.iocTransformer)(ts, application_1.rcParser.parse(require((0, path_1.join)(appRoot, '.adonisrc.json'))));
20
20
  }
21
21
  exports.default = default_1;
@@ -1,7 +1,6 @@
1
1
  import { BaseCommand } from '@adonisjs/core/build/standalone'
2
2
 
3
3
  export default class {{ filename }} extends BaseCommand {
4
-
5
4
  /**
6
5
  * Command name is used to run the command
7
6
  */
@@ -26,7 +25,7 @@ export default class {{ filename }} extends BaseCommand {
26
25
  stayAlive: false,
27
26
  }
28
27
 
29
- public async run () {
28
+ public async run() {
30
29
  this.logger.info('Hello world!')
31
30
  }
32
31
  }
@@ -1,4 +1,3 @@
1
1
  // import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
2
2
 
3
- export default class {{ filename }} {
4
- }
3
+ export default class {{ filename }} {}
@@ -1,4 +1,3 @@
1
1
  import { EventsList } from '@ioc:Adonis/Core/Event'
2
2
 
3
- export default class {{ filename }} {
4
- }
3
+ export default class {{ filename }} {}
@@ -12,5 +12,4 @@ import { Exception } from '@adonisjs/core/build/standalone'
12
12
  | new {{ filename }}('message', 500, 'E_RUNTIME_EXCEPTION')
13
13
  |
14
14
  */
15
- export default class {{ filename }} extends Exception {
16
- }
15
+ export default class {{ filename }} extends Exception {}
@@ -1,7 +1,7 @@
1
1
  import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
2
2
 
3
3
  export default class {{ filename }} {
4
- public async handle ({}: HttpContextContract, next: () => Promise<void>) {
4
+ public async handle({}: HttpContextContract, next: () => Promise<void>) {
5
5
  // code for middleware goes here. ABOVE THE NEXT CALL
6
6
  await next()
7
7
  }
@@ -20,22 +20,21 @@ import { ApplicationContract } from '@ioc:Adonis/Core/Application'
20
20
  |
21
21
  */
22
22
  export default class {{ filename }} {
23
- constructor (protected app: ApplicationContract) {
24
- }
23
+ constructor(protected app: ApplicationContract) {}
25
24
 
26
- public register () {
25
+ public register() {
27
26
  // Register your own bindings
28
27
  }
29
28
 
30
- public async boot () {
29
+ public async boot() {
31
30
  // All bindings are ready, feel free to use them
32
31
  }
33
32
 
34
- public async ready () {
33
+ public async ready() {
35
34
  // App is ready
36
35
  }
37
36
 
38
- public async shutdown () {
37
+ public async shutdown() {
39
38
  // Cleanup, since app is going down
40
39
  }
41
40
  }
@@ -1,24 +1,17 @@
1
1
  import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
2
2
 
3
3
  export default class {{ filename }} {
4
- public async index ({}: HttpContextContract) {
5
- }
4
+ public async index({}: HttpContextContract) {}
6
5
 
7
- public async create ({}: HttpContextContract) {
8
- }
6
+ public async create({}: HttpContextContract) {}
9
7
 
10
- public async store ({}: HttpContextContract) {
11
- }
8
+ public async store({}: HttpContextContract) {}
12
9
 
13
- public async show ({}: HttpContextContract) {
14
- }
10
+ public async show({}: HttpContextContract) {}
15
11
 
16
- public async edit ({}: HttpContextContract) {
17
- }
12
+ public async edit({}: HttpContextContract) {}
18
13
 
19
- public async update ({}: HttpContextContract) {
20
- }
14
+ public async update({}: HttpContextContract) {}
21
15
 
22
- public async destroy ({}: HttpContextContract) {
23
- }
16
+ public async destroy({}: HttpContextContract) {}
24
17
  }
@@ -26,7 +26,7 @@ export default class {{ filename }} extends Exception {
26
26
  * Giving you a chance to convert the exception to response.
27
27
  *
28
28
  */
29
- public async handle (error: this, ctx: HttpContextContract) {
29
+ public async handle(error: this, ctx: HttpContextContract) {
30
30
  ctx.response.status(error.status || 500).send(error.message)
31
31
  }
32
32
  }
@@ -2,41 +2,39 @@ import { schema } from '@ioc:Adonis/Core/Validator'
2
2
  import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
3
3
 
4
4
  export default class {{ filename }} {
5
- constructor (protected ctx: HttpContextContract) {
6
- }
5
+ constructor(protected ctx: HttpContextContract) {}
7
6
 
8
- /*
9
- * Define schema to validate the "shape", "type", "formatting" and "integrity" of data.
10
- *
11
- * For example:
12
- * 1. The username must be of data type string. But then also, it should
13
- * not contain special characters or numbers.
14
- * ```
15
- * schema.string({}, [ rules.alpha() ])
16
- * ```
17
- *
18
- * 2. The email must be of data type string, formatted as a valid
19
- * email. But also, not used by any other user.
20
- * ```
21
- * schema.string({}, [
22
- * rules.email(),
23
- * rules.unique({ table: 'users', column: 'email' }),
24
- * ])
25
- * ```
26
- */
27
- public schema = schema.create({
28
- })
7
+ /*
8
+ * Define schema to validate the "shape", "type", "formatting" and "integrity" of data.
9
+ *
10
+ * For example:
11
+ * 1. The username must be of data type string. But then also, it should
12
+ * not contain special characters or numbers.
13
+ * ```
14
+ * schema.string({}, [ rules.alpha() ])
15
+ * ```
16
+ *
17
+ * 2. The email must be of data type string, formatted as a valid
18
+ * email. But also, not used by any other user.
19
+ * ```
20
+ * schema.string({}, [
21
+ * rules.email(),
22
+ * rules.unique({ table: 'users', column: 'email' }),
23
+ * ])
24
+ * ```
25
+ */
26
+ public schema = schema.create({})
29
27
 
30
- /**
31
- * Custom messages for validation failures. You can make use of dot notation `(.)`
32
- * for targeting nested fields and array expressions `(*)` for targeting all
33
- * children of an array. For example:
34
- *
35
- * {
36
- * 'profile.username.required': 'Username is required',
37
- * 'scores.*.number': 'Define scores as valid numbers'
38
- * }
39
- *
40
- */
28
+ /**
29
+ * Custom messages for validation failures. You can make use of dot notation `(.)`
30
+ * for targeting nested fields and array expressions `(*)` for targeting all
31
+ * children of an array. For example:
32
+ *
33
+ * {
34
+ * 'profile.username.required': 'Username is required',
35
+ * 'scores.*.number': 'Define scores as valid numbers'
36
+ * }
37
+ *
38
+ */
41
39
  public messages = {}
42
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adonisjs/assembler",
3
- "version": "5.3.4",
3
+ "version": "5.3.8",
4
4
  "description": "Core commands to compiler and build AdonisJs project",
5
5
  "main": "build/ace-manifest.json",
6
6
  "files": [
@@ -43,25 +43,25 @@
43
43
  },
44
44
  "homepage": "https://github.com/adonisjs/assembler#readme",
45
45
  "devDependencies": {
46
- "@adonisjs/ace": "^11.0.2",
47
- "@adonisjs/core": "^5.1.9",
48
- "@adonisjs/mrm-preset": "^4.1.0",
49
- "@poppinss/dev-utils": "^1.1.4",
50
- "@types/node": "^16.3.1",
46
+ "@adonisjs/ace": "^11.0.5",
47
+ "@adonisjs/core": "^5.3.2",
48
+ "@adonisjs/mrm-preset": "^4.1.2",
49
+ "@poppinss/dev-utils": "^1.1.5",
50
+ "@types/node": "^16.11.6",
51
51
  "copyfiles": "^2.4.1",
52
52
  "cross-env": "^7.0.3",
53
- "del-cli": "^4.0.0",
54
- "eslint": "^7.30.0",
53
+ "del-cli": "^4.0.1",
54
+ "eslint": "^8.1.0",
55
55
  "eslint-config-prettier": "^8.3.0",
56
- "eslint-plugin-adonis": "^1.3.2",
57
- "eslint-plugin-prettier": "^3.4.0",
58
- "github-label-sync": "^2.0.1",
59
- "husky": "^7.0.1",
60
- "japa": "^3.1.1",
61
- "mrm": "^3.0.2",
56
+ "eslint-plugin-adonis": "^2.0.0",
57
+ "eslint-plugin-prettier": "^4.0.0",
58
+ "github-label-sync": "^2.0.2",
59
+ "husky": "^7.0.4",
60
+ "japa": "^4.0.0",
61
+ "mrm": "^3.0.10",
62
62
  "np": "^7.5.0",
63
- "prettier": "^2.3.2",
64
- "typescript": "^4.3.5"
63
+ "prettier": "^2.4.1",
64
+ "typescript": "^4.4.4"
65
65
  },
66
66
  "nyc": {
67
67
  "exclude": [
@@ -86,16 +86,16 @@
86
86
  "anyBranch": false
87
87
  },
88
88
  "dependencies": {
89
- "@adonisjs/application": "^5.1.4",
90
- "@adonisjs/env": "^3.0.4",
91
- "@adonisjs/ioc-transformer": "^2.3.0",
92
- "@adonisjs/require-ts": "^2.0.6",
93
- "@adonisjs/sink": "^5.1.5",
94
- "@poppinss/chokidar-ts": "^3.3.0",
95
- "@poppinss/cliui": "^2.2.4",
96
- "@poppinss/utils": "^3.1.3",
89
+ "@adonisjs/application": "^5.1.6",
90
+ "@adonisjs/env": "^3.0.5",
91
+ "@adonisjs/ioc-transformer": "^2.3.2",
92
+ "@adonisjs/require-ts": "^2.0.8",
93
+ "@adonisjs/sink": "^5.1.6",
94
+ "@poppinss/chokidar-ts": "^3.3.2",
95
+ "@poppinss/cliui": "^2.2.5",
96
+ "@poppinss/utils": "^3.3.1",
97
97
  "cpy": "^8.1.2",
98
- "emittery": "^0.9.2",
98
+ "emittery": "^0.10.0",
99
99
  "execa": "^5.1.1",
100
100
  "fs-extra": "^10.0.0",
101
101
  "get-port": "^5.1.1",