@jahia/create-module 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/lint.yml +5 -3
- package/.github/workflows/publish-release.yml +2 -2
- package/.yarn/releases/yarn-4.5.0.cjs +925 -0
- package/.yarnrc.yml +3 -0
- package/README.md +9 -4
- package/index.js +34 -67
- package/package.json +7 -10
- package/template/.babelrc +9 -0
- package/template/.yarn/releases/yarn-4.3.1.cjs +894 -0
- package/template/.yarnrc.yml +3 -0
- package/{jsx → template}/README.md +20 -0
- package/{handlebars → template}/dotenv +1 -1
- package/template/dotgitignore +18 -0
- package/{jsx → template}/dotnpmignore +1 -1
- package/{jsx → template}/package.json +16 -16
- package/template/settings/README.md +30 -0
- package/{jsx → template/settings}/definitions.cnd +6 -0
- package/template/settings/locales/de.json +5 -0
- package/template/settings/locales/en.json +5 -0
- package/template/settings/locales/fr.json +5 -0
- package/template/src/server/templates/page/PageHome.jsx +29 -0
- package/template/src/server/views/hello/HelloDefault.jsx +19 -0
- package/{jsx → template}/webpack.config.js +49 -23
- package/babel.config.cjs.disabled +0 -3
- package/handlebars/README.md +0 -11
- package/handlebars/components/MODULE_NAMESPACE/hello/hello.cnd +0 -6
- package/handlebars/components/MODULE_NAMESPACE/hello/hello.default.hbs +0 -1
- package/handlebars/components/MODULE_NAMESPACE/hello/hello.icon.png +0 -0
- package/handlebars/components/jnt/page/page.home.hbs +0 -18
- package/handlebars/components/jnt/page/page.home.png +0 -0
- package/handlebars/components/jnt/page/page.home.properties +0 -2
- package/handlebars/definitions.cnd +0 -8
- package/handlebars/doteslintrc.cjs +0 -29
- package/handlebars/dotgitignore +0 -15
- package/handlebars/dotnpmignore +0 -4
- package/handlebars/import.xml +0 -8
- package/handlebars/locales/de.json +0 -3
- package/handlebars/locales/en.json +0 -3
- package/handlebars/locales/fr.json +0 -3
- package/handlebars/package.json +0 -41
- package/handlebars/resources/MODULE_NAME.properties +0 -2
- package/handlebars/resources/MODULE_NAME_fr.properties +0 -2
- package/handlebars/settings/README.txt +0 -9
- package/handlebars/src/index.js +0 -0
- package/handlebars/webpack.config.js +0 -49
- package/jsx/dotenv +0 -4
- package/jsx/dotgitignore +0 -15
- package/jsx/locales/de.json +0 -4
- package/jsx/locales/en.json +0 -4
- package/jsx/locales/fr.json +0 -4
- package/jsx/settings/README.txt +0 -9
- package/jsx/src/server/templates/page/PageHome.jsx +0 -24
- package/jsx/src/server/views/hello/HelloDefault.jsx +0 -18
- package/jsx/yarn.lock +0 -0
- /package/{jsx → template}/css/styles.css +0 -0
- /package/{jsx → template}/doteslintrc.cjs +0 -0
- /package/{jsx → template/settings}/import.xml +0 -0
- /package/{jsx → template/settings}/resources/MODULE_NAME.properties +0 -0
- /package/{jsx → template/settings}/resources/MODULE_NAME_fr.properties +0 -0
- /package/{jsx → template}/src/client/index.jsx +0 -0
- /package/{jsx → template}/src/server/components/index.js +0 -0
- /package/{jsx → template}/src/server/index.js +0 -0
- /package/{jsx → template}/src/server/templates/index.js +0 -0
- /package/{jsx → template}/src/server/templates/page/index.js +0 -0
- /package/{jsx → template}/src/server/views/hello/index.js +0 -0
- /package/{jsx → template}/src/server/views/index.js +0 -0
- /package/{handlebars → template}/yarn.lock +0 -0
|
@@ -9,3 +9,23 @@ If you don't use default configuration for the Docker container name or for Jahi
|
|
|
9
9
|
## Documentation
|
|
10
10
|
|
|
11
11
|
You can find the documentation on how to use this module on the [Jahia Academy](https://academy.jahia.com/get-started/developers/templating) templating tutorial.
|
|
12
|
+
|
|
13
|
+
## Run
|
|
14
|
+
|
|
15
|
+
1) Enable Corepack if needed :
|
|
16
|
+
|
|
17
|
+
`enable corepack`
|
|
18
|
+
|
|
19
|
+
2) Install the dependencies :
|
|
20
|
+
|
|
21
|
+
``yarn``
|
|
22
|
+
|
|
23
|
+
3) Build and run the project :
|
|
24
|
+
|
|
25
|
+
``yarn watch``
|
|
26
|
+
|
|
27
|
+
## How to upgrade yarn version to latest stable
|
|
28
|
+
|
|
29
|
+
This command will upgrade yarn to the latest stable release and update the yarn installer in .yarn/releases
|
|
30
|
+
|
|
31
|
+
``yarn set version stable``
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "$$MODULE_NAME$$",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "webpack --mode=development",
|
|
8
|
-
"build:production": "webpack --mode=production",
|
|
9
|
-
"deploy": "jahia-deploy
|
|
10
|
-
"watch": "
|
|
7
|
+
"build": "webpack --mode=development && jahia-pack",
|
|
8
|
+
"build:production": "webpack --mode=production && jahia-pack",
|
|
9
|
+
"deploy": "jahia-deploy",
|
|
10
|
+
"watch": "webpack --mode=development --watch",
|
|
11
11
|
"lint": "eslint .",
|
|
12
|
-
"test": "yarn lint"
|
|
13
|
-
"postinstall": "yarn dlx @yarnpkg/sdks vscode"
|
|
12
|
+
"test": "yarn lint"
|
|
14
13
|
},
|
|
15
14
|
"jahia": {
|
|
16
15
|
"module-dependencies": "default",
|
|
17
|
-
"module-type": "
|
|
16
|
+
"module-type": "$$MODULE_TYPE$$",
|
|
17
|
+
"module-type-comment": "Use templatesSet in the module type to declare a template set",
|
|
18
18
|
"server": "dist/main.js",
|
|
19
19
|
"static-resources": "/css,/images,/javascript,/locales"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@
|
|
23
|
-
"@jahia/data-helper": "1.0.4",
|
|
24
|
-
"@jahia/js-server-core": "^0.0.7",
|
|
22
|
+
"@jahia/js-server-core": "^0.0.13",
|
|
25
23
|
"graphql": "^16.7.1",
|
|
24
|
+
"i18next": "^23.10.1",
|
|
26
25
|
"react": "^18.2.0",
|
|
27
|
-
"react-dom": "^18.2.0"
|
|
26
|
+
"react-dom": "^18.2.0",
|
|
27
|
+
"react-i18next": "^14.1.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@babel/cli": "^7.16.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@babel/preset-env": "^7.16.4",
|
|
33
33
|
"@babel/preset-react": "^7.16.0",
|
|
34
34
|
"@jahia/eslint-config": "^2.1.2",
|
|
35
|
-
"@jahia/scripts": "^1.3.
|
|
35
|
+
"@jahia/scripts": "^1.3.5",
|
|
36
36
|
"babel-loader": "^8.2.3",
|
|
37
37
|
"clean-webpack-plugin": "^4.0.0",
|
|
38
38
|
"copy-webpack-plugin": "^10.0.0",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"webpack-shell-plugin-next": "^2.3.1"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
|
-
"node": ">=
|
|
53
|
-
"yarn": ">=
|
|
52
|
+
"node": ">=18.0.0",
|
|
53
|
+
"yarn": ">=4.0.0"
|
|
54
54
|
},
|
|
55
|
-
"packageManager": "yarn@4.1
|
|
55
|
+
"packageManager": "yarn@4.3.1"
|
|
56
56
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Directory Structure
|
|
2
|
+
|
|
3
|
+
In this directory, you can directly put:
|
|
4
|
+
- **Rule files** (`*.drl`, `*.dsl`)
|
|
5
|
+
- **URL rewrite XML files**
|
|
6
|
+
- **import.xml** file
|
|
7
|
+
- **definitions.cnd** file
|
|
8
|
+
- **template-thumbnail.png** file to associate a preview image with the current module (in case it's a template module)
|
|
9
|
+
|
|
10
|
+
## Configurations Directory
|
|
11
|
+
|
|
12
|
+
In the `configurations` directory, you can put:
|
|
13
|
+
- **OSGi configuration files** (`*.cfg`, `*.yml`)
|
|
14
|
+
|
|
15
|
+
## Content Editor Forms Directory
|
|
16
|
+
|
|
17
|
+
In the `content-editor-forms` directory, you can put content editor form and field set overrides.
|
|
18
|
+
See examples here: [Jahia Content Editor Form Examples](https://academy.jahia.com/documentation/jahia/jahia-8/developer/extending-and-customizing-jahia-ui/customizing-content-editor-forms/examples-of-content-definition-json-overrides)
|
|
19
|
+
|
|
20
|
+
## Content Types Icons Directory
|
|
21
|
+
|
|
22
|
+
In the `content-types-icons` directory, you can put content type icons following the naming convention: `namespace_type.png`
|
|
23
|
+
|
|
24
|
+
## Locales Directory
|
|
25
|
+
|
|
26
|
+
In the `locales` directory, you can put locale files (e.g., `en.json`, `fr.json`) used for internationalization in JavaScript views.
|
|
27
|
+
|
|
28
|
+
## Resources Directory
|
|
29
|
+
|
|
30
|
+
In the `resources` directory, you can put resource bundles for content types internationalization.
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
<$$MODULE_NAMESPACE$$ = 'http://www.acme.org/$$MODULE_NAME$$/nt/1.0'>
|
|
4
4
|
<$$MODULE_NAMESPACE$$mix = 'http://www.acme.org/$$MODULE_NAME$$/mix/1.0'>
|
|
5
5
|
|
|
6
|
+
// Defining the content types is similar to defining a data model: once deployed, you cannot change the type of a property.
|
|
7
|
+
// If you need to do changes during the development phase, it is possible to remove the definitions from the tools:
|
|
8
|
+
// http://localhost:8080/cms/login?redirect=/modules/tools/definitionsBrowser.jsp however that will remove content created with this type.
|
|
9
|
+
// Learn more about content types definitions here: https://academy.jahia.com/developer/content-types"
|
|
10
|
+
|
|
11
|
+
|
|
6
12
|
// This mixin creates a category to regroup types in the content type selector UI. Apply it to any definition you want
|
|
7
13
|
// to see in this category.
|
|
8
14
|
[$$MODULE_NAMESPACE$$mix:$$MODULE_NAMESPACE$$Components] > jmix:droppableContent, jmix:accessControllableContent mixin
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Area, AddResources, defineJahiaComponent, useServerContext} from '@jahia/js-server-core';
|
|
3
|
+
import {useTranslation} from 'react-i18next';
|
|
4
|
+
|
|
5
|
+
export const PageHome = () => {
|
|
6
|
+
const {t} = useTranslation();
|
|
7
|
+
const {currentResource} = useServerContext();
|
|
8
|
+
const lang = currentResource.getLocale().getLanguage();
|
|
9
|
+
return (<html lang={lang}>
|
|
10
|
+
<head>
|
|
11
|
+
<AddResources type='css' resources='styles.css' />
|
|
12
|
+
<title>Home</title>
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<main>
|
|
16
|
+
{/* Using i18next defined in locales */}
|
|
17
|
+
<h1>{t('homeTitle')}</h1>
|
|
18
|
+
<Area name="pagecontent" />
|
|
19
|
+
</main>
|
|
20
|
+
</body>
|
|
21
|
+
</html>);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
PageHome.jahiaComponent = defineJahiaComponent({
|
|
25
|
+
nodeType: 'jnt:page',
|
|
26
|
+
name: 'home',
|
|
27
|
+
displayName: 'Home page',
|
|
28
|
+
componentType: 'template'
|
|
29
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {useServerContext, getNodeProps, defineJahiaComponent} from '@jahia/js-server-core'
|
|
3
|
+
|
|
4
|
+
export const HelloDefault = () => {
|
|
5
|
+
const { currentNode } = useServerContext();
|
|
6
|
+
const props = getNodeProps(currentNode, ['textHello']);
|
|
7
|
+
return (
|
|
8
|
+
<div>
|
|
9
|
+
<h2>{props.textHello}</h2>
|
|
10
|
+
</div>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
HelloDefault.jahiaComponent = defineJahiaComponent({
|
|
15
|
+
name: 'default',
|
|
16
|
+
nodeType: '$$MODULE_NAMESPACE$$:hello',
|
|
17
|
+
displayName: 'Hello (default)',
|
|
18
|
+
componentType: 'view'
|
|
19
|
+
});
|
|
@@ -18,9 +18,13 @@ fs.readdirSync(componentsDir).forEach(file => {
|
|
|
18
18
|
});
|
|
19
19
|
const moduleName = '$$MODULE_NAME$$';
|
|
20
20
|
|
|
21
|
-
module.exports = env => {
|
|
21
|
+
module.exports = (env, mode) => {
|
|
22
22
|
let configs = [
|
|
23
|
+
// Config for jahia's client-side components (HydrateInBrowser or RenderInBrowser)
|
|
24
|
+
// This config can be removed if the module doesn't contain client-side components
|
|
25
|
+
// More info here : https://academy.jahia.com/documentation/jahia/jahia-8/developer/javascript-module-development/client-side-javascript
|
|
23
26
|
{
|
|
27
|
+
name: 'client',
|
|
24
28
|
entry: {
|
|
25
29
|
[moduleName]: path.resolve(__dirname, './src/client/index')
|
|
26
30
|
},
|
|
@@ -52,6 +56,7 @@ module.exports = env => {
|
|
|
52
56
|
]
|
|
53
57
|
},
|
|
54
58
|
plugins: [
|
|
59
|
+
// This plugin allows a build to provide or consume modules with other independent builds at runtime.
|
|
55
60
|
new ModuleFederationPlugin({
|
|
56
61
|
name: moduleName,
|
|
57
62
|
library: {type: 'assign', name: `window.appShell = (typeof appShell === "undefined" ? {} : appShell); window.appShell['${moduleName}']`},
|
|
@@ -70,7 +75,10 @@ module.exports = env => {
|
|
|
70
75
|
devtool: 'inline-source-map',
|
|
71
76
|
mode: 'development'
|
|
72
77
|
},
|
|
78
|
+
// Config for jahia's server-side components (using SSR) and source code
|
|
79
|
+
// Those components have access to jahia's custom types and functions (https://academy.jahia.com/documentation/jahia/jahia-8/developer/javascript-module-development/javascript-modules-reference-documentation)
|
|
73
80
|
{
|
|
81
|
+
name: 'server',
|
|
74
82
|
entry: {
|
|
75
83
|
main: path.resolve(__dirname, 'src/server')
|
|
76
84
|
},
|
|
@@ -78,8 +86,11 @@ module.exports = env => {
|
|
|
78
86
|
path: path.resolve(__dirname, 'dist')
|
|
79
87
|
},
|
|
80
88
|
externals: {
|
|
89
|
+
// Those libraries are supplied to webpack at runtime (by the npm-module-engine project), and are not packaged in the output bundle
|
|
81
90
|
'@jahia/js-server-core': 'jsServerCoreLibraryBuilder.getLibrary()',
|
|
82
91
|
react: 'jsServerCoreLibraryBuilder.getSharedLibrary(\'react\')',
|
|
92
|
+
'react-i18next': 'jsServerCoreLibraryBuilder.getSharedLibrary(\'react-i18next\')',
|
|
93
|
+
i18next: 'jsServerCoreLibraryBuilder.getSharedLibrary(\'i18next\')',
|
|
83
94
|
'styled-jsx/style': 'jsServerCoreLibraryBuilder.getSharedLibrary(\'styled-jsx\')'
|
|
84
95
|
},
|
|
85
96
|
resolve: {
|
|
@@ -122,13 +133,34 @@ module.exports = env => {
|
|
|
122
133
|
}
|
|
123
134
|
]
|
|
124
135
|
},
|
|
136
|
+
devtool: 'inline-source-map',
|
|
137
|
+
mode: 'development'
|
|
138
|
+
}
|
|
139
|
+
];
|
|
140
|
+
|
|
141
|
+
// In case of watch we add a final config that will do automatic shell commands to trigger the pack and deploy scripts
|
|
142
|
+
// Also an additional sleep is added to avoid watch triggering too much in a short time
|
|
143
|
+
// (Feel free to adjust the sleep time according to your needs)
|
|
144
|
+
if (mode.watch) {
|
|
145
|
+
// Sleep time in seconds, can be adjusted
|
|
146
|
+
const sleepTime = 5;
|
|
147
|
+
|
|
148
|
+
configs.push({
|
|
149
|
+
name: 'watch',
|
|
150
|
+
mode: 'development',
|
|
151
|
+
dependencies: ['client', 'server'], // Wait for all webpack configs to be done
|
|
152
|
+
entry: {},
|
|
153
|
+
output: {},
|
|
125
154
|
plugins: [
|
|
126
155
|
new ExtraWatchWebpackPlugin({
|
|
156
|
+
// This is an extra list of files to watch for changes,
|
|
157
|
+
// It should include all files that are not already part of any webpack build
|
|
158
|
+
// Also do not watch for webpack generated files places, it can cause infinite loops of watch triggers
|
|
159
|
+
// for example, if your css is generated by webpack compiling scss, then:
|
|
160
|
+
// - do not add extra watch for 'css/**/*' -> it's the output of webpack scss build
|
|
161
|
+
// - do not add extra watch for 'src/scss/**/*' either, as it's already watched by webpack related config.
|
|
127
162
|
files: [
|
|
128
|
-
'src/server/**/*',
|
|
129
163
|
'images/**/*',
|
|
130
|
-
'css/**/*',
|
|
131
|
-
'javascript/**/*',
|
|
132
164
|
'locales/**/*.json',
|
|
133
165
|
'resources/**/*.properties',
|
|
134
166
|
'settings/**/*',
|
|
@@ -136,26 +168,20 @@ module.exports = env => {
|
|
|
136
168
|
'import.xml',
|
|
137
169
|
'package.json'
|
|
138
170
|
]
|
|
171
|
+
}),
|
|
172
|
+
new WebpackShellPluginNext({
|
|
173
|
+
onAfterDone: {
|
|
174
|
+
scripts: [
|
|
175
|
+
'yarn jahia-pack',
|
|
176
|
+
'yarn jahia-deploy',
|
|
177
|
+
process.platform === 'win32' ? 'timeout ' + sleepTime : 'sleep ' + sleepTime
|
|
178
|
+
],
|
|
179
|
+
blocking: true,
|
|
180
|
+
parallel: false
|
|
181
|
+
}
|
|
139
182
|
})
|
|
140
|
-
]
|
|
141
|
-
|
|
142
|
-
mode: 'development'
|
|
143
|
-
}
|
|
144
|
-
];
|
|
145
|
-
|
|
146
|
-
const webpackShellPlugin = new WebpackShellPluginNext({
|
|
147
|
-
onAfterDone: {
|
|
148
|
-
scripts: ['yarn jahia-deploy pack']
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
if (env.deploy) {
|
|
153
|
-
let config = configs[configs.length - 1];
|
|
154
|
-
if (!config.plugins) {
|
|
155
|
-
config.plugins = [];
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
config.plugins.push(webpackShellPlugin);
|
|
183
|
+
]
|
|
184
|
+
});
|
|
159
185
|
}
|
|
160
186
|
|
|
161
187
|
return configs;
|
package/handlebars/README.md
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# $$MODULE_NAME$$
|
|
2
|
-
|
|
3
|
-
A simple Jahia NPM module created using the NPM module starter project template
|
|
4
|
-
|
|
5
|
-
## Configuration
|
|
6
|
-
|
|
7
|
-
If you don't use default configuration for the Docker container name or for Jahia deployments, please modify the provided `.env` file
|
|
8
|
-
|
|
9
|
-
## Documentation
|
|
10
|
-
|
|
11
|
-
You can find the documentation on how to use this module on the [Jahia Academy](https://academy.jahia.com/get-started/developers/templating) templating tutorial.
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<jnt = 'http://www.jahia.org/jahia/nt/1.0'>
|
|
2
|
-
<jmix = 'http://www.jahia.org/jahia/mix/1.0'>
|
|
3
|
-
<$$MODULE_NAMESPACE$$ = 'http://www.acme.org/$$MODULE_NAME$$/nt/1.0'>
|
|
4
|
-
|
|
5
|
-
[$$MODULE_NAMESPACE$$:hello] > jnt:content, jmix:droppableContent
|
|
6
|
-
- textHello (string) = 'Hello world !' i18n
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<h1>{{currentContent.properties.textHello}}</h1>
|
|
Binary file
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en" class="no-js">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
-
<title>Home Template</title>
|
|
9
|
-
</head>
|
|
10
|
-
|
|
11
|
-
<body>
|
|
12
|
-
<h1>Home Template</h1>
|
|
13
|
-
<main>
|
|
14
|
-
{{jArea name="pagecontent"}}
|
|
15
|
-
</main>
|
|
16
|
-
</body>
|
|
17
|
-
|
|
18
|
-
</html>
|
|
Binary file
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<jnt = 'http://www.jahia.org/jahia/nt/1.0'>
|
|
2
|
-
<jmix = 'http://www.jahia.org/jahia/mix/1.0'>
|
|
3
|
-
<$$MODULE_NAMESPACE$$ = 'http://www.acme.org/$$MODULE_NAME$$/nt/1.0'>
|
|
4
|
-
<$$MODULE_NAMESPACE$$mix = 'http://www.acme.org/$$MODULE_NAME$$/mix/1.0'>
|
|
5
|
-
|
|
6
|
-
// This mixin creates a category to regroup types in the content type selector UI. Apply it to any definition you want
|
|
7
|
-
// to see in this category.
|
|
8
|
-
[$$MODULE_NAMESPACE$$mix:$$MODULE_NAMESPACE$$Components] > jmix:droppableContent, jmix:accessControllableContent mixin
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
env: {
|
|
4
|
-
browser: true,
|
|
5
|
-
es2021: true
|
|
6
|
-
},
|
|
7
|
-
extends: '@jahia',
|
|
8
|
-
overrides: [
|
|
9
|
-
{
|
|
10
|
-
env: {
|
|
11
|
-
node: true
|
|
12
|
-
},
|
|
13
|
-
files: [
|
|
14
|
-
'.eslintrc.{js,cjs}'
|
|
15
|
-
],
|
|
16
|
-
parserOptions: {
|
|
17
|
-
sourceType: 'script'
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
parserOptions: {
|
|
22
|
-
requireConfigFile: false,
|
|
23
|
-
ecmaVersion: 'latest',
|
|
24
|
-
sourceType: 'module'
|
|
25
|
-
},
|
|
26
|
-
ignorePatterns: ['dist'],
|
|
27
|
-
rules: {
|
|
28
|
-
}
|
|
29
|
-
};
|
package/handlebars/dotgitignore
DELETED
package/handlebars/dotnpmignore
DELETED
package/handlebars/import.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<content xmlns:j="http://www.jahia.org/jahia/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
|
|
3
|
-
<modules jcr:primaryType="jnt:modules">
|
|
4
|
-
<$$MODULE_NAME$$>
|
|
5
|
-
<home j:isHomePage="true" j:templateName="home" jcr:primaryType="jnt:page" />
|
|
6
|
-
</$$MODULE_NAME$$>
|
|
7
|
-
</modules>
|
|
8
|
-
</content>
|
package/handlebars/package.json
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "$$MODULE_NAME$$",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"license": "MIT",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"build": "webpack --mode=development",
|
|
7
|
-
"deploy": "jahia-deploy",
|
|
8
|
-
"watch": "yarn build --env deploy=true --watch",
|
|
9
|
-
"lint": "eslint .",
|
|
10
|
-
"test": "yarn lint",
|
|
11
|
-
"postinstall": "yarn dlx @yarnpkg/sdks vscode"
|
|
12
|
-
},
|
|
13
|
-
"jahia": {
|
|
14
|
-
"module-dependencies" : "default",
|
|
15
|
-
"module-type": "templatesSet",
|
|
16
|
-
"server": "dist/main.js",
|
|
17
|
-
"static-resources" : "/css,/images,/javascript"
|
|
18
|
-
},
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"@jahia/eslint-config": "^2.1.2",
|
|
21
|
-
"@jahia/scripts": "^1.3.3",
|
|
22
|
-
"eslint": "^8.43.0",
|
|
23
|
-
"eslint-plugin-jest": "latest",
|
|
24
|
-
"eslint-plugin-react": "latest",
|
|
25
|
-
"eslint-plugin-react-hooks": "latest",
|
|
26
|
-
"extra-watch-webpack-plugin": "latest",
|
|
27
|
-
"handlebars-loader": "^1.7.3",
|
|
28
|
-
"typescript": "^5.3.3",
|
|
29
|
-
"webpack": "^5.88.1",
|
|
30
|
-
"webpack-cli": "^5.1.4",
|
|
31
|
-
"webpack-shell-plugin-next": "^2.3.1"
|
|
32
|
-
},
|
|
33
|
-
"dependencies": {
|
|
34
|
-
"handlebars": "^4.7.7",
|
|
35
|
-
"@jahia/js-server-core" : "^0.0.7"
|
|
36
|
-
},
|
|
37
|
-
"engines": {
|
|
38
|
-
"node": ">=16.0.0",
|
|
39
|
-
"yarn": ">=3.0.0"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
In this directory you can put directly :
|
|
2
|
-
- Rule files (*.drl, *.dsl)
|
|
3
|
-
- URL rewrite XML files
|
|
4
|
-
|
|
5
|
-
In the configurations directory you can put :
|
|
6
|
-
- OSGi configuration files (*.cfg, *.yml)
|
|
7
|
-
|
|
8
|
-
In the jahia-content-editor-forms you can put content editor form and field set overrides,
|
|
9
|
-
see examples here : https://academy.jahia.com/documentation/jahia/jahia-8/developer/extending-and-customizing-jahia-ui/customizing-content-editor-forms/examples-of-content-definition-json-overrides
|
package/handlebars/src/index.js
DELETED
|
File without changes
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const WebpackShellPluginNext = require('webpack-shell-plugin-next');
|
|
3
|
-
const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin');
|
|
4
|
-
|
|
5
|
-
module.exports = env => {
|
|
6
|
-
const config = {
|
|
7
|
-
entry: {
|
|
8
|
-
main: path.resolve(__dirname, 'src/index')
|
|
9
|
-
},
|
|
10
|
-
output: {
|
|
11
|
-
path: path.resolve(__dirname, 'dist')
|
|
12
|
-
},
|
|
13
|
-
externals: {
|
|
14
|
-
'@jahia/js-server-core': 'jsServerCoreLibraryBuilder.getLibrary()',
|
|
15
|
-
handlebars: 'jsServerCoreLibraryBuilder.getSharedLibrary(\'handlebars\')'
|
|
16
|
-
},
|
|
17
|
-
plugins: [
|
|
18
|
-
new ExtraWatchWebpackPlugin({
|
|
19
|
-
files: [
|
|
20
|
-
'src/**/*',
|
|
21
|
-
'components/**/*',
|
|
22
|
-
'views/**/*',
|
|
23
|
-
'images/**/*',
|
|
24
|
-
'css/**/*',
|
|
25
|
-
'javascript/**/*',
|
|
26
|
-
'locales/**/*.json',
|
|
27
|
-
'resources/**/*.properties',
|
|
28
|
-
'settings/**/*',
|
|
29
|
-
'definitions.cnd',
|
|
30
|
-
'import.xml',
|
|
31
|
-
'package.json'
|
|
32
|
-
]
|
|
33
|
-
})
|
|
34
|
-
],
|
|
35
|
-
devtool: 'inline-source-map'
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
if (env.deploy) {
|
|
39
|
-
config.plugins.push(
|
|
40
|
-
new WebpackShellPluginNext({
|
|
41
|
-
onAfterDone: {
|
|
42
|
-
scripts: ['yarn jahia-deploy pack']
|
|
43
|
-
}
|
|
44
|
-
})
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return config;
|
|
49
|
-
};
|
package/jsx/dotenv
DELETED
package/jsx/dotgitignore
DELETED
package/jsx/locales/de.json
DELETED