Initial Strapi plugin project

This commit is contained in:
2026-02-05 10:19:56 +00:00
parent f6de861195
commit efa89313fa
100 changed files with 48612 additions and 0 deletions

7
server/src/bootstrap.ts Normal file
View File

@@ -0,0 +1,7 @@
import type { Core } from '@strapi/strapi';
const bootstrap = ({ strapi }: { strapi: Core.Strapi }) => {
// bootstrap phase
};
export default bootstrap;

View File

@@ -0,0 +1,4 @@
export default {
default: {},
validator() {},
};

View File

@@ -0,0 +1 @@
export default {};

View File

@@ -0,0 +1,13 @@
import type { Core } from '@strapi/strapi';
const controller = ({ strapi }: { strapi: Core.Strapi }) => ({
index(ctx) {
ctx.body = strapi
.plugin('strapi-plugin-checkbox-list')
// the name of the service file & the method.
.service('service')
.getWelcomeMessage();
},
});
export default controller;

View File

@@ -0,0 +1,5 @@
import controller from './controller';
export default {
controller,
};

7
server/src/destroy.ts Normal file
View File

@@ -0,0 +1,7 @@
import type { Core } from '@strapi/strapi';
const destroy = ({ strapi }: { strapi: Core.Strapi }) => {
// destroy phase
};
export default destroy;

30
server/src/index.ts Normal file
View File

@@ -0,0 +1,30 @@
/**
* Application methods
*/
import bootstrap from './bootstrap';
import destroy from './destroy';
import register from './register';
/**
* Plugin server methods
*/
import config from './config';
import contentTypes from './content-types';
import controllers from './controllers';
import middlewares from './middlewares';
import policies from './policies';
import routes from './routes';
import services from './services';
export default {
register,
bootstrap,
destroy,
config,
controllers,
routes,
services,
contentTypes,
policies,
middlewares,
};

View File

@@ -0,0 +1 @@
export default {};

View File

@@ -0,0 +1 @@
export default {};

7
server/src/register.ts Normal file
View File

@@ -0,0 +1,7 @@
import type { Core } from '@strapi/strapi';
const register = ({ strapi }: { strapi: Core.Strapi }) => {
// register phase
};
export default register;

View File

@@ -0,0 +1,4 @@
export default () => ({
type: 'admin',
routes: [],
});

View File

@@ -0,0 +1,14 @@
export default () => ({
type: 'content-api',
routes: [
{
method: 'GET',
path: '/',
// name of the controller file & the method.
handler: 'controller.index',
config: {
policies: [],
},
},
],
});

View File

@@ -0,0 +1,9 @@
import contentAPIRoutes from './content-api';
import adminAPIRoutes from './admin';
const routes = {
'content-api': contentAPIRoutes,
admin: adminAPIRoutes,
};
export default routes;

View File

@@ -0,0 +1,5 @@
import service from './service';
export default {
service,
};

View File

@@ -0,0 +1,9 @@
import type { Core } from '@strapi/strapi';
const service = ({ strapi }: { strapi: Core.Strapi }) => ({
getWelcomeMessage() {
return 'Welcome to Strapi 🚀';
},
});
export default service;

View File

@@ -0,0 +1,10 @@
{
"extends": "./tsconfig",
"include": ["./src"],
"exclude": ["**/*.test.ts"],
"compilerOptions": {
"rootDir": "../",
"baseUrl": ".",
"outDir": "./dist"
}
}

8
server/tsconfig.json Normal file
View File

@@ -0,0 +1,8 @@
{
"extends": "@strapi/typescript-utils/tsconfigs/server",
"include": ["./src"],
"compilerOptions": {
"rootDir": "../",
"baseUrl": "."
}
}