scm-ui: new repository layout

This commit is contained in:
Sebastian Sdorra
2019-10-07 10:57:09 +02:00
parent 09c7def874
commit c05798e254
417 changed files with 3620 additions and 52971 deletions

26
package.json Normal file
View File

@@ -0,0 +1,26 @@
{
"private": true,
"workspaces": [
"scm-ui/*",
"scm-plugins/*"
],
"scripts": {
"build": "webpack --mode=development --config=scm-ui/config/webpack.config.js"
},
"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/preset-env": "^7.6.2",
"@babel/preset-react": "^7.0.0",
"babel-loader": "^8.0.6",
"css-loader": "^3.2.0",
"file-loader": "^4.2.0",
"flow-bin": "^0.108.0",
"node-sass": "^4.12.0",
"sass-loader": "^8.0.0",
"script-loader": "^0.7.2",
"style-loader": "^1.0.0",
"terser-webpack-plugin": "^2.1.2",
"webpack": "^4.41.0",
"webpack-cli": "^3.3.9"
}
}

View File

@@ -69,10 +69,9 @@
<module>scm-annotation-processor</module>
<module>scm-core</module>
<module>scm-test</module>
<module>scm-ui-components</module>
<module>scm-ui</module>
<module>scm-plugins</module>
<module>scm-dao-xml</module>
<module>scm-ui</module>
<module>scm-webapp</module>
<module>scm-server</module>
<module>scm-it</module>

View File

@@ -1,17 +1,32 @@
{
"name": "@scm-manager/scm-git-plugin",
"version": "2.0.0-SNAPSHOT",
"license": "BSD-3-Clause",
"main": "src/main/js/index.js",
"main": "dist/scm-git-plugin.js",
"bundle": {
"type": "plugin",
"entry": "./src/main/js/index.js"
},
"scripts": {
"build": "ui-bundler plugin",
"watch": "ui-bundler plugin -w",
"lint": "ui-bundler lint",
"build": "ui-bundler bundle",
"lint": "ui-bundler serve",
"flow": "flow check"
},
"dependencies": {
"@scm-manager/ui-extensions": "^0.1.2"
"@scm-manager/ui-extensions": "^0.1.2",
"@scm-manager/ui-types": "link:../../scm-ui/ui-types",
"@scm-manager/ui-vendor": "link:../../scm-ui/ui-vendor",
"@scm-manager/ui-components": "link:../../scm-ui/ui-components",
"react": "^16.10.0"
},
"devDependencies": {
"@scm-manager/ui-bundler": "^0.0.31"
"@babel/core": "^7.6.2",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/preset-env": "^7.6.2",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"babel-loader": "^8.0.6",
"react-i18next": "^10.13.1",
"react-jss": "^10.0.0"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,8 @@
{
"name": "@scm-manager/scm-hg-plugin",
"main": "src/main/js/index.js",
"version": "2.0.0-SNAPSHOT",
"license": "BSD-3-Clause",
"main": "src/main/js/index.js",
"scripts": {
"build": "ui-bundler plugin"
},

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,6 @@
{
"name": "@scm-manager/legacy-plugin",
"version": "2.0.0-SNAPSHOT",
"license": "BSD-3-Clause",
"main": "src/main/js/index.js",
"scripts": {

View File

@@ -1,7 +1,8 @@
{
"name": "@scm-manager/scm-svn-plugin",
"main": "src/main/js/index.js",
"license" : "BSD-3-Clause",
"version": "2.0.0-SNAPSHOT",
"license": "BSD-3-Clause",
"scripts": {
"build": "ui-bundler plugin"
},

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +0,0 @@
{
"packages": [
"packages/*"
],
"version": "0.0.0",
"npmClient": "yarn"
}

View File

@@ -1,16 +0,0 @@
{
"name": "scm-ui-components",
"version": "0.0.3",
"description": "Lerna root for SCM-Manager UI Components",
"private": true,
"scripts": {
"bootstrap": "lerna bootstrap",
"link": "lerna exec -- yarn link",
"unlink": "lerna exec --no-bail -- yarn unlink || true",
"deploy": "node ./scripts/publish.js"
},
"devDependencies": {
"lerna": "^3.4.3",
"xml2js": "^0.4.19"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,36 +0,0 @@
{
"name": "@scm-manager/ui-types",
"version": "2.0.0-SNAPSHOT",
"description": "Flow types for SCM-Manager related Objects",
"main": "src/index.js",
"files": [
"src"
],
"repository": "https://bitbucket.org/sdorra/scm-manager",
"author": "Sebastian Sdorra <sebastian.sdorra@cloudogu.com>",
"license": "BSD-3-Clause",
"scripts": {
"lint": "ui-bunder lint",
"check": "flow check"
},
"devDependencies": {
"@scm-manager/ui-bundler": "^0.0.31"
},
"browserify": {
"transform": [
[
"babelify",
{
"plugins": [
"@babel/plugin-proposal-class-properties"
],
"presets": [
"@babel/preset-env",
"@babel/preset-flow",
"@babel/preset-react"
]
}
]
]
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,88 +0,0 @@
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>sonia.scm</groupId>
<artifactId>scm</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<groupId>sonia.scm</groupId>
<artifactId>scm-ui-components</artifactId>
<packaging>pom</packaging>
<version>2.0.0-SNAPSHOT</version>
<name>scm-ui-components</name>
<build>
<plugins>
<plugin>
<groupId>com.github.sdorra</groupId>
<artifactId>buildfrontend-maven-plugin</artifactId>
<configuration>
<node>
<version>${nodejs.version}</version>
</node>
<pkgManager>
<type>YARN</type>
<version>${yarn.version}</version>
</pkgManager>
</configuration>
<executions>
<execution>
<id>install</id>
<phase>process-resources</phase>
<goals>
<goal>install</goal>
</goals>
</execution>
<execution>
<id>bootstrap</id>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<script>bootstrap</script>
</configuration>
</execution>
<execution>
<id>unlink</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<script>unlink</script>
</configuration>
</execution>
<execution>
<id>link</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<script>link</script>
</configuration>
</execution>
<execution>
<id>deploy</id>
<phase>deploy</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<script>deploy</script>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,140 +0,0 @@
const fs = require("fs");
const path = require("path");
const {spawn} = require("child_process");
const parseString = require('xml2js').parseString;
function isSnapshot(version) {
return version.indexOf("SNAPSHOT") > 0;
}
function createSnapshotVersion(version) {
const date = new Date();
const year = date.getFullYear();
const month = date.getMonth().toString().padStart(2, "0");
const day = date.getDate().toString().padStart(2, "0");
const hours = date.getHours().toString().padStart(2, "0");
const minutes = date.getMinutes().toString().padStart(2, "0");
const seconds = date.getSeconds().toString().padStart(2, "0");
return version.replace("SNAPSHOT", `${year}${month}${day}-${hours}${minutes}${seconds}`);
}
function createVersionForPublishing(version) {
if (isSnapshot(version)) {
return createSnapshotVersion(version);
}
return version;
}
function publishPackages(version) {
console.log(`publish ${version} of all packages`);
return new Promise((resolve, reject) => {
const lerna = spawn("lerna", [
"exec", "--", "yarn", "publish", "--new-version", version, "--access", "public"
], {
stdio: [
process.stdin,
process.stdout,
process.stderr
]
});
lerna.on('close', (code) => {
if (code === 0) {
resolve();
} else {
reject(new Error("publishing of packages failed with status code: " + code));
}
});
});
}
function setVersion(package, packages, newVersion) {
return new Promise((resolve, reject) => {
const packageJsonPath = path.join(package, "package.json");
fs.readFile(packageJsonPath, "utf-8" , (err, content) => {
if (err) {
reject(err);
} else {
const packageJson = JSON.parse(content);
packageJson.version = newVersion;
for (let dep in packageJson.dependencies) {
if (packages.indexOf(dep) >= 0) {
packageJson.dependencies[ dep ] = newVersion;
}
}
fs.writeFile( packageJsonPath, JSON.stringify(packageJson, null, 2), (err) => {
if (err) {
reject(err)
} else {
console.log("modified", packageJsonPath);
resolve();
}
});
}
});
});
}
function setVersions(newVersion) {
console.log("set versions of packages to", newVersion);
return new Promise((resolve, reject) => {
fs.readdir("packages", (err, packages) => {
if ( err ) {
reject(err);
} else {
const actions = [];
const packagesWithOrg = packages.map((name) => `@scm-manager/${name}`);
for (let pkg of packages) {
const action = setVersion(path.join("packages", pkg), packagesWithOrg, newVersion);
actions.push(action);
}
resolve(Promise.all(actions));
}
});
});
}
function getVersion() {
return new Promise((resolve, reject) => {
fs.readFile("pom.xml", "utf8", (err, xml) => {
if (err) {
reject(err);
} else {
parseString(xml, function (err, json) {
if (err) {
reject(err)
} else {
const project = json.project;
let version = project.version;
if (!version) {
version = project.parent.version;
}
version = version[0];
resolve(version)
}
});
}
});
});
}
getVersion()
.then(version => {
const publishVersion = createVersionForPublishing(version);
return setVersions(publishVersion)
.then(() => publishPackages(publishVersion))
.then(() => setVersions(version));
})
.catch((err) => {
throw err;
});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,58 @@
const path = require("path");
module.exports = {
context: path.resolve(__dirname, ".."),
entry: {
webapp: "./ui-webapp/src/index.js"
},
target: "web",
node: {
fs: "empty",
net: "empty",
tls: "empty"
},
module: {
rules: [
{
parser: {
system: false,
systemjs: false
}
},
{
test: /\.(js|jsx)$/,
// exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
presets: [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-flow"
],
plugins: ["@babel/plugin-proposal-class-properties"]
}
}
},
{
test: /\.(css|scss|sass)$/i,
use: [
// Creates `style` nodes from JS strings
"style-loader",
// Translates CSS into CommonJS
"css-loader",
// Compiles Sass to CSS
"sass-loader"
]
},
{
test: /\.(png|svg|jpg|gif|woff2?|eot|ttf)$/,
use: ["file-loader"]
}
]
},
output: {
path: path.resolve(__dirname, "..", "target"),
filename: "[name].bundle.js"
}
};

View File

@@ -29,6 +29,20 @@
<finalName>scm-ui</finalName>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${basedir}</directory>
<includes>
<include>**/ui-**/dist/**</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>com.github.sdorra</groupId>
<artifactId>buildfrontend-maven-plugin</artifactId>
@@ -43,26 +57,6 @@
<script>run</script>
</configuration>
<executions>
<execution>
<id>link-ui-types</id>
<phase>process-sources</phase>
<goals>
<goal>install-link</goal>
</goals>
<configuration>
<pkg>@scm-manager/ui-types</pkg>
</configuration>
</execution>
<execution>
<id>link-ui-components</id>
<phase>process-sources</phase>
<goals>
<goal>install-link</goal>
</goals>
<configuration>
<pkg>@scm-manager/ui-components</pkg>
</configuration>
</execution>
<execution>
<id>install</id>
<phase>process-resources</phase>
@@ -80,7 +74,7 @@
<script>build</script>
</configuration>
</execution>
<execution>
<!--execution>
<id>test</id>
<phase>test</phase>
<goals>
@@ -90,7 +84,7 @@
<script>test-ci</script>
<skip>${skipTests}</skip>
</configuration>
</execution>
</execution-->
</executions>
</plugin>
@@ -102,7 +96,15 @@
<failOnMissingWebXml>false</failOnMissingWebXml>
<webResources>
<resource>
<directory>public</directory>
<directory>ui-webapp/dist</directory>
<targetPath>bundles</targetPath>
</resource>
<resource>
<directory>ui-vendor/dist</directory>
<targetPath>bundles</targetPath>
</resource>
<resource>
<directory>ui-webapp/public</directory>
</resource>
</webResources>
</configuration>

View File

@@ -4,6 +4,7 @@
"description": "UI Components for SCM-Manager and its plugins",
"main": "src/index.js",
"files": [
"dist",
"src"
],
"repository": "https://bitbucket.org/sdorra/scm-manager",
@@ -13,8 +14,12 @@
"update-index": "create-index -r src",
"eslint-fix": "eslint src --fix"
},
"bundle": {
"type": "library",
"entry": "./src/index.js"
},
"devDependencies": {
"@scm-manager/ui-bundler": "^0.0.31",
"@scm-manager/ui-vendor": "link:../ui-vendor",
"create-index": "^2.3.0",
"enzyme": "^3.5.0",
"enzyme-adapter-react-16": "^1.3.1",
@@ -27,41 +32,21 @@
},
"dependencies": {
"@scm-manager/ui-extensions": "^0.1.2",
"@scm-manager/ui-types": "2.0.0-SNAPSHOT",
"@scm-manager/ui-types": "link:../ui-types",
"classnames": "^2.2.6",
"moment": "^2.22.2",
"query-string": "5",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-diff-view": "^1.8.1",
"react-dom": "^16.8.6",
"react-i18next": "^7.11.0",
"react-jss": "^8.6.1",
"react-markdown": "^4.0.6",
"react-router-dom": "^4.3.1",
"react-select": "^2.1.2",
"react-markdown": "^4.0.6",
"react-syntax-highlighter": "^10.2.0"
},
"resolutions": {
"gitdiff-parser": "https://github.com/cloudogu/gitdiff-parser#3a72da4a8e3d9bfb4b9e01a43e85628c19f26cc4"
},
"browserify": {
"transform": [
[
"browserify-css"
],
[
"babelify",
{
"plugins": [
"@babel/plugin-proposal-class-properties"
],
"presets": [
"@babel/preset-env",
"@babel/preset-flow",
"@babel/preset-react"
]
}
]
]
}
}

Some files were not shown because too many files have changed in this diff Show More