mirror of
https://github.com/cloudmaker97/JTL-Plugin-Template.git
synced 2025-12-06 00:18:34 +00:00
Initiale Veröffentlichung der Vorlage
This commit is contained in:
commit
6466d8a925
16 changed files with 8057 additions and 0 deletions
27
Bootstrap.php
Normal file
27
Bootstrap.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* @package Plugin\plugin_test
|
||||
* @author Dennis Heinrich
|
||||
*/
|
||||
|
||||
namespace Plugin\plugin_test;
|
||||
|
||||
use JTL\Events\Dispatcher;
|
||||
use JTL\Plugin\Bootstrapper;
|
||||
|
||||
/**
|
||||
* Class Bootstrap
|
||||
* @package Plugin\plugin_test
|
||||
*/
|
||||
class Bootstrap extends Bootstrapper
|
||||
{
|
||||
/**
|
||||
* Executed on each plugin call (e.g. on each page visit)
|
||||
* @param Dispatcher $dispatcher
|
||||
* @return void
|
||||
*/
|
||||
public function boot(Dispatcher $dispatcher): void
|
||||
{
|
||||
parent::boot($dispatcher);
|
||||
}
|
||||
}
|
||||
32
LICENSE.md
Normal file
32
LICENSE.md
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2023, Dennis Heinrich
|
||||
<https://dennis-heinri.ch>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
4. Links and references to the original author's website may not be removed from the files.
|
||||
It is not allowed to change it in any ways, nor to hide it. Links must be clearly visible.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
12
README.md
Normal file
12
README.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
### Entwicklungsvorlage für den JTL Shop 5
|
||||
|
||||

|
||||
|
||||
### Vorlage richtig benutzen
|
||||
|
||||
- In dem gesamten Repository den Text `plugin_test` gegen die neue Plugin-ID ersetzen (Auch in den Namespaces)
|
||||
- Den Installationsknoten um Teile der `info.xml` ([s. Dokumentation](https://jtl-devguide.readthedocs.io/projects/jtl-shop/de/latest/shop_plugins/infoxml.html)) erweitern
|
||||
- Anlegen eines neuen GitHub-Repositorys und commiten der Dateien
|
||||
- Setzen einer Beschreibung des Repositorys
|
||||
- Setzen der Topics `jtl-shop5`, `jtl` und `jtl-plugin`
|
||||
- Bearbeiten dieser README.md und ebenfalls commiten
|
||||
0
frontend/js/.gitkeep
Normal file
0
frontend/js/.gitkeep
Normal file
203
frontend/js/main.js
Normal file
203
frontend/js/main.js
Normal file
File diff suppressed because one or more lines are too long
0
frontend/template/.gitkeep
Normal file
0
frontend/template/.gitkeep
Normal file
1
frontend/webpack/.gitignore
vendored
Normal file
1
frontend/webpack/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
node_modules
|
||||
34
frontend/webpack/package.json
Normal file
34
frontend/webpack/package.json
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"name": "plugin_test",
|
||||
"version": "1.0.0",
|
||||
"description": "Frontend-Bundle für das Plugin",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"build": "webpack --mode=production --node-env=production",
|
||||
"build:dev": "webpack --mode=development",
|
||||
"build:prod": "webpack --mode=production --node-env=production",
|
||||
"watch": "webpack --watch"
|
||||
},
|
||||
"author": "Dennis Heinrich",
|
||||
"license": "Siehe LICENSE des Plugins",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.22.19",
|
||||
"@babel/preset-env": "^7.22.15",
|
||||
"@webpack-cli/generators": "^3.0.7",
|
||||
"autoprefixer": "^10.4.15",
|
||||
"babel-loader": "^9.1.3",
|
||||
"css-loader": "^6.8.1",
|
||||
"postcss": "^8.4.29",
|
||||
"postcss-loader": "^7.3.3",
|
||||
"postcss-preset-env": "^9.1.3",
|
||||
"prettier": "^3.0.3",
|
||||
"style-loader": "^3.3.3",
|
||||
"tailwindcss": "^3.3.3",
|
||||
"ts-loader": "^9.4.4",
|
||||
"typescript": "^5.2.2",
|
||||
"webpack": "^5.88.2",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"webpack-dev-server": "^4.15.1"
|
||||
}
|
||||
}
|
||||
7639
frontend/webpack/pnpm-lock.yaml
Normal file
7639
frontend/webpack/pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load diff
4
frontend/webpack/postcss.config.js
Normal file
4
frontend/webpack/postcss.config.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
const tailwindcss = require('tailwindcss');
|
||||
module.exports = {
|
||||
plugins: [["autoprefixer"], "postcss-preset-env", tailwindcss],
|
||||
};
|
||||
6
frontend/webpack/src/index.ts
Normal file
6
frontend/webpack/src/index.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
// Load stylesheet and tailwind/css
|
||||
import "../stylesheets/main.css"
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
console.log("Hello from TypeScript!");
|
||||
});
|
||||
9
frontend/webpack/stylesheets/main.css
Normal file
9
frontend/webpack/stylesheets/main.css
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/* import tailwind */
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
/* If this isn't set, the navigation will be shown (due to a inaccurate css class from the original JTL template) */
|
||||
#mainNavigation {
|
||||
@apply visible;
|
||||
}
|
||||
17
frontend/webpack/tailwind.config.js
Normal file
17
frontend/webpack/tailwind.config.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
"./src/**/*.js",
|
||||
"./src/**/*.ts",
|
||||
"../template/**/*.tpl",
|
||||
"../../source/**/*.php",
|
||||
],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
corePlugins: {
|
||||
preflight: false,
|
||||
}
|
||||
}
|
||||
|
||||
10
frontend/webpack/tsconfig.json
Normal file
10
frontend/webpack/tsconfig.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"noImplicitAny": true,
|
||||
"module": "es6",
|
||||
"target": "es5",
|
||||
"allowJs": true
|
||||
},
|
||||
"files": ["src/index.ts"]
|
||||
}
|
||||
41
frontend/webpack/webpack.config.js
Normal file
41
frontend/webpack/webpack.config.js
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
const path = require('path');
|
||||
const isProduction = process.env.NODE_ENV == 'production';
|
||||
const stylesHandler = 'style-loader';
|
||||
|
||||
const config = {
|
||||
entry: './src/index.ts',
|
||||
output: {
|
||||
path: path.resolve(__dirname, '../js'),
|
||||
},
|
||||
plugins: [],
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(ts|tsx)$/i,
|
||||
loader: 'ts-loader',
|
||||
exclude: ['/node_modules/'],
|
||||
},
|
||||
{
|
||||
test: /\.css$/i,
|
||||
include: path.resolve(__dirname, 'stylesheets'),
|
||||
use: ['style-loader', 'css-loader', 'postcss-loader'],
|
||||
},
|
||||
{
|
||||
test: /\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/i,
|
||||
type: 'asset',
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.tsx', '.ts', '.jsx', '.js', '...'],
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = () => {
|
||||
if (isProduction) {
|
||||
config.mode = 'production';
|
||||
} else {
|
||||
config.mode = 'development';
|
||||
}
|
||||
return config;
|
||||
};
|
||||
22
info.xml
Normal file
22
info.xml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<jtlshopplugin>
|
||||
<Name>Vorlage eines Plugins</Name>
|
||||
<Description>Hier könnte Ihre Beschreibung stehen.</Description>
|
||||
<Author>Dennis Heinrich</Author>
|
||||
<URL>https://dennis-heinri.ch</URL>
|
||||
<PluginID>plugin_test</PluginID>
|
||||
<XMLVersion>100</XMLVersion>
|
||||
<Icon></Icon>
|
||||
<Version>1.0.0</Version>
|
||||
<ShopVersion>5.0.0</ShopVersion>
|
||||
<CreateDate>2023-02-01</CreateDate>
|
||||
<Install>
|
||||
<JS>
|
||||
<file>
|
||||
<name>main.js</name>
|
||||
<priority>1</priority>
|
||||
<position>head</position>
|
||||
</file>
|
||||
</JS>
|
||||
</Install>
|
||||
</jtlshopplugin>
|
||||
Loading…
Reference in a new issue