CCM NG: Working integration of NPM modules

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5462 8810af33-2d31-482b-a856-94f89814c4df

Former-commit-id: b34a056775
pull/2/head
jensp 2018-05-29 18:34:35 +00:00
parent d74756162a
commit 3a700095d0
8 changed files with 8753 additions and 136 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,17 @@
{
"name": "ccm-bundle-devel",
"version": "7.0.0",
"scripts": {
"build": "webpack"
},
"dependencies": {
"ccm-cms-js": "7.0.0"
},
"devDependencies": {
"ts-loader": "^4.3.0",
"tslint": "^5.10.0",
"typescript": "^2.8.3",
"webpack": "^4.8.1",
"webpack-cli": "^2.1.3"
}
}

View File

@ -38,11 +38,25 @@
<artifactId>requirejs-domready</artifactId> <artifactId>requirejs-domready</artifactId>
<version>2.0.1-2</version> <version>2.0.1-2</version>
</dependency> </dependency>
<dependency>
<groupId>org.librecms</groupId>
<artifactId>ccm-cms-js</artifactId>
<version>7.0.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>libreccm-web-wildfly</finalName> <finalName>libreccm-web-wildfly</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>${project.build.directory}/generated-resources</directory>
</resource>
</resources>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
@ -56,22 +70,86 @@
</configuration> </configuration>
</plugin> </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 link ccm-cms-js</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>link ccm-cms-js</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>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
<configuration> <configuration>
<webResources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>${project.build.directory}/generated-resources</directory>
</resource>
</webResources>
<overlays> <overlays>
<overlay> <overlay>
<groupId>org.libreccm</groupId> <groupId>org.libreccm</groupId>
<artifactId>ccm-editor</artifactId> <artifactId>ccm-editor</artifactId>
<type>jar</type> <type>jar</type>
</overlay> </overlay>
<overlay> <overlay>
<groupId>org.libreccm</groupId> <groupId>org.libreccm</groupId>
<artifactId>ccm-pagemodelseditor</artifactId> <artifactId>ccm-pagemodelseditor</artifactId>
<type>jar</type> <type>jar</type>
</overlay> </overlay>
<overlay> <overlay>
<groupId>org.libreccm</groupId> <groupId>org.libreccm</groupId>
<artifactId>ccm-theme-foundry</artifactId> <artifactId>ccm-theme-foundry</artifactId>
<type>jar</type> <type>jar</type>

View File

@ -0,0 +1 @@
import "ccm-cms-js";

View File

@ -0,0 +1,13 @@
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"strict": 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,28 @@
const path = require('path');
module.exports = {
devtool: "source-map",
entry: {
ccmcms: "./src/main/typescript/ccm-cms.ts"
},
mode: "production",
output: {
//path: path.resolve(__dirname, "src/main/resources/dist"),
path: path.resolve(__dirname, "target/generated-resources/scripts/dist"),
filename: "ccm-cms.js"
},
resolve: {
extensions: [".webpack.js", "web.js", ".ts", ".tsx", ".js"]
},
module: {
rules: [
{ test: /\.tsx?$/, loader: "ts-loader"}
]
}
};

View File

@ -57,23 +57,8 @@
<plugins> <plugins>
<!-- <plugin> <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-remote-resources-plugin</artifactId> <version>1.5</version> <configuration> <resourceBundles>
<groupId>org.apache.maven.plugins</groupId> <resourceBundle>org.libreccm:ccm-pagemodelseditor:${project.version}</resourceBundle> </resourceBundles> </configuration> <executions> <execution> <goals> <goal>process</goal> </goals> </execution> </executions> </plugin> -->
<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> <plugin>
<groupId>com.github.eirslett</groupId> <groupId>com.github.eirslett</groupId>
@ -117,6 +102,15 @@
<arguments>run build</arguments> <arguments>run build</arguments>
</configuration> </configuration>
</execution> </execution>
<execution>
<id>npm link</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>link</arguments>
</configuration>
</execution>
</executions> </executions>
</plugin> </plugin>