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)
76 lines
2 KiB
TypeScript
76 lines
2 KiB
TypeScript
import { defineConfig } from '@adonisjs/inertia';
|
|
import type { HttpContext } from '@adonisjs/core/http';
|
|
import type { InferSharedProps } from '@adonisjs/inertia/types'
|
|
|
|
const inertiaConfig = defineConfig({
|
|
/**
|
|
* Path to the Edge view that will be used as the root view for Inertia responses
|
|
*/
|
|
rootView: 'app',
|
|
|
|
/**
|
|
* Data that should be shared with all rendered pages
|
|
*/
|
|
sharedData: {
|
|
//This will be available in all views
|
|
appName: 'Tethys Cloud',
|
|
|
|
errors: (ctx) => ctx.session?.flashMessages.get('errors'),
|
|
|
|
user_id: (ctx) => {
|
|
return ctx.session?.flashMessages.get('user_id');
|
|
},
|
|
|
|
flash: (ctx) => {
|
|
return {
|
|
message: ctx.session?.flashMessages.get('message'),
|
|
warning: ctx.session?.flashMessages.get('warning'),
|
|
error: ctx.session?.flashMessages.get('error'),
|
|
};
|
|
},
|
|
|
|
// params: ({ params }) => params,
|
|
authUser: async ({ auth }: HttpContext) => {
|
|
if (auth?.user) {
|
|
await auth.user.load('roles');
|
|
return auth.user;
|
|
// {
|
|
// 'id': auth.user.id,
|
|
// 'login': auth.user.login,
|
|
// };
|
|
} else {
|
|
return null;
|
|
}
|
|
},
|
|
},
|
|
|
|
/**
|
|
* Options for the server-side rendering
|
|
*/
|
|
ssr: {
|
|
enabled: false,
|
|
entrypoint: 'inertia/app/ssr.ts',
|
|
},
|
|
});
|
|
|
|
export default inertiaConfig
|
|
|
|
declare module '@adonisjs/inertia/types' {
|
|
export interface SharedProps extends InferSharedProps<typeof inertiaConfig> {}
|
|
}
|
|
|
|
// import { InertiaConfig } from '@ioc:EidelLev/Inertia';
|
|
|
|
// /*
|
|
// |--------------------------------------------------------------------------
|
|
// | Inertia-AdonisJS config
|
|
// |--------------------------------------------------------------------------
|
|
// |
|
|
// */
|
|
|
|
// export const inertia: InertiaConfig = {
|
|
// view: 'app',
|
|
// // ssr: {
|
|
// // enabled: false,
|
|
// // },
|
|
// };
|