Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 91 additions & 1 deletion codegen-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@
<groupId>com.networknt</groupId>
<artifactId>security</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>resources</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>json-schema-validator</artifactId>
Expand Down Expand Up @@ -148,8 +152,94 @@
</dependencies>
</plugin>

<!-- end Google error-proce compiles -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.networknt.server.Server</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<createSourcesJar>false</createSourcesJar>
<finalName>codegen-web-server-shaded</finalName>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/classes/view</outputDirectory>
<resources>
<resource>
<directory>view/build</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>genView</id>
<activation>
<property>
<name>genView</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>build-frontend</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>yarn</executable>
<workingDirectory>view</workingDirectory>
<arguments>
<argument>build</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.networknt.codegen.handler;

import com.networknt.resources.PathResourceProvider;
import io.undertow.server.handlers.resource.PathResourceManager;
import io.undertow.server.handlers.resource.ResourceManager;

import java.io.File;
import java.net.URL;

/**
* @author Nicholas Azar
* Created on April 22, 2018
*/
public class CodegenResourceProvider implements PathResourceProvider {
@Override
public String getPath() {
return "/view";
}

@Override
public Boolean isPrefixPath() {
return true;
}

@Override
public ResourceManager getResourceManager() {
URL resourceDir = CodegenResourceProvider.class.getResource("/view");
if (resourceDir != null) {
return new PathResourceManager(new File(resourceDir.getFile()).toPath());
}
return null;
}
}
3 changes: 3 additions & 0 deletions codegen-web/src/main/resources/config/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ singletons:
- com.networknt.codegen.hybrid.HybridServerGenerator
- com.networknt.codegen.hybrid.HybridServiceGenerator
- com.networknt.codegen.graphql.GraphqlGenerator

- com.networknt.resources.PathResourceProvider:
- com.networknt.codegen.handler.CodegenResourceProvider
14 changes: 14 additions & 0 deletions codegen-web/view/config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { injectBabelPlugin } = require('react-app-rewired');
const rewireLess = require('react-app-rewire-less');

module.exports = function override(config, env) {
config = injectBabelPlugin(['import', { libraryName: 'antd', style: true }], config); // change importing css to less
config = rewireLess.withLoaderOptions({
modifyVars: {
"@primary-color": "#0594cb",
"@body-background": "#f9f9f9",
"@layout-body-background": "#f9f9f9"
},
})(config, env);
return config;
};
90 changes: 0 additions & 90 deletions codegen-web/view/config/env.js

This file was deleted.

14 changes: 0 additions & 14 deletions codegen-web/view/config/jest/cssTransform.js

This file was deleted.

12 changes: 0 additions & 12 deletions codegen-web/view/config/jest/fileTransform.js

This file was deleted.

55 changes: 0 additions & 55 deletions codegen-web/view/config/paths.js

This file was deleted.

16 changes: 0 additions & 16 deletions codegen-web/view/config/polyfills.js

This file was deleted.

Loading