Bugfixes and structure for default theme

pull/20/head
Jens Pelzetter 2022-01-17 19:56:55 +01:00
parent ad76d5fbdf
commit 53afa29aa4
14 changed files with 2287 additions and 55 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,29 @@
{
"name": "@librecms/default-theme",
"version": "7.0.0",
"scripts": {
"build": "npm-run-all build:*",
"build:mkdir": "shx mkdir -p target/generated-resources/themes/librecms",
"build:theme": "shx cp -r src/main/resources/themes/librecms/* target/generated-resources/themes/librecms",
"build:js": "webpack",
"build:css": "npm-run-all build:css:*",
"build:css:librecms": "sass src/main/scss/librecms.scss target/generated-resources/themes/librecms/styles/librecms.css",
"build:index": "theme-index-builder target/generated-resources/themes/librecms"
},
"author": "Jens Pelzetter",
"license": "LGPL-3.0-or-later",
"devDependencies": {
"@types/bootstrap": "^5.1.8",
"npm-run-all": "^4.1.5",
"sass": "^1.48.0",
"shx": "^0.3.4",
"ts-loader": "^9.2.6",
"typescript": "^4.5.4",
"webpack": "^5.66.0",
"webpack-cli": "^4.9.1"
},
"dependencies": {
"bootstrap": "^5.1.3",
"bootstrap-icons": "^1.7.2"
}
}

View File

@ -0,0 +1,113 @@
<?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>
<groupId>org.libreccm</groupId>
<artifactId>libreccm-parent</artifactId>
<version>7.0.0-SNAPSHOT</version>
</parent>
<groupId>org.librecms</groupId>
<artifactId>ccm-cms-default-theme</artifactId>
<version>7.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>LibreCMS Default Theme</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-static-theme-index-builder</artifactId>
<version>7.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>ccm-cms-default-theme</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>
</resources>
<plugins>
<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>v14.17.0</nodeVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
</execution>
<execution>
<id>npm link @libreccm/ccm-static-theme-index-builder</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>link @libreccm/ccm-static-theme-index-builder</arguments>
</configuration>
</execution>
<execution>
<id>build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
<execution>
<id>npm link</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>link</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1,39 @@
{
"name": "librecms",
"type": "freemarker",
"master-theme": null,
"title": "LibreCMS Default Theme",
"description": "The LibreCMS default theme",
"template": [],
"default-template": null,
"mvc-templates": {
"default": {
"description": {
"values": {
"value": [
{
"lang": "en",
"value": "Default Template used if no other template fits."
}
]
}
},
"name": "Default Template",
"path": "templates/default.html.ftl",
"title": {
"values": {
"value": [
{
"lang": "en",
"value": "Default Template"
}
]
}
}
}
},
"views": {
"default": "default",
"@default": "default"
}
}

View File

@ -0,0 +1,2 @@
@import "custom";
@import "../../../node_modules/bootstrap/scss/bootstrap"

View File

@ -0,0 +1 @@
import bootstrap from "bootstrap";

View File

@ -0,0 +1,14 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": true,
"lib": ["DOM", "ES2016"],
"module": "commonjs",
"moduleResolution": "node",
"outDir": "scripts",
"sourceMap": true,
"strict": true,
"target": "ES5"
},
"include": ["src/main/typescript/**/*"]
}

View File

@ -0,0 +1,25 @@
module.exports = {
mode: "development",
devtool: "source-map",
optimization: {
chunkIds: false
},
entry: {
librecms: "./src/main/typescript/librecms.ts"
},
output: {
filename: "[name].js",
path: __dirname + "/target/generated-resources/themes/librecms/scripts"
},
resolve: {
extensions: [".tsx", ".ts", ".js", ".jsx"],
},
module: {
rules: [
// all files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'
{ test: /\.tsx?$/, use: ["ts-loader"], exclude: /node_modules/ },
],
}
}

View File

@ -3,6 +3,9 @@
"version": "7.0.0", "version": "7.0.0",
"type": "module", "type": "module",
"main": "target/dist/StaticThemeIndexBuilder.js", "main": "target/dist/StaticThemeIndexBuilder.js",
"bin": {
"theme-index-builder": "target/dist/StaticThemeIndexBuilder.js"
},
"types": "target/dist/StaticThemeIndexBuilder.d.ts", "types": "target/dist/StaticThemeIndexBuilder.d.ts",
"description": "CLI tool for building the theme-index.json file for static themes.", "description": "CLI tool for building the theme-index.json file for static themes.",
"author": "Jens Pelzetter", "author": "Jens Pelzetter",

View File

@ -45,66 +45,69 @@
</resource> </resource>
</resources> </resources>
<plugin> <plugins>
<groupId>com.github.eirslett</groupId> <plugin>
<artifactId>frontend-maven-plugin</artifactId> <groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<configuration> <configuration>
<installDirectory>../node</installDirectory> <installDirectory>../node</installDirectory>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
<id>Install node.js and NPM</id> <id>Install node.js and NPM</id>
<goals> <goals>
<goal>install-node-and-npm</goal> <goal>install-node-and-npm</goal>
</goals> </goals>
<configuration> <configuration>
<nodeVersion>v14.17.0</nodeVersion> <nodeVersion>v14.17.0</nodeVersion>
</configuration> </configuration>
</execution> </execution>
<execution> <execution>
<id>npm install</id> <id>npm install</id>
<goals> <goals>
<goal>npm</goal> <goal>npm</goal>
</goals> </goals>
<configuration> <configuration>
<arguments>install</arguments> <arguments>install</arguments>
</configuration> </configuration>
</execution> </execution>
<execution> <execution>
<id>build</id> <id>build</id>
<goals> <goals>
<goal>npm</goal> <goal>npm</goal>
</goals> </goals>
<configuration> <configuration>
<arguments>run build</arguments> <arguments>run build</arguments>
</configuration> </configuration>
</execution> </execution>
<execution> <execution>
<id>npm link</id> <id>npm link</id>
<goals> <goals>
<goal>npm</goal> <goal>npm</goal>
</goals> </goals>
<configuration> <configuration>
<arguments>link</arguments> <arguments>link</arguments>
</configuration> </configuration>
</execution> </execution>
<execution> <execution>
<id>npm publish</id> <id>npm publish</id>
<goals> <goals>
<goal>npm</goal> <goal>npm</goal>
</goals> </goals>
<phase>deploy</phase> <phase>deploy</phase>
<configuration>
<arguments>publish --userconfig ../libreccm.npmrc</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<configuration>
<arguments>publish --userconfig ../libreccm.npmrc</arguments>
</configuration>
</execution>
</executions>
</plugin>
</build> </build>
</project> </project>

View File

@ -1,3 +1,5 @@
#!/usr/bin/env node
import * as path from "path"; import * as path from "path";
import * as fs from "fs"; import * as fs from "fs";
import * as fsPromises from "fs/promises"; import * as fsPromises from "fs/promises";

View File

@ -57,6 +57,9 @@
<!-- Simple HTML editor for use in the backend --> <!-- Simple HTML editor for use in the backend -->
<module>ccm-editor</module> <module>ccm-editor</module>
<!-- Utilities for building themes -->
<module>ccm-static-theme-index-builder</module>
<!-- React.js based editor for PageModels --> <!-- React.js based editor for PageModels -->
<module>ccm-pagemodelseditor</module> <module>ccm-pagemodelseditor</module>
@ -84,6 +87,7 @@
<!-- Modules providing themes --> <!-- Modules providing themes -->
<module>ccm-theme-foundry</module> <module>ccm-theme-foundry</module>
<module>ccm-theme-ftllibs-devel</module> <module>ccm-theme-ftllibs-devel</module>
<module>ccm-cms-default-theme</module>
<!-- Bundle modules --> <!-- Bundle modules -->
<module>ccm-bundle-devel</module> <module>ccm-bundle-devel</module>