Skip to content

Commit

Permalink
Add tsconfig to strapi
Browse files Browse the repository at this point in the history
  • Loading branch information
radoslavzeman committed Feb 11, 2025
1 parent 0e3ecde commit 52fc109
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 23 deletions.
33 changes: 33 additions & 0 deletions strapi/src/admin/app.example.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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() {},
}
17 changes: 0 additions & 17 deletions strapi/src/admin/app.js

This file was deleted.

30 changes: 30 additions & 0 deletions strapi/src/admin/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export default {
config: {
// Add slovak as option for strapi admin
locales: ["sk"],

// Disable video tutorials
tutorials: false,

// Disable notifications about new Strapi releases
notifications: {
releases: false,
},

translations: {
sk: {
"content-manager.components.LeftMenu.collection-types": "Kolekcie",
"content-manager.components.LeftMenu.single-types": "Jednoduché typy",
"content-manager.containers.Edit.information.lastUpdate":
"Aktualizoané",
"modal.upload-list.sub-header.add-folder": "Pridať priečinok",
"app.components.LeftMenu.general": "Všeobecné",
"Auth.form.username.placeholder": "napr. jankohrasko",
"Auth.form.email.placeholder": "napr. janko.hrasko@bratislava.sk",
"Settings.webhooks.trigger.test": "Testovací beh",
},
en: {},
},
},
bootstrap() {},
};
13 changes: 13 additions & 0 deletions strapi/src/admin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "@strapi/typescript-utils/tsconfigs/admin",
"include": [
"../plugins/**/admin/src/**/*",
"./"
],
"exclude": [
"node_modules/",
"build/",
"dist/",
"**/*.test.ts"
]
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
'use strict';

/* eslint-disable no-unused-vars */
module.exports = (config, webpack) => {
export default (config: any, webpack: any) => {
// Note: we provide webpack above so you should not `require` it
// Perform customizations to webpack config
// Important: return the modified config
return config;
};
return config
}
14 changes: 14 additions & 0 deletions strapi/src/admin/webpack.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default (config: any, webpack: any) => {
// Note: we provide webpack above so you should not `require` it
// Perform customizations to webpack config
// Important: return the modified config
//
// config.plugins.push(
// new webpack.NormalModuleReplacementPlugin(
// /^tippy\.js$/,
// 'tippy.js/dist/tippy-bundle.umd.min.js',
// ),
// )

return config
}
21 changes: 21 additions & 0 deletions strapi/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "@strapi/typescript-utils/tsconfigs/server",
"compilerOptions": {
"outDir": "dist",
"rootDir": ".",
},
"include": [
"./",
"src/**/*.json"
],
"exclude": [
"node_modules/",
"build/",
"dist/",
".cache/",
".tmp/",
"src/admin/",
"**/*.test.ts",
"src/plugins/**"
]
}

0 comments on commit 52fc109

Please # to comment.