CCM NG: Basic integration of NPM modules and Maven build system
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5461 8810af33-2d31-482b-a856-94f89814c4dfccm-docs
parent
3ccda6dda5
commit
400c442485
File diff suppressed because it is too large
Load Diff
|
|
@ -8,24 +8,23 @@
|
||||||
},
|
},
|
||||||
"author": "Jens Pelzetter",
|
"author": "Jens Pelzetter",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
|
"main": "target/dist/ccm-cms-pagemodelseditor.js",
|
||||||
|
"types": "target/dist/ccm-cms-pagemodelseditor.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack",
|
"build": "tsc",
|
||||||
"tslint": "tslint --project ."
|
"tslint": "tslint --project ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react": "^16.3.2",
|
"react": "^16.3.2",
|
||||||
"react-dom": "^16.3.2",
|
"react-dom": "^16.3.2",
|
||||||
"react-redux": "^5.0.7",
|
"react-redux": "^5.0.7",
|
||||||
"redux": "^4.0.0"
|
"redux": "^4.0.0",
|
||||||
|
"ccm-pagemodelseditor": "7.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react": "^16.3.14",
|
"@types/react": "^16.3.14",
|
||||||
"@types/react-dom": "^16.0.5",
|
"@types/react-dom": "^16.0.5",
|
||||||
"ts-loader": "^4.3.0",
|
|
||||||
"tslint": "^5.10.0",
|
"tslint": "^5.10.0",
|
||||||
"typescript": "^2.8.3",
|
"typescript": "^2.8.3"
|
||||||
"webpack": "^4.8.1",
|
|
||||||
"webpack-cli": "^2.1.3",
|
|
||||||
"ccm-pagemodelseditor": "^7.0.0-SNAPSHOT"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
||||||
<plugin>
|
<!-- <plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-remote-resources-plugin</artifactId>
|
<artifactId>maven-remote-resources-plugin</artifactId>
|
||||||
<version>1.5</version>
|
<version>1.5</version>
|
||||||
|
|
@ -73,7 +73,7 @@
|
||||||
</goals>
|
</goals>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin> -->
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>com.github.eirslett</groupId>
|
<groupId>com.github.eirslett</groupId>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { render } from "react-dom";
|
import { render } from "react-dom";
|
||||||
|
|
||||||
import { PageModelEditor } from "../ccm-pagemodelseditor/PageModelsEditor";
|
import { PageModelEditor } from "ccm-pagemodelseditor";
|
||||||
|
|
||||||
render(
|
render(
|
||||||
<PageModelEditor />,
|
<PageModelEditor />,
|
||||||
document.getElementById("cms-content"),
|
document.getElementById("cms-content"),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"jsx": "React",
|
"jsx": "React",
|
||||||
"module": "amd",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"outDir": "target/generated-resources/dist",
|
"outDir": "target/dist",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
|
"declaration": true,
|
||||||
|
"strict": true,
|
||||||
"target": "es6"
|
"target": "es6"
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
|
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
|
|
||||||
devtool: "inline-source-map",
|
|
||||||
|
|
||||||
entry: {
|
|
||||||
ccmcms: "./src/main/typescript/ccm-cms/ccm-cms-pagemodelseditor.tsx"
|
|
||||||
},
|
|
||||||
|
|
||||||
output: {
|
|
||||||
//path: path.resolve(__dirname, "src/main/resources/dist"),
|
|
||||||
path: path.resolve(__dirname, "target/generated-resources/dist"),
|
|
||||||
filename: "ccm-cms-pagemodelseditor.js"
|
|
||||||
},
|
|
||||||
|
|
||||||
resolve: {
|
|
||||||
extensions: [".webpack.js", "web.js", ".ts", ".tsx", ".js"]
|
|
||||||
},
|
|
||||||
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{ test: /\.tsx?$/, loader: "ts-loader"}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,7 +1,8 @@
|
||||||
{
|
{
|
||||||
"name": "ccm-pagemodelseditor",
|
"name": "ccm-pagemodelseditor",
|
||||||
"version": "7.0.0-SNAPSHOT",
|
"version": "7.0.0",
|
||||||
"main": "index.js",
|
"main": "target/dist/PageModelsEditor.js",
|
||||||
|
"types": "target/dist/PageModelsEditor.d.ts",
|
||||||
"description": "Editor for PageModels build using React.js",
|
"description": "Editor for PageModels build using React.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "svn",
|
"type": "svn",
|
||||||
|
|
@ -22,10 +23,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react": "^16.3.14",
|
"@types/react": "^16.3.14",
|
||||||
"@types/react-dom": "^16.0.5",
|
"@types/react-dom": "^16.0.5",
|
||||||
"ts-loader": "^4.3.0",
|
|
||||||
"tslint": "^5.10.0",
|
"tslint": "^5.10.0",
|
||||||
"typescript": "^2.8.3",
|
"typescript": "^2.8.3"
|
||||||
"webpack": "^4.8.1",
|
|
||||||
"webpack-cli": "^2.1.3"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
||||||
<plugin>
|
<!--<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-remote-resources-plugin</artifactId>
|
<artifactId>maven-remote-resources-plugin</artifactId>
|
||||||
<version>1.5</version>
|
<version>1.5</version>
|
||||||
|
|
@ -64,7 +64,7 @@
|
||||||
<include>**/*.tsx</include>
|
<include>**/*.tsx</include>
|
||||||
</includes>
|
</includes>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>-->
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>com.github.eirslett</groupId>
|
<groupId>com.github.eirslett</groupId>
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,44 @@ import * as React from "react";
|
||||||
|
|
||||||
export { PageModelEditor };
|
export { PageModelEditor };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To render the PageModelEditor create a Typescript file with the following
|
||||||
|
* minimal content:
|
||||||
|
*
|
||||||
|
* import * as React from "react";
|
||||||
|
* import { render } from "react-dom";
|
||||||
|
*
|
||||||
|
* import { PageModelEditor } from "./PageModelsEditor";
|
||||||
|
*
|
||||||
|
* render(
|
||||||
|
* <PageModelEditor />,
|
||||||
|
* document.getElementById("cms-content"),
|
||||||
|
* );
|
||||||
|
*/
|
||||||
|
|
||||||
class PageModelEditor extends React.Component<{}, {}> {
|
class PageModelEditor extends React.Component<{}, {}> {
|
||||||
|
|
||||||
|
private getCcmApplication(): string {
|
||||||
|
|
||||||
|
const dataElem: HTMLElement | null = document
|
||||||
|
.querySelector("#page-models-editor.react-data");
|
||||||
|
|
||||||
|
if (dataElem === null) {
|
||||||
|
return "???";
|
||||||
|
} else {
|
||||||
|
const value: string | null = dataElem.getAttribute("data-ccm-application");
|
||||||
|
if (value === null) {
|
||||||
|
return "???";
|
||||||
|
} else {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public render() {
|
public render() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return <React.Fragment>
|
return <React.Fragment>
|
||||||
<div id="left">
|
<div id="left">
|
||||||
<div className="column-head"></div>
|
<div className="column-head"></div>
|
||||||
|
|
@ -18,7 +53,7 @@ class PageModelEditor extends React.Component<{}, {}> {
|
||||||
<div className="column-content">
|
<div className="column-content">
|
||||||
PageModelEditor Placeholder
|
PageModelEditor Placeholder
|
||||||
<pre>
|
<pre>
|
||||||
{document.querySelector("#page-models-editor.react-data").getAttribute("data-ccm-application")}
|
{this.getCcmApplication()}
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
import * as React from "react";
|
|
||||||
import { render } from "react-dom";
|
|
||||||
|
|
||||||
import { PageModelEditor } from "./PageModelsEditor";
|
|
||||||
|
|
||||||
render(
|
|
||||||
<PageModelEditor />,
|
|
||||||
document.getElementById("cms-content"),
|
|
||||||
);
|
|
||||||
|
|
||||||
/* "page-models-editor"* */
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"jsx": "React",
|
"jsx": "React",
|
||||||
"module": "amd",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"outDir": "target/generated-resources/dist",
|
"outDir": "target/dist",
|
||||||
|
"declaration": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
|
"strict": true,
|
||||||
"target": "es6"
|
"target": "es6"
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue