@adonisjs/core 6.1.5-19 → 6.1.5-20

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,3 +1,4 @@
1
+ import '../src/bindings/edge/types.js';
1
2
  import type { ApplicationService } from '../src/types.js';
2
3
  export default class EdgeServiceProvider {
3
4
  protected app: ApplicationService;
@@ -6,7 +6,8 @@
6
6
  * For the full copyright and license information, please view the LICENSE
7
7
  * file that was distributed with this source code.
8
8
  */
9
- import { bridgeEdgeAdonisJS } from '../src/bindings/edge.js';
9
+ import '../src/bindings/edge/types.js';
10
+ import { bridgeEdgeAdonisJS } from '../src/bindings/edge/main.js';
10
11
  export default class EdgeServiceProvider {
11
12
  app;
12
13
  constructor(app) {
@@ -1,4 +1,5 @@
1
- import '../src/bindings/vinejs.js';
1
+ import '../src/bindings/vinejs/main.js';
2
+ import '../src/bindings/vinejs/types.js';
2
3
  import '../modules/http/request_validator.js';
3
4
  export default class VineJSServiceProvider {
4
5
  }
@@ -6,7 +6,8 @@
6
6
  * For the full copyright and license information, please view the LICENSE
7
7
  * file that was distributed with this source code.
8
8
  */
9
- import '../src/bindings/vinejs.js';
9
+ import '../src/bindings/vinejs/main.js';
10
+ import '../src/bindings/vinejs/types.js';
10
11
  import '../modules/http/request_validator.js';
11
12
  export default class VineJSServiceProvider {
12
13
  }
@@ -0,0 +1,7 @@
1
+ import './types.js';
2
+ import type { ApplicationService } from '../../types.js';
3
+ import { type Router } from '../../../modules/http/main.js';
4
+ /**
5
+ * Bridges AdonisJS with Edge
6
+ */
7
+ export declare function bridgeEdgeAdonisJS(app: ApplicationService, router: Router): void;
@@ -7,7 +7,8 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
  import edge from 'edge.js';
10
- import { HttpContext, BriskRoute } from '../../modules/http/main.js';
10
+ import './types.js';
11
+ import { HttpContext, BriskRoute } from '../../../modules/http/main.js';
11
12
  /**
12
13
  * Bridges AdonisJS with Edge
13
14
  */
@@ -41,7 +42,9 @@ export function bridgeEdgeAdonisJS(app, router) {
41
42
  * Creating a isolated instance of edge renderer
42
43
  */
43
44
  HttpContext.getter('view', function () {
44
- return edge.createRenderer();
45
+ return edge.createRenderer().share({
46
+ request: this.request,
47
+ });
45
48
  });
46
49
  /**
47
50
  * Adding brisk route to render templates without an
@@ -1,6 +1,5 @@
1
1
  import { type Edge } from 'edge.js';
2
- import type { ApplicationService } from '../types.js';
3
- import { Route, type Router } from '../../modules/http/main.js';
2
+ import type { Route } from '../../../modules/http/main.js';
4
3
  declare module '@adonisjs/http-server' {
5
4
  interface HttpContext {
6
5
  /**
@@ -17,7 +16,3 @@ declare module '@adonisjs/http-server' {
17
16
  render(template: string, data?: Record<string, any>): Route;
18
17
  }
19
18
  }
20
- /**
21
- * Bridges AdonisJS with Edge
22
- */
23
- export declare function bridgeEdgeAdonisJS(app: ApplicationService, router: Router): void;
@@ -0,0 +1,9 @@
1
+ /*
2
+ * @adonisjs/core
3
+ *
4
+ * (c) AdonisJS
5
+ *
6
+ * For the full copyright and license information, please view the LICENSE
7
+ * file that was distributed with this source code.
8
+ */
9
+ export {};
@@ -0,0 +1,13 @@
1
+ import { BaseLiteralType } from '@vinejs/vine';
2
+ import type { MultipartFile } from '@adonisjs/bodyparser/types';
3
+ import type { FieldOptions, Validation } from '@vinejs/vine/types';
4
+ import type { ValidationOptions } from './types.js';
5
+ /**
6
+ * Represents a multipart file uploaded via multipart/form-data HTTP
7
+ * request.
8
+ */
9
+ export declare class VineMultipartFile extends BaseLiteralType<MultipartFile, MultipartFile> {
10
+ #private;
11
+ constructor(validationOptions?: ValidationOptions, options?: FieldOptions, validations?: Validation<any>[]);
12
+ clone(): this;
13
+ }
@@ -57,7 +57,7 @@ const isMultipartFile = vine.createRule((file, options, field) => {
57
57
  * Represents a multipart file uploaded via multipart/form-data HTTP
58
58
  * request.
59
59
  */
60
- class VineMultipartFile extends BaseLiteralType {
60
+ export class VineMultipartFile extends BaseLiteralType {
61
61
  #validationOptions;
62
62
  constructor(validationOptions, options, validations) {
63
63
  super(options, validations || [isMultipartFile(validationOptions || {})]);
@@ -0,0 +1,12 @@
1
+ import type { FieldContext } from '@vinejs/vine/types';
2
+ import type { FileValidationOptions } from '@adonisjs/bodyparser/types';
3
+ import type { VineMultipartFile } from './main.js';
4
+ export type ValidationOptions = Partial<FileValidationOptions> | ((field: FieldContext) => Partial<FileValidationOptions>);
5
+ /**
6
+ * Notifying TypeScript
7
+ */
8
+ declare module '@vinejs/vine' {
9
+ interface Vine {
10
+ file(options?: ValidationOptions): VineMultipartFile;
11
+ }
12
+ }
@@ -0,0 +1,9 @@
1
+ /*
2
+ * @adonisjs/core
3
+ *
4
+ * (c) AdonisJS
5
+ *
6
+ * For the full copyright and license information, please view the LICENSE
7
+ * file that was distributed with this source code.
8
+ */
9
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adonisjs/core",
3
3
  "description": "Core of AdonisJS",
4
- "version": "6.1.5-19",
4
+ "version": "6.1.5-20",
5
5
  "engines": {
6
6
  "node": ">=18.16.0"
7
7
  },
@@ -1,22 +0,0 @@
1
- import { BaseLiteralType } from '@vinejs/vine';
2
- import type { FieldContext, FieldOptions, Validation } from '@vinejs/vine/types';
3
- import type { MultipartFile, FileValidationOptions } from '@adonisjs/bodyparser/types';
4
- /**
5
- * Notifying TypeScript
6
- */
7
- declare module '@vinejs/vine' {
8
- interface Vine {
9
- file(options?: ValidationOptions): VineMultipartFile;
10
- }
11
- }
12
- type ValidationOptions = Partial<FileValidationOptions> | ((field: FieldContext) => Partial<FileValidationOptions>);
13
- /**
14
- * Represents a multipart file uploaded via multipart/form-data HTTP
15
- * request.
16
- */
17
- declare class VineMultipartFile extends BaseLiteralType<MultipartFile, MultipartFile> {
18
- #private;
19
- constructor(validationOptions?: ValidationOptions, options?: FieldOptions, validations?: Validation<any>[]);
20
- clone(): this;
21
- }
22
- export {};