From 5a8213c196ce0a7f97ca0b6b6b66bebc15815719 Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Sat, 3 May 2025 23:28:21 -0400 Subject: [PATCH 1/2] add workspace --- .prettierignore | 1 + package.json | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.prettierignore b/.prettierignore index 7566eee..1beb1dc 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,6 +5,7 @@ yarn.lock # Dont even try lol .svelte-kit +dist build node_modules diff --git a/package.json b/package.json index f834710..eb23055 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,9 @@ "private": true, "version": "0.0.1", "type": "module", - "workspaces": ["strapi"], + "workspaces": [ + "strapi" + ], "scripts": { "dev": "vite dev", "compose:up": "docker compose --env-file .env -p strapi -f devops/docker-compose.dev.yml up -d ", From 0af62a9f3aa0d3f5e05c38bf9ed9341a4f40ed1d Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Sat, 3 May 2025 23:29:10 -0400 Subject: [PATCH 2/2] format --- strapi/config/admin.ts | 30 +++--- strapi/config/api.ts | 10 +- strapi/config/database.ts | 108 ++++++++++---------- strapi/config/middlewares.ts | 20 ++-- strapi/config/server.ts | 10 +- strapi/src/admin/app.example.tsx | 66 ++++++------ strapi/src/admin/tsconfig.json | 36 +++---- strapi/src/admin/vite.config.example.ts | 16 +-- strapi/src/components/shared/media.json | 26 ++--- strapi/src/components/shared/quote.json | 28 ++--- strapi/src/components/shared/rich-text.json | 24 ++--- strapi/src/components/shared/seo.json | 48 ++++----- strapi/src/index.ts | 30 +++--- strapi/tsconfig.json | 78 +++++++------- 14 files changed, 265 insertions(+), 265 deletions(-) diff --git a/strapi/config/admin.ts b/strapi/config/admin.ts index f1799fa..a4f33ce 100644 --- a/strapi/config/admin.ts +++ b/strapi/config/admin.ts @@ -1,17 +1,17 @@ export default ({ env }) => ({ - auth: { - secret: env('ADMIN_JWT_SECRET'), - }, - apiToken: { - salt: env('API_TOKEN_SALT'), - }, - transfer: { - token: { - salt: env('TRANSFER_TOKEN_SALT'), - }, - }, - flags: { - nps: env.bool('FLAG_NPS', true), - promoteEE: env.bool('FLAG_PROMOTE_EE', true), - }, + auth: { + secret: env('ADMIN_JWT_SECRET') + }, + apiToken: { + salt: env('API_TOKEN_SALT') + }, + transfer: { + token: { + salt: env('TRANSFER_TOKEN_SALT') + } + }, + flags: { + nps: env.bool('FLAG_NPS', true), + promoteEE: env.bool('FLAG_PROMOTE_EE', true) + } }); diff --git a/strapi/config/api.ts b/strapi/config/api.ts index 37f7c14..9e9fe0b 100644 --- a/strapi/config/api.ts +++ b/strapi/config/api.ts @@ -1,7 +1,7 @@ export default { - rest: { - defaultLimit: 25, - maxLimit: 100, - withCount: true, - }, + rest: { + defaultLimit: 25, + maxLimit: 100, + withCount: true + } }; diff --git a/strapi/config/database.ts b/strapi/config/database.ts index 1853ca4..7987b3a 100644 --- a/strapi/config/database.ts +++ b/strapi/config/database.ts @@ -1,60 +1,60 @@ import path from 'path'; export default ({ env }) => { - const client = env('DATABASE_CLIENT', 'sqlite'); + const client = env('DATABASE_CLIENT', 'sqlite'); - const connections = { - mysql: { - connection: { - host: env('DATABASE_HOST', 'localhost'), - port: env.int('DATABASE_PORT', 3306), - database: env('DATABASE_NAME', 'strapi'), - user: env('DATABASE_USERNAME', 'strapi'), - password: env('DATABASE_PASSWORD', 'strapi'), - ssl: env.bool('DATABASE_SSL', false) && { - key: env('DATABASE_SSL_KEY', undefined), - cert: env('DATABASE_SSL_CERT', undefined), - ca: env('DATABASE_SSL_CA', undefined), - capath: env('DATABASE_SSL_CAPATH', undefined), - cipher: env('DATABASE_SSL_CIPHER', undefined), - rejectUnauthorized: env.bool('DATABASE_SSL_REJECT_UNAUTHORIZED', true), - }, - }, - pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) }, - }, - postgres: { - connection: { - connectionString: env('DATABASE_URL'), - host: env('DATABASE_HOST', 'localhost'), - port: env.int('DATABASE_PORT', 5432), - database: env('DATABASE_NAME', 'strapi'), - user: env('DATABASE_USERNAME', 'strapi'), - password: env('DATABASE_PASSWORD', 'strapi'), - ssl: env.bool('DATABASE_SSL', false) && { - key: env('DATABASE_SSL_KEY', undefined), - cert: env('DATABASE_SSL_CERT', undefined), - ca: env('DATABASE_SSL_CA', undefined), - capath: env('DATABASE_SSL_CAPATH', undefined), - cipher: env('DATABASE_SSL_CIPHER', undefined), - rejectUnauthorized: env.bool('DATABASE_SSL_REJECT_UNAUTHORIZED', true), - }, - schema: env('DATABASE_SCHEMA', 'public'), - }, - pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) }, - }, - sqlite: { - connection: { - filename: path.join(__dirname, '..', '..', env('DATABASE_FILENAME', '.tmp/data.db')), - }, - useNullAsDefault: true, - }, - }; + const connections = { + mysql: { + connection: { + host: env('DATABASE_HOST', 'localhost'), + port: env.int('DATABASE_PORT', 3306), + database: env('DATABASE_NAME', 'strapi'), + user: env('DATABASE_USERNAME', 'strapi'), + password: env('DATABASE_PASSWORD', 'strapi'), + ssl: env.bool('DATABASE_SSL', false) && { + key: env('DATABASE_SSL_KEY', undefined), + cert: env('DATABASE_SSL_CERT', undefined), + ca: env('DATABASE_SSL_CA', undefined), + capath: env('DATABASE_SSL_CAPATH', undefined), + cipher: env('DATABASE_SSL_CIPHER', undefined), + rejectUnauthorized: env.bool('DATABASE_SSL_REJECT_UNAUTHORIZED', true) + } + }, + pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) } + }, + postgres: { + connection: { + connectionString: env('DATABASE_URL'), + host: env('DATABASE_HOST', 'localhost'), + port: env.int('DATABASE_PORT', 5432), + database: env('DATABASE_NAME', 'strapi'), + user: env('DATABASE_USERNAME', 'strapi'), + password: env('DATABASE_PASSWORD', 'strapi'), + ssl: env.bool('DATABASE_SSL', false) && { + key: env('DATABASE_SSL_KEY', undefined), + cert: env('DATABASE_SSL_CERT', undefined), + ca: env('DATABASE_SSL_CA', undefined), + capath: env('DATABASE_SSL_CAPATH', undefined), + cipher: env('DATABASE_SSL_CIPHER', undefined), + rejectUnauthorized: env.bool('DATABASE_SSL_REJECT_UNAUTHORIZED', true) + }, + schema: env('DATABASE_SCHEMA', 'public') + }, + pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) } + }, + sqlite: { + connection: { + filename: path.join(__dirname, '..', '..', env('DATABASE_FILENAME', '.tmp/data.db')) + }, + useNullAsDefault: true + } + }; - return { - connection: { - client, - ...connections[client], - acquireConnectionTimeout: env.int('DATABASE_CONNECTION_TIMEOUT', 60000), - }, - }; + return { + connection: { + client, + ...connections[client], + acquireConnectionTimeout: env.int('DATABASE_CONNECTION_TIMEOUT', 60000) + } + }; }; diff --git a/strapi/config/middlewares.ts b/strapi/config/middlewares.ts index 829f5c0..6daac98 100644 --- a/strapi/config/middlewares.ts +++ b/strapi/config/middlewares.ts @@ -1,12 +1,12 @@ export default [ - 'strapi::logger', - 'strapi::errors', - 'strapi::security', - 'strapi::cors', - 'strapi::poweredBy', - 'strapi::query', - 'strapi::body', - 'strapi::session', - 'strapi::favicon', - 'strapi::public', + 'strapi::logger', + 'strapi::errors', + 'strapi::security', + 'strapi::cors', + 'strapi::poweredBy', + 'strapi::query', + 'strapi::body', + 'strapi::session', + 'strapi::favicon', + 'strapi::public' ]; diff --git a/strapi/config/server.ts b/strapi/config/server.ts index 31c8997..1702e99 100644 --- a/strapi/config/server.ts +++ b/strapi/config/server.ts @@ -1,7 +1,7 @@ export default ({ env }) => ({ - host: env('HOST', '0.0.0.0'), - port: env.int('PORT', 1337), - app: { - keys: env.array('APP_KEYS'), - }, + host: env('HOST', '0.0.0.0'), + port: env.int('PORT', 1337), + app: { + keys: env.array('APP_KEYS') + } }); diff --git a/strapi/src/admin/app.example.tsx b/strapi/src/admin/app.example.tsx index 3ea4d91..42f7b8c 100644 --- a/strapi/src/admin/app.example.tsx +++ b/strapi/src/admin/app.example.tsx @@ -1,37 +1,37 @@ import type { StrapiApp } from '@strapi/strapi/admin'; export default { - config: { - locales: [ - // 'ar', - // 'fr', - // 'cs', - // 'de', - // 'dk', - // 'es', - // 'he', - // 'id', - // 'it', - // 'ja', - // 'ko', - // 'ms', - // 'nl', - // 'no', - // 'pl', - // 'pt-BR', - // 'pt', - // 'ru', - // 'sk', - // 'sv', - // 'th', - // 'tr', - // 'uk', - // 'vi', - // 'zh-Hans', - // 'zh', - ], - }, - bootstrap(app: StrapiApp) { - console.log(app); - }, + config: { + locales: [ + // 'ar', + // 'fr', + // 'cs', + // 'de', + // 'dk', + // 'es', + // 'he', + // 'id', + // 'it', + // 'ja', + // 'ko', + // 'ms', + // 'nl', + // 'no', + // 'pl', + // 'pt-BR', + // 'pt', + // 'ru', + // 'sk', + // 'sv', + // 'th', + // 'tr', + // 'uk', + // 'vi', + // 'zh-Hans', + // 'zh', + ] + }, + bootstrap(app: StrapiApp) { + console.log(app); + } }; diff --git a/strapi/src/admin/tsconfig.json b/strapi/src/admin/tsconfig.json index 083046e..0b49864 100644 --- a/strapi/src/admin/tsconfig.json +++ b/strapi/src/admin/tsconfig.json @@ -1,20 +1,20 @@ { - "compilerOptions": { - "target": "ESNext", - "module": "ESNext", - "moduleResolution": "Bundler", - "useDefineForClassFields": true, - "lib": ["DOM", "DOM.Iterable", "ESNext"], - "allowJs": false, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "noEmit": true, - "jsx": "react-jsx" - }, - "include": ["../plugins/**/admin/src/**/*", "./"], - "exclude": ["node_modules/", "build/", "dist/", "**/*.test.ts"] + "compilerOptions": { + "target": "ESNext", + "module": "ESNext", + "moduleResolution": "Bundler", + "useDefineForClassFields": true, + "lib": ["DOM", "DOM.Iterable", "ESNext"], + "allowJs": false, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "noEmit": true, + "jsx": "react-jsx" + }, + "include": ["../plugins/**/admin/src/**/*", "./"], + "exclude": ["node_modules/", "build/", "dist/", "**/*.test.ts"] } diff --git a/strapi/src/admin/vite.config.example.ts b/strapi/src/admin/vite.config.example.ts index 85f6982..288d1fa 100644 --- a/strapi/src/admin/vite.config.example.ts +++ b/strapi/src/admin/vite.config.example.ts @@ -1,12 +1,12 @@ import { mergeConfig, type UserConfig } from 'vite'; export default (config: UserConfig) => { - // Important: always return the modified config - return mergeConfig(config, { - resolve: { - alias: { - '@': '/src', - }, - }, - }); + // Important: always return the modified config + return mergeConfig(config, { + resolve: { + alias: { + '@': '/src' + } + } + }); }; diff --git a/strapi/src/components/shared/media.json b/strapi/src/components/shared/media.json index f8e9454..887a2e9 100644 --- a/strapi/src/components/shared/media.json +++ b/strapi/src/components/shared/media.json @@ -1,15 +1,15 @@ { - "collectionName": "components_shared_media", - "info": { - "displayName": "Media", - "icon": "file-video" - }, - "options": {}, - "attributes": { - "file": { - "allowedTypes": ["images", "files", "videos"], - "type": "media", - "multiple": false - } - } + "collectionName": "components_shared_media", + "info": { + "displayName": "Media", + "icon": "file-video" + }, + "options": {}, + "attributes": { + "file": { + "allowedTypes": ["images", "files", "videos"], + "type": "media", + "multiple": false + } + } } diff --git a/strapi/src/components/shared/quote.json b/strapi/src/components/shared/quote.json index b9ae1ae..b2d3ba2 100644 --- a/strapi/src/components/shared/quote.json +++ b/strapi/src/components/shared/quote.json @@ -1,16 +1,16 @@ { - "collectionName": "components_shared_quotes", - "info": { - "displayName": "Quote", - "icon": "indent" - }, - "options": {}, - "attributes": { - "title": { - "type": "string" - }, - "body": { - "type": "text" - } - } + "collectionName": "components_shared_quotes", + "info": { + "displayName": "Quote", + "icon": "indent" + }, + "options": {}, + "attributes": { + "title": { + "type": "string" + }, + "body": { + "type": "text" + } + } } diff --git a/strapi/src/components/shared/rich-text.json b/strapi/src/components/shared/rich-text.json index faa0ed9..8cf8241 100644 --- a/strapi/src/components/shared/rich-text.json +++ b/strapi/src/components/shared/rich-text.json @@ -1,14 +1,14 @@ { - "collectionName": "components_shared_rich_texts", - "info": { - "displayName": "Rich text", - "icon": "align-justify", - "description": "" - }, - "options": {}, - "attributes": { - "body": { - "type": "richtext" - } - } + "collectionName": "components_shared_rich_texts", + "info": { + "displayName": "Rich text", + "icon": "align-justify", + "description": "" + }, + "options": {}, + "attributes": { + "body": { + "type": "richtext" + } + } } diff --git a/strapi/src/components/shared/seo.json b/strapi/src/components/shared/seo.json index ff2b353..8bd4306 100644 --- a/strapi/src/components/shared/seo.json +++ b/strapi/src/components/shared/seo.json @@ -1,26 +1,26 @@ { - "collectionName": "components_shared_seos", - "info": { - "name": "Seo", - "icon": "allergies", - "displayName": "Seo", - "description": "" - }, - "options": {}, - "attributes": { - "metaTitle": { - "type": "string", - "required": true - }, - "metaDescription": { - "type": "text", - "required": true - }, - "shareImage": { - "type": "media", - "multiple": false, - "required": false, - "allowedTypes": ["images"] - } - } + "collectionName": "components_shared_seos", + "info": { + "name": "Seo", + "icon": "allergies", + "displayName": "Seo", + "description": "" + }, + "options": {}, + "attributes": { + "metaTitle": { + "type": "string", + "required": true + }, + "metaDescription": { + "type": "text", + "required": true + }, + "shareImage": { + "type": "media", + "multiple": false, + "required": false, + "allowedTypes": ["images"] + } + } } diff --git a/strapi/src/index.ts b/strapi/src/index.ts index 58be268..f73e5d8 100644 --- a/strapi/src/index.ts +++ b/strapi/src/index.ts @@ -1,20 +1,20 @@ // import type { Core } from '@strapi/strapi'; export default { - /** - * An asynchronous register function that runs before - * your application is initialized. - * - * This gives you an opportunity to extend code. - */ - register(/* { strapi }: { strapi: Core.Strapi } */) {}, + /** + * An asynchronous register function that runs before + * your application is initialized. + * + * This gives you an opportunity to extend code. + */ + register(/* { strapi }: { strapi: Core.Strapi } */) {}, - /** - * An asynchronous bootstrap function that runs before - * your application gets started. - * - * This gives you an opportunity to set up your data model, - * run jobs, or perform some special logic. - */ - bootstrap(/* { strapi }: { strapi: Core.Strapi } */) {}, + /** + * An asynchronous bootstrap function that runs before + * your application gets started. + * + * This gives you an opportunity to set up your data model, + * run jobs, or perform some special logic. + */ + bootstrap(/* { strapi }: { strapi: Core.Strapi } */) {} }; diff --git a/strapi/tsconfig.json b/strapi/tsconfig.json index b9fa686..b3b07fe 100644 --- a/strapi/tsconfig.json +++ b/strapi/tsconfig.json @@ -1,43 +1,43 @@ { - "compilerOptions": { - "module": "CommonJS", - "moduleResolution": "Node", - "lib": ["ES2020"], - "target": "ES2019", - "strict": false, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "incremental": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "noEmitOnError": true, - "noImplicitThis": true, - "outDir": "dist", - "rootDir": "." - }, - "include": [ - // Include root files - "./", - // Include all ts files - "./**/*.ts", - // Include all js files - "./**/*.js", - // Force the JSON files in the src folder to be included - "src/**/*.json" - ], + "compilerOptions": { + "module": "CommonJS", + "moduleResolution": "Node", + "lib": ["ES2020"], + "target": "ES2019", + "strict": false, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "incremental": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "noEmitOnError": true, + "noImplicitThis": true, + "outDir": "dist", + "rootDir": "." + }, + "include": [ + // Include root files + "./", + // Include all ts files + "./**/*.ts", + // Include all js files + "./**/*.js", + // Force the JSON files in the src folder to be included + "src/**/*.json" + ], - "exclude": [ - "node_modules/", - "build/", - "dist/", - ".cache/", - ".tmp/", + "exclude": [ + "node_modules/", + "build/", + "dist/", + ".cache/", + ".tmp/", - // Do not include admin files in the server compilation - "src/admin/", - // Do not include test files - "**/*.test.*", - // Do not include plugins in the server compilation - "src/plugins/**" - ] + // Do not include admin files in the server compilation + "src/admin/", + // Do not include test files + "**/*.test.*", + // Do not include plugins in the server compilation + "src/plugins/**" + ] }