-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8048e83
Showing
34 changed files
with
10,870 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[{package.json,*.yml}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
############################ | ||
# OS X | ||
############################ | ||
|
||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
Icon | ||
.Spotlight-V100 | ||
.Trashes | ||
._* | ||
|
||
|
||
############################ | ||
# Linux | ||
############################ | ||
|
||
*~ | ||
|
||
|
||
############################ | ||
# Windows | ||
############################ | ||
|
||
Thumbs.db | ||
ehthumbs.db | ||
Desktop.ini | ||
$RECYCLE.BIN/ | ||
*.cab | ||
*.msi | ||
*.msm | ||
*.msp | ||
|
||
|
||
############################ | ||
# Packages | ||
############################ | ||
|
||
*.7z | ||
*.csv | ||
*.dat | ||
*.dmg | ||
*.gz | ||
*.iso | ||
*.jar | ||
*.rar | ||
*.tar | ||
*.zip | ||
*.com | ||
*.class | ||
*.dll | ||
*.exe | ||
*.o | ||
*.seed | ||
*.so | ||
*.swo | ||
*.swp | ||
*.swn | ||
*.swm | ||
*.out | ||
*.pid | ||
|
||
|
||
############################ | ||
# Logs and databases | ||
############################ | ||
|
||
.tmp | ||
*.log | ||
*.sql | ||
*.sqlite | ||
*.sqlite3 | ||
|
||
|
||
############################ | ||
# Misc. | ||
############################ | ||
|
||
*# | ||
ssl | ||
.idea | ||
nbproject | ||
.tsbuildinfo | ||
.eslintcache | ||
.env | ||
|
||
|
||
############################ | ||
# Strapi | ||
############################ | ||
|
||
public/uploads/* | ||
!public/uploads/.gitkeep | ||
|
||
|
||
############################ | ||
# Build | ||
############################ | ||
|
||
dist | ||
build | ||
|
||
|
||
############################ | ||
# Node.js | ||
############################ | ||
|
||
lib-cov | ||
lcov.info | ||
pids | ||
logs | ||
results | ||
node_modules | ||
.node_history | ||
|
||
|
||
############################ | ||
# Package managers | ||
############################ | ||
|
||
.yarn/* | ||
!.yarn/cache | ||
!.yarn/unplugged | ||
!.yarn/patches | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
.pnp.* | ||
yarn-error.log | ||
|
||
|
||
############################ | ||
# Tests | ||
############################ | ||
|
||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"endOfLine": "lf", | ||
"tabWidth": 2, | ||
"printWidth": 100, | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# strapi-plugin-boilerplate | ||
|
||
A test-driven template for building reliable Strapi Plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare module '@strapi/design-system/*'; | ||
declare module '@strapi/design-system'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { useEffect, useRef } from 'react'; | ||
|
||
import { PLUGIN_ID } from '../pluginId'; | ||
|
||
type InitializerProps = { | ||
setPlugin: (id: string) => void; | ||
}; | ||
|
||
const Initializer = ({ setPlugin }: InitializerProps) => { | ||
const ref = useRef(setPlugin); | ||
|
||
useEffect(() => { | ||
ref.current(PLUGIN_ID); | ||
}, []); | ||
|
||
return null; | ||
}; | ||
|
||
export { Initializer }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { PuzzlePiece } from '@strapi/icons'; | ||
|
||
const PluginIcon = () => <PuzzlePiece />; | ||
|
||
export { PluginIcon }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { getTranslation } from './utils/getTranslation'; | ||
import { PLUGIN_ID } from './pluginId'; | ||
import { Initializer } from './components/Initializer'; | ||
import { PluginIcon } from './components/PluginIcon'; | ||
|
||
export default { | ||
register(app: any) { | ||
app.addMenuLink({ | ||
to: `plugins/${PLUGIN_ID}`, | ||
icon: PluginIcon, | ||
intlLabel: { | ||
id: `${PLUGIN_ID}.plugin.name`, | ||
defaultMessage: PLUGIN_ID, | ||
}, | ||
Component: async () => { | ||
const { App } = await import('./pages/App'); | ||
|
||
return App; | ||
}, | ||
}); | ||
|
||
app.registerPlugin({ | ||
id: PLUGIN_ID, | ||
initializer: Initializer, | ||
isReady: false, | ||
name: PLUGIN_ID, | ||
}); | ||
}, | ||
|
||
async registerTrads({ locales }: { locales: string[] }) { | ||
return Promise.all( | ||
locales.map(async (locale) => { | ||
try { | ||
const { default: data } = await import(`./translations/${locale}.json`); | ||
|
||
return { data, locale }; | ||
} catch { | ||
return { data: {}, locale }; | ||
} | ||
}) | ||
); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Page } from '@strapi/strapi/admin'; | ||
import { Routes, Route } from 'react-router-dom'; | ||
|
||
import { HomePage } from './HomePage'; | ||
|
||
const App = () => { | ||
return ( | ||
<Routes> | ||
<Route index element={<HomePage />} /> | ||
<Route path="*" element={<Page.Error />} /> | ||
</Routes> | ||
); | ||
}; | ||
|
||
export { App }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Main } from '@strapi/design-system'; | ||
import { useIntl } from 'react-intl'; | ||
|
||
import { getTranslation } from '../utils/getTranslation'; | ||
|
||
const HomePage = () => { | ||
const { formatMessage } = useIntl(); | ||
|
||
return ( | ||
<Main> | ||
<h1>Welcome to {formatMessage({ id: getTranslation('plugin.name') })}</h1> | ||
</Main> | ||
); | ||
}; | ||
|
||
export { HomePage }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const PLUGIN_ID = 'boilerplate'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { PLUGIN_ID } from '../pluginId'; | ||
|
||
const getTranslation = (id: string) => `${PLUGIN_ID}.${id}`; | ||
|
||
export { getTranslation }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "./tsconfig", | ||
"include": ["./src", "./custom.d.ts"], | ||
"exclude": ["**/*.test.ts", "**/*.test.tsx"], | ||
"compilerOptions": { | ||
"rootDir": "../", | ||
"baseUrl": ".", | ||
"outDir": "./dist" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "@strapi/typescript-utils/tsconfigs/admin", | ||
"include": ["./src", "./custom.d.ts"], | ||
"compilerOptions": { | ||
"rootDir": "../", | ||
"baseUrl": "." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"version": "0.0.0", | ||
"keywords": [], | ||
"type": "commonjs", | ||
"exports": { | ||
"./package.json": "./package.json", | ||
"./strapi-admin": { | ||
"types": "./dist/admin/src/index.d.ts", | ||
"source": "./admin/src/index.ts", | ||
"import": "./dist/admin/index.mjs", | ||
"require": "./dist/admin/index.js", | ||
"default": "./dist/admin/index.js" | ||
}, | ||
"./strapi-server": { | ||
"types": "./dist/server/src/index.d.ts", | ||
"source": "./server/src/index.ts", | ||
"import": "./dist/server/index.mjs", | ||
"require": "./dist/server/index.js", | ||
"default": "./dist/server/index.js" | ||
} | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"build": "strapi-plugin build", | ||
"watch": "strapi-plugin watch", | ||
"watch:link": "strapi-plugin watch:link", | ||
"verify": "strapi-plugin verify", | ||
"test:ts:front": "run -T tsc -p admin/tsconfig.json", | ||
"test:ts:back": "run -T tsc -p server/tsconfig.json" | ||
}, | ||
"dependencies": { | ||
"@strapi/design-system": "^2.0.0-rc.14", | ||
"@strapi/icons": "^2.0.0-rc.14", | ||
"react-intl": "^7.1.0" | ||
}, | ||
"devDependencies": { | ||
"@strapi/strapi": "^5.6.0", | ||
"@strapi/sdk-plugin": "^5.2.8", | ||
"prettier": "^3.4.2", | ||
"react": "^19.0.0", | ||
"react-dom": "^19.0.0", | ||
"react-router-dom": "^7.1.1", | ||
"styled-components": "^6.1.13", | ||
"@types/react": "^19.0.2", | ||
"@types/react-dom": "^19.0.2", | ||
"@strapi/typescript-utils": "^5.6.0", | ||
"typescript": "^5.7.2" | ||
}, | ||
"peerDependencies": { | ||
"@strapi/strapi": "^5.6.0", | ||
"@strapi/sdk-plugin": "^5.2.8", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"react-router-dom": "^6.28.1", | ||
"styled-components": "^6.1.13" | ||
}, | ||
"strapi": { | ||
"kind": "plugin", | ||
"name": "strapi-plugin-boilerplate", | ||
"displayName": "Boilerplate", | ||
"description": "A test-driven template for building reliable Strapi Plugins" | ||
}, | ||
"name": "strapi-plugin-boilerplate", | ||
"description": "A test-driven template for building reliable Strapi Plugins", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://[email protected]/pluginpal/strapi-plugin-boilerplate.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/pluginpal/strapi-plugin-boilerplate/issues" | ||
}, | ||
"homepage": "https://github.com/pluginpal/strapi-plugin-boilerplate#readme", | ||
"author": "Boaz Poolman <[email protected]>" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type { Core } from '@strapi/strapi'; | ||
|
||
const bootstrap = ({ strapi }: { strapi: Core.Strapi }) => { | ||
// bootstrap phase | ||
}; | ||
|
||
export default bootstrap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default { | ||
default: {}, | ||
validator() {}, | ||
}; |
Oops, something went wrong.