feat: update to vite.js, Refactor configuration files, remove unused assets, and clean up commented code:
All checks were successful
CI / container-job (push) Successful in 43s
All checks were successful
CI / container-job (push) Successful in 43s
- ace.js: use ts-node-maintained - adonisrc.ts: load vite_provider, sett assetBundler to false, addd hooks property - Dockerfile: change to node version 22 - package.json: remove babel depencies; add @swc/wasm, add vitejs/plugin-vue, add hot-hook, add vite, update eslint-config-prettier, tailwindcss, ts-node-maintained - new vite.config.js and config/vite.ts - inertia.js - improved own vinejs_provider.ts - adapted app.css needed for vitejs - adapted app.ts: new resolve method neede for vitejs relocated resources/js/logo.svg - remove Buffer import into FileUpload.vue - Create.vue: improved submit needed for @inertiajs/vue3 form helper - Edit.vue: mproved submit needed for @inertiajs/vue3 form helper - kernel.ts: load vite_middleware - formated rotes.ts file - rewritten allowed_extensions_mimetypes.ts file (removed typescript errors)
This commit is contained in:
parent
8d47a58d29
commit
4c5a8f5a42
40 changed files with 1647 additions and 4926 deletions
|
@ -4,7 +4,7 @@
|
|||
|--------------------------------------------------------------------------
|
||||
|*/
|
||||
import type { ApplicationService } from '@adonisjs/core/types';
|
||||
import vine, { BaseLiteralType, Vine } from '@vinejs/vine';
|
||||
import vine, { symbols, BaseLiteralType, Vine } from '@vinejs/vine';
|
||||
import type { FieldContext, FieldOptions } from '@vinejs/vine/types';
|
||||
// import type { MultipartFile, FileValidationOptions } from '@adonisjs/bodyparser/types';
|
||||
import type { MultipartFile } from '@adonisjs/core/bodyparser';
|
||||
|
@ -12,6 +12,7 @@ import type { FileValidationOptions } from '@adonisjs/core/types/bodyparser';
|
|||
import { Request, RequestValidator } from '@adonisjs/core/http';
|
||||
import MimeType from '#models/mime_type';
|
||||
|
||||
|
||||
/**
|
||||
* Validation options accepted by the "file" rule
|
||||
*/
|
||||
|
@ -101,7 +102,20 @@ const isMultipartFile = vine.createRule(async (file: MultipartFile | unknown, op
|
|||
});
|
||||
});
|
||||
|
||||
const MULTIPART_FILE: typeof symbols.SUBTYPE = symbols.SUBTYPE;
|
||||
|
||||
export class VineMultipartFile extends BaseLiteralType<MultipartFile, MultipartFile, MultipartFile> {
|
||||
|
||||
[MULTIPART_FILE]: string;
|
||||
// constructor(validationOptions?: FileRuleValidationOptions, options?: FieldOptions) {
|
||||
// super(options, [isMultipartFile(validationOptions || {})]);
|
||||
// this.validationOptions = validationOptions;
|
||||
// this.#private = true;
|
||||
// }
|
||||
|
||||
// clone(): this {
|
||||
// return new VineMultipartFile(this.validationOptions, this.cloneOptions()) as this;
|
||||
// }
|
||||
// #private;
|
||||
// constructor(validationOptions?: FileRuleValidationOptions, options?: FieldOptions, validations?: Validation<any>[]);
|
||||
// clone(): this;
|
||||
|
@ -153,7 +167,10 @@ export default class VinejsProvider {
|
|||
* The validate method can be used to validate the request
|
||||
* data for the current request using VineJS validators
|
||||
*/
|
||||
Request.macro('validateUsing', function (...args) {
|
||||
Request.macro('validateUsing', function (this: Request, ...args) {
|
||||
if (!this.ctx) {
|
||||
throw new Error('HttpContext is not available');
|
||||
}
|
||||
return new RequestValidator(this.ctx).validateUsing(...args);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue