fix package generation
This commit is contained in:
parent
7552eb6f73
commit
e6361e839e
|
@ -59,11 +59,12 @@ import com.google.gson.JsonObject;
|
||||||
public class NPMPackageGenerator {
|
public class NPMPackageGenerator {
|
||||||
|
|
||||||
public enum Category {
|
public enum Category {
|
||||||
RESOURCE, OPENAPI, SCHEMATRON, RDF, OTHER, TOOL, TEMPLATE, JEKYLL;
|
RESOURCE, EXAMPLE, OPENAPI, SCHEMATRON, RDF, OTHER, TOOL, TEMPLATE, JEKYLL;
|
||||||
|
|
||||||
private String getDirectory() {
|
private String getDirectory() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case RESOURCE: return "/package/";
|
case RESOURCE: return "/package/";
|
||||||
|
case EXAMPLE: return "/example/";
|
||||||
case OPENAPI: return "/openapi/";
|
case OPENAPI: return "/openapi/";
|
||||||
case SCHEMATRON: return "/xml/";
|
case SCHEMATRON: return "/xml/";
|
||||||
case RDF: return "/rdf/";
|
case RDF: return "/rdf/";
|
||||||
|
@ -187,6 +188,10 @@ public class NPMPackageGenerator {
|
||||||
npm.add("maintainers", m);
|
npm.add("maintainers", m);
|
||||||
if (ig.getManifest().hasRendering())
|
if (ig.getManifest().hasRendering())
|
||||||
npm.addProperty("homepage", ig.getManifest().getRendering());
|
npm.addProperty("homepage", ig.getManifest().getRendering());
|
||||||
|
JsonObject dir = new JsonObject();
|
||||||
|
npm.add("directories", dir);
|
||||||
|
dir.addProperty("lib", "package");
|
||||||
|
dir.addProperty("example", "example");
|
||||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
String json = gson.toJson(npm);
|
String json = gson.toJson(npm);
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue