CCM NG: Integration of Node/NPM modules into build

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5460 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
jensp 2018-05-29 06:25:08 +00:00
parent 3fbecb1dce
commit d9cbfa4b9e
11 changed files with 7973 additions and 3 deletions

7729
ccm-cms-js/package-lock.json generated 100644

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,31 @@
{
"name": "ccm-cms-js",
"version": "7.0.0",
"description": "JavaScript for the ccm-cms-module",
"repository": {
"type": "svn",
"url": "https://svn.libreccm.org/ccm/ccm_ng/ccm-cms-js"
},
"author": "Jens Pelzetter",
"license": "GPL-3.0",
"scripts": {
"build": "webpack",
"tslint": "tslint --project ."
},
"dependencies": {
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-redux": "^5.0.7",
"redux": "^4.0.0"
},
"devDependencies": {
"@types/react": "^16.3.14",
"@types/react-dom": "^16.0.5",
"ts-loader": "^4.3.0",
"tslint": "^5.10.0",
"typescript": "^2.8.3",
"webpack": "^4.8.1",
"webpack-cli": "^2.1.3",
"ccm-pagemodelseditor": "^7.0.0-SNAPSHOT"
}
}

125
ccm-cms-js/pom.xml 100644
View File

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'Z</maven.build.timestamp.format>
</properties>
<parent>
<artifactId>libreccm-parent</artifactId>
<groupId>org.libreccm</groupId>
<version>7.0.0-SNAPSHOT</version>
</parent>
<groupId>org.librecms</groupId>
<artifactId>ccm-cms-js</artifactId>
<version>7.0.0-SNAPSHOT</version>
<name>LibreCMS JS</name>
<licenses>
<license>
<name>Lesser GPL 2.1</name>
<url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1</url>
</license>
</licenses>
<dependencies>
<dependency>
<groupId>org.libreccm</groupId>
<artifactId>ccm-pagemodelseditor</artifactId>
<version>7.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>ccm-cms-js</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/typescript</directory>
</resource>
<resource>
<directory>${project.build.directory}/generated-resources</directory>
</resource>
<resource>
<directory>${project.build.directory}/maven-shared-archive-resources/ccm-pagemodelseditor</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>1.5</version>
<configuration>
<resourceBundles>
<resourceBundle>org.libreccm:ccm-pagemodelseditor:${project.version}</resourceBundle>
</resourceBundles>
</configuration>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<configuration>
<installDirectory>../node</installDirectory>
</configuration>
<executions>
<execution>
<id>Install node.js and NPM</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v8.11.1</nodeVersion>
</configuration>
</execution>
<execution>
<id>npm link ccm-pagemodelseditor</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>link ccm-pagemodelseditor</arguments>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
</execution>
<execution>
<id>build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,10 @@
import * as React from "react";
import { render } from "react-dom";
import { PageModelEditor } from "../ccm-pagemodelseditor/PageModelsEditor";
render(
<PageModelEditor />,
document.getElementById("cms-content"),
);

View File

@ -0,0 +1,13 @@
{
"compilerOptions": {
"jsx": "React",
"module": "amd",
"moduleResolution": "node",
"outDir": "target/generated-resources/dist",
"sourceMap": true,
"target": "es6"
},
"include": [
"src/main/typescript/**/*"
]
}

View File

@ -0,0 +1,19 @@
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"interface-name": {
"options": ["never-prefix"]
},
"max-classes-per-file": {
"options": [100]
},
"max-line-length": {
"options": [80]
}
},
"rulesDirectory": []
}

View File

@ -0,0 +1,26 @@
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"}
]
}
};

View File

@ -1,6 +1,6 @@
{
"name": "ccm-pagemodelseditor",
"version": "7.0.0",
"version": "7.0.0-SNAPSHOT",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,7 @@
{
"name": "ccm-pagemodelseditor",
"version": "7.0.0",
"version": "7.0.0-SNAPSHOT",
"main": "index.js",
"description": "Editor for PageModels build using React.js",
"repository": {
"type": "svn",

View File

@ -70,6 +70,10 @@
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<configuration>
<installDirectory>../node</installDirectory>
</configuration>
<executions>
<execution>
<id>Install node.js and NPM</id>
@ -85,6 +89,9 @@
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>build</id>
@ -95,6 +102,15 @@
<arguments>run build</arguments>
</configuration>
</execution>
<execution>
<id>npm link</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>link</arguments>
</configuration>
</execution>
</executions>
</plugin>

View File

@ -85,7 +85,7 @@
<module>ccm-archetype-module</module>
<module>ccm-cms-archetype-contenttype</module>
<!-- <module>ccm-cms-js</module>-->
<module>ccm-cms-js</module>
</modules>
<reporting>