@adonisjs/core 6.1.5-0 → 6.1.5-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.
@@ -1 +1 @@
1
- {"commands":[{"commandName":"build","description":"Build application for production by compiling frontend assets and TypeScript source to JavaScript","help":"","namespace":null,"aliases":[],"flags":[{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and restart the HTTP server on file change"},{"name":"ignoreTsErrors","flagName":"ignore-ts-errors","required":false,"type":"boolean","description":"Ignore TypeScript errors and continue with the build process"},{"name":"packageManager","flagName":"package-manager","required":false,"type":"string","description":"Select the package manager you want to use to install production dependencies"},{"name":"assets","flagName":"assets","required":false,"type":"boolean","description":"Build frontend assets","showNegatedVariantInHelp":true,"default":true}],"args":[],"options":{},"filePath":"build.js"},{"commandName":"configure","description":"Configure a package post installation","help":"","namespace":null,"aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Package name","type":"string"}],"options":{},"filePath":"configure.js"},{"commandName":"eject","description":"Eject scaffolding stubs to your application root","help":"","namespace":null,"aliases":[],"flags":[{"name":"pkg","flagName":"pkg","required":false,"type":"string","description":"Mention package name for searching stubs","default":"@adonisjs/core"}],"args":[{"name":"stubPath","argumentName":"stub-path","required":true,"description":"Path to the stubs directory or a single stub file","type":"string"}],"options":{},"filePath":"eject.js"},{"commandName":"generate:key","description":"Generate a secure random application key","help":"","namespace":"generate","aliases":[],"flags":[{"name":"show","flagName":"show","required":false,"type":"boolean","description":"Display the key on the terminal, instead of writing it to .env file"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Force update .env file in production environment"}],"args":[],"options":{},"filePath":"generate_key.js"},{"commandName":"make:command","description":"Create a new ace command class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the command","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/command.js"},{"commandName":"make:controller","description":"Create a new HTTP controller class","help":"","namespace":"make","aliases":[],"flags":[{"name":"singular","flagName":"singular","required":false,"type":"boolean","description":"Convert controller class and file name to its singular form","alias":"r"},{"name":"resource","flagName":"resource","required":false,"type":"boolean","description":"Generate controller with resource actions","alias":"r"},{"name":"api","flagName":"api","required":false,"type":"boolean","description":"Generate controller with api resource actions","alias":"a"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"The name of the controller","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/controller.js"},{"commandName":"make:event","description":"Create a new event class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the event","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/event.js"},{"commandName":"make:listener","description":"Create a new event listener class","help":"","namespace":"make","aliases":[],"flags":[{"name":"event","flagName":"event","required":false,"type":"string","description":"Generate an event class alongside the listener","alias":"e"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the listener","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/listener.js"},{"commandName":"make:middleware","description":"Create a new middleware class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the middleware","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/middleware.js"},{"commandName":"make:provider","description":"Create a new service provider class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the provider","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/provider.js"},{"commandName":"serve","description":"Start the development HTTP server along with the file watcher to perform restarts on file change","help":"","namespace":null,"aliases":[],"flags":[{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and restart the HTTP server on file change"},{"name":"poll","flagName":"poll","required":false,"type":"boolean","description":"Use polling to detect filesystem changes"},{"name":"clear","flagName":"clear","required":false,"type":"boolean","description":"Clear the terminal for new logs after file change","showNegatedVariantInHelp":true,"default":true},{"name":"assets","flagName":"assets","required":false,"type":"boolean","description":"Start assets bundler dev server","showNegatedVariantInHelp":true,"default":true}],"args":[],"options":{"staysAlive":true},"filePath":"serve.js"}],"version":1}
1
+ {"commands":[{"commandName":"build","description":"Build application for production by compiling frontend assets and TypeScript source to JavaScript","help":"","namespace":null,"aliases":[],"flags":[{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and restart the HTTP server on file change"},{"name":"ignoreTsErrors","flagName":"ignore-ts-errors","required":false,"type":"boolean","description":"Ignore TypeScript errors and continue with the build process"},{"name":"packageManager","flagName":"package-manager","required":false,"type":"string","description":"Select the package manager you want to use to install production dependencies"},{"name":"assets","flagName":"assets","required":false,"type":"boolean","description":"Build frontend assets","showNegatedVariantInHelp":true,"default":true}],"args":[],"options":{},"filePath":"build.js"},{"commandName":"configure","description":"Configure a package post installation","help":"","namespace":null,"aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Package name","type":"string"}],"options":{},"filePath":"configure.js"},{"commandName":"eject","description":"Eject scaffolding stubs to your application root","help":"","namespace":null,"aliases":[],"flags":[{"name":"pkg","flagName":"pkg","required":false,"type":"string","description":"Mention package name for searching stubs","default":"@adonisjs/core"}],"args":[{"name":"stubPath","argumentName":"stub-path","required":true,"description":"Path to the stubs directory or a single stub file","type":"string"}],"options":{},"filePath":"eject.js"},{"commandName":"generate:key","description":"Generate a secure random application key","help":"","namespace":"generate","aliases":[],"flags":[{"name":"show","flagName":"show","required":false,"type":"boolean","description":"Display the key on the terminal, instead of writing it to .env file"},{"name":"force","flagName":"force","required":false,"type":"boolean","description":"Force update .env file in production environment"}],"args":[],"options":{},"filePath":"generate_key.js"},{"commandName":"make:command","description":"Create a new ace command class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the command","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/command.js"},{"commandName":"make:controller","description":"Create a new HTTP controller class","help":"","namespace":"make","aliases":[],"flags":[{"name":"singular","flagName":"singular","required":false,"type":"boolean","description":"Convert controller class and file name to its singular form","alias":"r"},{"name":"resource","flagName":"resource","required":false,"type":"boolean","description":"Generate controller with resource actions","alias":"r"},{"name":"api","flagName":"api","required":false,"type":"boolean","description":"Generate controller with api resource actions","alias":"a"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"The name of the controller","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/controller.js"},{"commandName":"make:event","description":"Create a new event class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the event","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/event.js"},{"commandName":"make:listener","description":"Create a new event listener class","help":"","namespace":"make","aliases":[],"flags":[{"name":"event","flagName":"event","required":false,"type":"string","description":"Generate an event class alongside the listener","alias":"e"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the listener","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/listener.js"},{"commandName":"make:middleware","description":"Create a new middleware class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the middleware","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/middleware.js"},{"commandName":"make:provider","description":"Create a new service provider class","help":"","namespace":"make","aliases":[],"flags":[],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the provider","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/provider.js"},{"commandName":"make:test","description":"Create a new Japa test file","help":"","namespace":"make","aliases":[],"flags":[{"name":"suite","flagName":"suite","required":false,"type":"string","description":"The suite for which to create the test file"}],"args":[{"name":"name","argumentName":"name","required":true,"description":"Name of the test file","type":"string"}],"options":{"allowUnknownFlags":true},"filePath":"make/test.js"},{"commandName":"serve","description":"Start the development HTTP server along with the file watcher to perform restarts on file change","help":"","namespace":null,"aliases":[],"flags":[{"name":"watch","flagName":"watch","required":false,"type":"boolean","description":"Watch filesystem and restart the HTTP server on file change"},{"name":"poll","flagName":"poll","required":false,"type":"boolean","description":"Use polling to detect filesystem changes"},{"name":"clear","flagName":"clear","required":false,"type":"boolean","description":"Clear the terminal for new logs after file change","showNegatedVariantInHelp":true,"default":true},{"name":"assets","flagName":"assets","required":false,"type":"boolean","description":"Start assets bundler dev server","showNegatedVariantInHelp":true,"default":true}],"args":[],"options":{"staysAlive":true},"filePath":"serve.js"}],"version":1}
@@ -0,0 +1,10 @@
1
+ import BaseCommand from './_base.js';
2
+ export default class MakeTest extends BaseCommand {
3
+ #private;
4
+ static commandName: string;
5
+ static description: string;
6
+ name: string;
7
+ suite?: string;
8
+ protected stubPath: string;
9
+ run(): Promise<void>;
10
+ }
@@ -0,0 +1,69 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import BaseCommand from './_base.js';
11
+ import { args, flags } from '../../modules/ace/main.js';
12
+ export default class MakeTest extends BaseCommand {
13
+ static commandName = 'make:test';
14
+ static description = 'Create a new Japa test file';
15
+ stubPath = 'make/test/main.stub';
16
+ async #getSuite() {
17
+ if (this.suite) {
18
+ return this.suite;
19
+ }
20
+ const rcFileSuites = this.app.rcFile.tests.suites;
21
+ if (rcFileSuites.length === 1) {
22
+ return rcFileSuites[0].name;
23
+ }
24
+ return this.prompt.choice('Select the suite for the test file', this.app.rcFile.tests.suites.map((suite) => {
25
+ return suite.name;
26
+ }), {
27
+ validate(choice) {
28
+ return choice ? true : 'Please select a suite';
29
+ },
30
+ });
31
+ }
32
+ async #getSuiteDirectory(directories) {
33
+ if (directories.length === 1) {
34
+ return directories[0];
35
+ }
36
+ return this.prompt.choice('Select directory for the test file', directories, {
37
+ validate(choice) {
38
+ return choice ? true : 'Please select a directory';
39
+ },
40
+ });
41
+ }
42
+ #findSuite(suiteName) {
43
+ return this.app.rcFile.tests.suites.find((suite) => {
44
+ return suite.name === suiteName;
45
+ });
46
+ }
47
+ async run() {
48
+ const suite = this.#findSuite(await this.#getSuite());
49
+ if (!suite) {
50
+ this.logger.error(`The "${this.suite}" suite is not configured inside the .adonisrc.json file`);
51
+ this.exitCode = 1;
52
+ return;
53
+ }
54
+ await this.generate(this.stubPath, {
55
+ entity: this.app.generators.createEntity(this.name),
56
+ suite: {
57
+ directory: await this.#getSuiteDirectory(suite.directories),
58
+ },
59
+ });
60
+ }
61
+ }
62
+ __decorate([
63
+ args.string({ description: 'Name of the test file' }),
64
+ __metadata("design:type", String)
65
+ ], MakeTest.prototype, "name", void 0);
66
+ __decorate([
67
+ flags.string({ description: 'The suite for which to create the test file' }),
68
+ __metadata("design:type", String)
69
+ ], MakeTest.prototype, "suite", void 0);
@@ -1,2 +1,2 @@
1
- export { default as cuid } from 'cuid';
1
+ export { createId as cuid } from '@paralleldrive/cuid2';
2
2
  export { safeEqual, compose, base64, fsImportAll, fsReadAll, slash } from '@poppinss/utils';
@@ -1,2 +1,2 @@
1
- export { default as cuid } from 'cuid';
1
+ export { createId as cuid } from '@paralleldrive/cuid2';
2
2
  export { safeEqual, compose, base64, fsImportAll, fsReadAll, slash } from '@poppinss/utils';
@@ -0,0 +1,11 @@
1
+ {{#var testGroupName = generators.testGroupName(entity)}}
2
+ {{#var testFileName = generators.testFileName(entity.name)}}
3
+ ---
4
+ to: {{ app.makePath(suite.directory, entity.path, testFileName) }}
5
+ ---
6
+ import { test } from '@japa/runner'
7
+
8
+ test.group('{{ testGroupName }}', () => {
9
+ test('example test', async ({ assert }) => {
10
+ })
11
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adonisjs/core",
3
- "version": "6.1.5-0",
3
+ "version": "6.1.5-1",
4
4
  "description": "Core of AdonisJS",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
@@ -113,9 +113,9 @@
113
113
  "@japa/run-failed-tests": "^1.1.1",
114
114
  "@japa/runner": "^2.5.0",
115
115
  "@japa/spec-reporter": "^1.3.3",
116
- "@swc/core": "^1.3.37",
116
+ "@swc/core": "^1.3.38",
117
117
  "@types/fs-extra": "^11.0.1",
118
- "@types/node": "^18.14.6",
118
+ "@types/node": "^18.15.0",
119
119
  "@types/pretty-hrtime": "^1.0.1",
120
120
  "@types/sinon": "^10.0.13",
121
121
  "@types/supertest": "^2.0.12",
@@ -125,11 +125,11 @@
125
125
  "cross-env": "^7.0.3",
126
126
  "del-cli": "^5.0.0",
127
127
  "eslint": "^8.35.0",
128
- "eslint-config-prettier": "^8.6.0",
128
+ "eslint-config-prettier": "^8.7.0",
129
129
  "eslint-plugin-adonis": "^3.0.3",
130
130
  "eslint-plugin-prettier": "^4.2.1",
131
131
  "get-port": "^6.1.2",
132
- "github-label-sync": "^2.2.0",
132
+ "github-label-sync": "^2.3.1",
133
133
  "husky": "^8.0.3",
134
134
  "np": "^7.6.3",
135
135
  "prettier": "^2.8.4",
@@ -141,8 +141,8 @@
141
141
  "typescript": "^4.9.5"
142
142
  },
143
143
  "dependencies": {
144
- "@adonisjs/ace": "^12.3.1-0",
145
- "@adonisjs/application": "^7.1.2-0",
144
+ "@adonisjs/ace": "^12.3.1-1",
145
+ "@adonisjs/application": "^7.1.2-1",
146
146
  "@adonisjs/bodyparser": "^9.3.2-0",
147
147
  "@adonisjs/config": "^4.2.1-0",
148
148
  "@adonisjs/encryption": "^5.1.2-0",
@@ -153,11 +153,11 @@
153
153
  "@adonisjs/http-server": "^6.8.2-0",
154
154
  "@adonisjs/logger": "^5.4.2-0",
155
155
  "@adonisjs/validator": "^13.0.2-0",
156
+ "@paralleldrive/cuid2": "^2.2.0",
156
157
  "@poppinss/macroable": "^1.0.0-2",
157
158
  "@poppinss/utils": "^6.5.0-0",
158
159
  "@sindresorhus/is": "^5.3.0",
159
160
  "@types/he": "^1.2.0",
160
- "cuid": "^3.0.0",
161
161
  "execa": "^7.0.0",
162
162
  "fs-extra": "^11.1.0",
163
163
  "he": "^1.2.0",