@adonisjs/assembler 5.9.2 → 5.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/commands/Build.d.ts +37 -37
- package/build/commands/Build.js +138 -138
- package/build/commands/Invoke.d.ts +34 -34
- package/build/commands/Invoke.js +234 -221
- package/build/commands/Make/Base.d.ts +30 -30
- package/build/commands/Make/Base.js +75 -75
- package/build/commands/Make/Command.d.ts +35 -35
- package/build/commands/Make/Command.js +82 -82
- package/build/commands/Make/Controller.d.ts +37 -37
- package/build/commands/Make/Controller.js +89 -89
- package/build/commands/Make/Exception.d.ts +32 -32
- package/build/commands/Make/Exception.js +75 -75
- package/build/commands/Make/Listener.d.ts +30 -30
- package/build/commands/Make/Listener.js +70 -70
- package/build/commands/Make/Middleware.d.ts +31 -31
- package/build/commands/Make/Middleware.js +87 -87
- package/build/commands/Make/PreloadFile.d.ts +38 -38
- package/build/commands/Make/PreloadFile.js +157 -157
- package/build/commands/Make/Provider.d.ts +31 -31
- package/build/commands/Make/Provider.js +114 -114
- package/build/commands/Make/Suite.d.ts +41 -41
- package/build/commands/Make/Suite.js +120 -120
- package/build/commands/Make/Test.d.ts +35 -35
- package/build/commands/Make/Test.js +96 -96
- package/build/commands/Make/Validator.d.ts +31 -31
- package/build/commands/Make/Validator.js +71 -71
- package/build/commands/Make/View.d.ts +30 -30
- package/build/commands/Make/View.js +70 -70
- package/build/commands/Serve.d.ts +33 -33
- package/build/commands/Serve.js +112 -112
- package/build/commands/Test.d.ts +57 -57
- package/build/commands/Test.js +159 -159
- package/build/commands/TypeCheck.d.ts +16 -16
- package/build/commands/TypeCheck.js +85 -85
- package/build/config/paths.d.ts +7 -7
- package/build/config/paths.js +18 -18
- package/build/register.d.ts +1 -1
- package/build/register.js +15 -15
- package/build/src/AssetsBundler/index.d.ts +76 -76
- package/build/src/AssetsBundler/index.js +216 -216
- package/build/src/Compiler/index.d.ts +62 -62
- package/build/src/Compiler/index.js +287 -287
- package/build/src/Contracts/index.d.ts +8 -8
- package/build/src/Contracts/index.js +10 -10
- package/build/src/DevServer/index.d.ts +70 -70
- package/build/src/DevServer/index.js +306 -306
- package/build/src/EnvParser/index.d.ts +21 -23
- package/build/src/EnvParser/index.js +48 -52
- package/build/src/HttpServer/index.d.ts +34 -34
- package/build/src/HttpServer/index.js +87 -87
- package/build/src/Manifest/index.d.ts +32 -32
- package/build/src/Manifest/index.js +88 -88
- package/build/src/RcFile/index.d.ts +72 -72
- package/build/src/RcFile/index.js +174 -174
- package/build/src/Test/index.d.ts +75 -75
- package/build/src/Test/index.js +346 -346
- package/build/src/Test/process.d.ts +22 -22
- package/build/src/Test/process.js +68 -68
- package/build/src/Ts/index.d.ts +24 -24
- package/build/src/Ts/index.js +55 -55
- package/build/src/requireHook/index.d.ts +5 -5
- package/build/src/requireHook/index.js +28 -28
- package/build/src/requireHook/ioc-transformer.d.ts +6 -6
- package/build/src/requireHook/ioc-transformer.js +21 -21
- package/build/templates/tests/bootstrap.txt +4 -4
- package/package.json +11 -11
|
@@ -1,96 +1,96 @@
|
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
21
|
-
};
|
|
22
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
const path_1 = require("path");
|
|
24
|
-
const glob_parent_1 = __importDefault(require("glob-parent"));
|
|
25
|
-
const helpers_1 = require("@poppinss/utils/build/helpers");
|
|
26
|
-
const standalone_1 = require("@adonisjs/core/build/standalone");
|
|
27
|
-
const Base_1 = require("./Base");
|
|
28
|
-
/**
|
|
29
|
-
* Command to make a new test
|
|
30
|
-
*/
|
|
31
|
-
class MakeTest extends Base_1.BaseGenerator {
|
|
32
|
-
constructor() {
|
|
33
|
-
super(...arguments);
|
|
34
|
-
/**
|
|
35
|
-
* Required by BaseGenerator
|
|
36
|
-
*/
|
|
37
|
-
this.extname = '.spec.ts';
|
|
38
|
-
this.form = 'singular';
|
|
39
|
-
this.pattern = 'snakecase';
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Returns the template stub path
|
|
43
|
-
*/
|
|
44
|
-
getStub() {
|
|
45
|
-
return (0, path_1.join)(__dirname, '..', '..', 'templates', 'test.txt');
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* The file is created inside the parent directory of the first
|
|
49
|
-
* glob pattern
|
|
50
|
-
*/
|
|
51
|
-
getDestinationPath() {
|
|
52
|
-
const testSuites = this.application.rcFile.tests.suites;
|
|
53
|
-
const mentionedSuite = testSuites.find(({ name }) => this.suite === name);
|
|
54
|
-
const suiteGlob = Array.isArray(mentionedSuite.files)
|
|
55
|
-
? mentionedSuite.files[0]
|
|
56
|
-
: mentionedSuite.files;
|
|
57
|
-
return (0, glob_parent_1.default)(suiteGlob);
|
|
58
|
-
}
|
|
59
|
-
templateData() {
|
|
60
|
-
return {
|
|
61
|
-
name: helpers_1.string.sentenceCase(this.name),
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
async run() {
|
|
65
|
-
const testSuites = this.application.rcFile.tests.suites;
|
|
66
|
-
const mentionedSuite = testSuites.find(({ name }) => this.suite === name);
|
|
67
|
-
if (!mentionedSuite) {
|
|
68
|
-
this.logger.error(`Invalid suite "${this.suite}". Make sure the suite is registered inside the .adonisrc.json file`);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
this.resourceName = this.name;
|
|
72
|
-
this.createExact = this.exact;
|
|
73
|
-
await super.generate();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Command meta data
|
|
78
|
-
*/
|
|
79
|
-
MakeTest.commandName = 'make:test';
|
|
80
|
-
MakeTest.description = 'Make a new test';
|
|
81
|
-
__decorate([
|
|
82
|
-
standalone_1.args.string({ description: 'Name of the test suite' }),
|
|
83
|
-
__metadata("design:type", String)
|
|
84
|
-
], MakeTest.prototype, "suite", void 0);
|
|
85
|
-
__decorate([
|
|
86
|
-
standalone_1.args.string({ description: 'Name of the test file' }),
|
|
87
|
-
__metadata("design:type", String)
|
|
88
|
-
], MakeTest.prototype, "name", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
standalone_1.flags.boolean({
|
|
91
|
-
description: 'Create the test file with the exact name as provided',
|
|
92
|
-
alias: 'e',
|
|
93
|
-
}),
|
|
94
|
-
__metadata("design:type", Boolean)
|
|
95
|
-
], MakeTest.prototype, "exact", void 0);
|
|
96
|
-
exports.default = MakeTest;
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
const path_1 = require("path");
|
|
24
|
+
const glob_parent_1 = __importDefault(require("glob-parent"));
|
|
25
|
+
const helpers_1 = require("@poppinss/utils/build/helpers");
|
|
26
|
+
const standalone_1 = require("@adonisjs/core/build/standalone");
|
|
27
|
+
const Base_1 = require("./Base");
|
|
28
|
+
/**
|
|
29
|
+
* Command to make a new test
|
|
30
|
+
*/
|
|
31
|
+
class MakeTest extends Base_1.BaseGenerator {
|
|
32
|
+
constructor() {
|
|
33
|
+
super(...arguments);
|
|
34
|
+
/**
|
|
35
|
+
* Required by BaseGenerator
|
|
36
|
+
*/
|
|
37
|
+
this.extname = '.spec.ts';
|
|
38
|
+
this.form = 'singular';
|
|
39
|
+
this.pattern = 'snakecase';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Returns the template stub path
|
|
43
|
+
*/
|
|
44
|
+
getStub() {
|
|
45
|
+
return (0, path_1.join)(__dirname, '..', '..', 'templates', 'test.txt');
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The file is created inside the parent directory of the first
|
|
49
|
+
* glob pattern
|
|
50
|
+
*/
|
|
51
|
+
getDestinationPath() {
|
|
52
|
+
const testSuites = this.application.rcFile.tests.suites;
|
|
53
|
+
const mentionedSuite = testSuites.find(({ name }) => this.suite === name);
|
|
54
|
+
const suiteGlob = Array.isArray(mentionedSuite.files)
|
|
55
|
+
? mentionedSuite.files[0]
|
|
56
|
+
: mentionedSuite.files;
|
|
57
|
+
return (0, glob_parent_1.default)(suiteGlob);
|
|
58
|
+
}
|
|
59
|
+
templateData() {
|
|
60
|
+
return {
|
|
61
|
+
name: helpers_1.string.sentenceCase(this.name),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
async run() {
|
|
65
|
+
const testSuites = this.application.rcFile.tests.suites;
|
|
66
|
+
const mentionedSuite = testSuites.find(({ name }) => this.suite === name);
|
|
67
|
+
if (!mentionedSuite) {
|
|
68
|
+
this.logger.error(`Invalid suite "${this.suite}". Make sure the suite is registered inside the .adonisrc.json file`);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.resourceName = this.name;
|
|
72
|
+
this.createExact = this.exact;
|
|
73
|
+
await super.generate();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Command meta data
|
|
78
|
+
*/
|
|
79
|
+
MakeTest.commandName = 'make:test';
|
|
80
|
+
MakeTest.description = 'Make a new test';
|
|
81
|
+
__decorate([
|
|
82
|
+
standalone_1.args.string({ description: 'Name of the test suite' }),
|
|
83
|
+
__metadata("design:type", String)
|
|
84
|
+
], MakeTest.prototype, "suite", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
standalone_1.args.string({ description: 'Name of the test file' }),
|
|
87
|
+
__metadata("design:type", String)
|
|
88
|
+
], MakeTest.prototype, "name", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
standalone_1.flags.boolean({
|
|
91
|
+
description: 'Create the test file with the exact name as provided',
|
|
92
|
+
alias: 'e',
|
|
93
|
+
}),
|
|
94
|
+
__metadata("design:type", Boolean)
|
|
95
|
+
], MakeTest.prototype, "exact", void 0);
|
|
96
|
+
exports.default = MakeTest;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { BaseGenerator } from './Base';
|
|
2
|
-
/**
|
|
3
|
-
* Command to make a new validator
|
|
4
|
-
*/
|
|
5
|
-
export default class MakeValidator extends BaseGenerator {
|
|
6
|
-
/**
|
|
7
|
-
* Required by BaseGenerator
|
|
8
|
-
*/
|
|
9
|
-
protected suffix: string;
|
|
10
|
-
protected form: "singular";
|
|
11
|
-
protected pattern: "pascalcase";
|
|
12
|
-
protected resourceName: string;
|
|
13
|
-
protected createExact: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Command meta data
|
|
16
|
-
*/
|
|
17
|
-
static commandName: string;
|
|
18
|
-
static description: string;
|
|
19
|
-
name: string;
|
|
20
|
-
exact: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Returns the template stub path
|
|
23
|
-
*/
|
|
24
|
-
protected getStub(): string;
|
|
25
|
-
/**
|
|
26
|
-
* Pull path for the `validators` directory declaration from
|
|
27
|
-
* the `.adonisrc.json` file or fallback to `app/Validators`
|
|
28
|
-
*/
|
|
29
|
-
protected getDestinationPath(): string;
|
|
30
|
-
run(): Promise<void>;
|
|
31
|
-
}
|
|
1
|
+
import { BaseGenerator } from './Base';
|
|
2
|
+
/**
|
|
3
|
+
* Command to make a new validator
|
|
4
|
+
*/
|
|
5
|
+
export default class MakeValidator extends BaseGenerator {
|
|
6
|
+
/**
|
|
7
|
+
* Required by BaseGenerator
|
|
8
|
+
*/
|
|
9
|
+
protected suffix: string;
|
|
10
|
+
protected form: "singular";
|
|
11
|
+
protected pattern: "pascalcase";
|
|
12
|
+
protected resourceName: string;
|
|
13
|
+
protected createExact: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Command meta data
|
|
16
|
+
*/
|
|
17
|
+
static commandName: string;
|
|
18
|
+
static description: string;
|
|
19
|
+
name: string;
|
|
20
|
+
exact: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the template stub path
|
|
23
|
+
*/
|
|
24
|
+
protected getStub(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Pull path for the `validators` directory declaration from
|
|
27
|
+
* the `.adonisrc.json` file or fallback to `app/Validators`
|
|
28
|
+
*/
|
|
29
|
+
protected getDestinationPath(): string;
|
|
30
|
+
run(): Promise<void>;
|
|
31
|
+
}
|
|
@@ -1,71 +1,71 @@
|
|
|
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 standalone_1 = require("@adonisjs/core/build/standalone");
|
|
22
|
-
const Base_1 = require("./Base");
|
|
23
|
-
/**
|
|
24
|
-
* Command to make a new validator
|
|
25
|
-
*/
|
|
26
|
-
class MakeValidator extends Base_1.BaseGenerator {
|
|
27
|
-
constructor() {
|
|
28
|
-
super(...arguments);
|
|
29
|
-
/**
|
|
30
|
-
* Required by BaseGenerator
|
|
31
|
-
*/
|
|
32
|
-
this.suffix = 'Validator';
|
|
33
|
-
this.form = 'singular';
|
|
34
|
-
this.pattern = 'pascalcase';
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Returns the template stub path
|
|
38
|
-
*/
|
|
39
|
-
getStub() {
|
|
40
|
-
return (0, path_1.join)(__dirname, '..', '..', 'templates', 'validator.txt');
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Pull path for the `validators` directory declaration from
|
|
44
|
-
* the `.adonisrc.json` file or fallback to `app/Validators`
|
|
45
|
-
*/
|
|
46
|
-
getDestinationPath() {
|
|
47
|
-
return this.getPathForNamespace('validators') || 'app/Validators';
|
|
48
|
-
}
|
|
49
|
-
async run() {
|
|
50
|
-
this.resourceName = this.name;
|
|
51
|
-
this.createExact = this.exact;
|
|
52
|
-
await super.generate();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Command meta data
|
|
57
|
-
*/
|
|
58
|
-
MakeValidator.commandName = 'make:validator';
|
|
59
|
-
MakeValidator.description = 'Make a new validator';
|
|
60
|
-
__decorate([
|
|
61
|
-
standalone_1.args.string({ description: 'Name of the validator class' }),
|
|
62
|
-
__metadata("design:type", String)
|
|
63
|
-
], MakeValidator.prototype, "name", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
standalone_1.flags.boolean({
|
|
66
|
-
description: 'Create the validator with the exact name as provided',
|
|
67
|
-
alias: 'e',
|
|
68
|
-
}),
|
|
69
|
-
__metadata("design:type", Boolean)
|
|
70
|
-
], MakeValidator.prototype, "exact", void 0);
|
|
71
|
-
exports.default = MakeValidator;
|
|
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 standalone_1 = require("@adonisjs/core/build/standalone");
|
|
22
|
+
const Base_1 = require("./Base");
|
|
23
|
+
/**
|
|
24
|
+
* Command to make a new validator
|
|
25
|
+
*/
|
|
26
|
+
class MakeValidator extends Base_1.BaseGenerator {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
/**
|
|
30
|
+
* Required by BaseGenerator
|
|
31
|
+
*/
|
|
32
|
+
this.suffix = 'Validator';
|
|
33
|
+
this.form = 'singular';
|
|
34
|
+
this.pattern = 'pascalcase';
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Returns the template stub path
|
|
38
|
+
*/
|
|
39
|
+
getStub() {
|
|
40
|
+
return (0, path_1.join)(__dirname, '..', '..', 'templates', 'validator.txt');
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Pull path for the `validators` directory declaration from
|
|
44
|
+
* the `.adonisrc.json` file or fallback to `app/Validators`
|
|
45
|
+
*/
|
|
46
|
+
getDestinationPath() {
|
|
47
|
+
return this.getPathForNamespace('validators') || 'app/Validators';
|
|
48
|
+
}
|
|
49
|
+
async run() {
|
|
50
|
+
this.resourceName = this.name;
|
|
51
|
+
this.createExact = this.exact;
|
|
52
|
+
await super.generate();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Command meta data
|
|
57
|
+
*/
|
|
58
|
+
MakeValidator.commandName = 'make:validator';
|
|
59
|
+
MakeValidator.description = 'Make a new validator';
|
|
60
|
+
__decorate([
|
|
61
|
+
standalone_1.args.string({ description: 'Name of the validator class' }),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], MakeValidator.prototype, "name", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
standalone_1.flags.boolean({
|
|
66
|
+
description: 'Create the validator with the exact name as provided',
|
|
67
|
+
alias: 'e',
|
|
68
|
+
}),
|
|
69
|
+
__metadata("design:type", Boolean)
|
|
70
|
+
], MakeValidator.prototype, "exact", void 0);
|
|
71
|
+
exports.default = MakeValidator;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { BaseGenerator } from './Base';
|
|
2
|
-
/**
|
|
3
|
-
* Command to make a new view
|
|
4
|
-
*/
|
|
5
|
-
export default class MakeView extends BaseGenerator {
|
|
6
|
-
/**
|
|
7
|
-
* Required by BaseGenerator
|
|
8
|
-
*/
|
|
9
|
-
protected suffix: string;
|
|
10
|
-
protected extname: string;
|
|
11
|
-
protected pattern: "snakecase";
|
|
12
|
-
protected resourceName: string;
|
|
13
|
-
protected createExact: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Command meta data
|
|
16
|
-
*/
|
|
17
|
-
static commandName: string;
|
|
18
|
-
static description: string;
|
|
19
|
-
name: string;
|
|
20
|
-
exact: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Returns the template stub path
|
|
23
|
-
*/
|
|
24
|
-
protected getStub(): string;
|
|
25
|
-
/**
|
|
26
|
-
* Path to the providers directory
|
|
27
|
-
*/
|
|
28
|
-
protected getDestinationPath(): string;
|
|
29
|
-
run(): Promise<void>;
|
|
30
|
-
}
|
|
1
|
+
import { BaseGenerator } from './Base';
|
|
2
|
+
/**
|
|
3
|
+
* Command to make a new view
|
|
4
|
+
*/
|
|
5
|
+
export default class MakeView extends BaseGenerator {
|
|
6
|
+
/**
|
|
7
|
+
* Required by BaseGenerator
|
|
8
|
+
*/
|
|
9
|
+
protected suffix: string;
|
|
10
|
+
protected extname: string;
|
|
11
|
+
protected pattern: "snakecase";
|
|
12
|
+
protected resourceName: string;
|
|
13
|
+
protected createExact: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Command meta data
|
|
16
|
+
*/
|
|
17
|
+
static commandName: string;
|
|
18
|
+
static description: string;
|
|
19
|
+
name: string;
|
|
20
|
+
exact: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the template stub path
|
|
23
|
+
*/
|
|
24
|
+
protected getStub(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Path to the providers directory
|
|
27
|
+
*/
|
|
28
|
+
protected getDestinationPath(): string;
|
|
29
|
+
run(): Promise<void>;
|
|
30
|
+
}
|
|
@@ -1,70 +1,70 @@
|
|
|
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 standalone_1 = require("@adonisjs/core/build/standalone");
|
|
22
|
-
const Base_1 = require("./Base");
|
|
23
|
-
/**
|
|
24
|
-
* Command to make a new view
|
|
25
|
-
*/
|
|
26
|
-
class MakeView extends Base_1.BaseGenerator {
|
|
27
|
-
constructor() {
|
|
28
|
-
super(...arguments);
|
|
29
|
-
/**
|
|
30
|
-
* Required by BaseGenerator
|
|
31
|
-
*/
|
|
32
|
-
this.suffix = '';
|
|
33
|
-
this.extname = '.edge';
|
|
34
|
-
this.pattern = 'snakecase';
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Returns the template stub path
|
|
38
|
-
*/
|
|
39
|
-
getStub() {
|
|
40
|
-
return (0, path_1.join)(__dirname, '..', '..', 'templates', 'view.txt');
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Path to the providers directory
|
|
44
|
-
*/
|
|
45
|
-
getDestinationPath() {
|
|
46
|
-
return this.application.rcFile.directories.views || 'resources/views';
|
|
47
|
-
}
|
|
48
|
-
async run() {
|
|
49
|
-
this.resourceName = this.name;
|
|
50
|
-
this.createExact = this.exact;
|
|
51
|
-
await super.generate();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Command meta data
|
|
56
|
-
*/
|
|
57
|
-
MakeView.commandName = 'make:view';
|
|
58
|
-
MakeView.description = 'Make a new view template';
|
|
59
|
-
__decorate([
|
|
60
|
-
standalone_1.args.string({ description: 'Name of the view' }),
|
|
61
|
-
__metadata("design:type", String)
|
|
62
|
-
], MakeView.prototype, "name", void 0);
|
|
63
|
-
__decorate([
|
|
64
|
-
standalone_1.flags.boolean({
|
|
65
|
-
description: 'Create the template file with the exact name as provided',
|
|
66
|
-
alias: 'e',
|
|
67
|
-
}),
|
|
68
|
-
__metadata("design:type", Boolean)
|
|
69
|
-
], MakeView.prototype, "exact", void 0);
|
|
70
|
-
exports.default = MakeView;
|
|
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 standalone_1 = require("@adonisjs/core/build/standalone");
|
|
22
|
+
const Base_1 = require("./Base");
|
|
23
|
+
/**
|
|
24
|
+
* Command to make a new view
|
|
25
|
+
*/
|
|
26
|
+
class MakeView extends Base_1.BaseGenerator {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
/**
|
|
30
|
+
* Required by BaseGenerator
|
|
31
|
+
*/
|
|
32
|
+
this.suffix = '';
|
|
33
|
+
this.extname = '.edge';
|
|
34
|
+
this.pattern = 'snakecase';
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Returns the template stub path
|
|
38
|
+
*/
|
|
39
|
+
getStub() {
|
|
40
|
+
return (0, path_1.join)(__dirname, '..', '..', 'templates', 'view.txt');
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Path to the providers directory
|
|
44
|
+
*/
|
|
45
|
+
getDestinationPath() {
|
|
46
|
+
return this.application.rcFile.directories.views || 'resources/views';
|
|
47
|
+
}
|
|
48
|
+
async run() {
|
|
49
|
+
this.resourceName = this.name;
|
|
50
|
+
this.createExact = this.exact;
|
|
51
|
+
await super.generate();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Command meta data
|
|
56
|
+
*/
|
|
57
|
+
MakeView.commandName = 'make:view';
|
|
58
|
+
MakeView.description = 'Make a new view template';
|
|
59
|
+
__decorate([
|
|
60
|
+
standalone_1.args.string({ description: 'Name of the view' }),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], MakeView.prototype, "name", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
standalone_1.flags.boolean({
|
|
65
|
+
description: 'Create the template file with the exact name as provided',
|
|
66
|
+
alias: 'e',
|
|
67
|
+
}),
|
|
68
|
+
__metadata("design:type", Boolean)
|
|
69
|
+
], MakeView.prototype, "exact", void 0);
|
|
70
|
+
exports.default = MakeView;
|