@multivisio/nswow
Advanced tools
Comparing version 0.1.19 to 0.1.20
12
cli.js
#!/usr/bin/env node | ||
import { Command } from "commander"; | ||
import { readFile } from 'fs/promises'; | ||
import { addComponents, removeComponents, createComponent, removeGroups, createGroup } from "./scripts/components.mjs"; | ||
import { addComponents, removeComponents, createComponent, addGroups, removeGroups, createGroup } from "./scripts/components.mjs"; | ||
import { build, map } from "./scripts/build.mjs"; | ||
@@ -30,9 +30,11 @@ import { beaver } from "./scripts/beaver.mjs"; | ||
commander.command("add") | ||
.description("Add components to development") | ||
.argument('<action>', "Chose action. Could be components") | ||
.description("Add components or groups to development") | ||
.argument('[action]', "Chose action. Could be components or groups") | ||
.action((action, options) => { | ||
if (action === 'components') { | ||
addComponents(); | ||
} else if (action === 'groups') { | ||
addGroups(); | ||
} else { | ||
console.error("You can add components!"); | ||
console.error("You can add components or groups!"); | ||
} | ||
@@ -44,3 +46,3 @@ }) | ||
.description("Remove components or groups from development") | ||
.argument('<action>', "Chose action. Could be components or groups") | ||
.argument('[action]', "Chose action. Could be components or groups") | ||
.action((action, options) => { | ||
@@ -47,0 +49,0 @@ if (action === 'components') { |
@@ -18,3 +18,3 @@ { | ||
"devDependencies": { | ||
"@multivisio/nswow": "^0.1.19", | ||
"@multivisio/nswow": "^0.1.20", | ||
"@vitejs/plugin-vue": "^4.6.2", | ||
@@ -21,0 +21,0 @@ "@vue/test-utils": "^2.4.4", |
{ | ||
"name": "@multivisio/nswow", | ||
"version": "0.1.19", | ||
"version": "0.1.20", | ||
"description": "Manage nswow templates, build and publish", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -7,37 +7,46 @@ #! /usr/bin/env node | ||
try { | ||
const designData = LivingdocsDesign.loadDesign(configuration); | ||
const componentData = LivingdocsDesign.loadComponents(configuration); | ||
async function build() { | ||
try { | ||
const designData = LivingdocsDesign.loadDesign(configuration); | ||
const componentData = LivingdocsDesign.loadComponents(configuration); | ||
if (!designData) { | ||
throw { | ||
message: 'design is empty' | ||
if (!designData) { | ||
throw { | ||
message: 'design is empty' | ||
} | ||
} | ||
} | ||
if (!componentData) { | ||
throw { | ||
message: 'no components found' | ||
if (!componentData) { | ||
throw { | ||
message: 'no components found' | ||
} | ||
} | ||
} | ||
if (!!designData && designData["v"] === 2) { | ||
logger.info(`Building ${designData.name} on V2`); | ||
Build.BuildV2(designData, componentData); | ||
} else { | ||
logger.info(`Building ${designData.name} on V1`); | ||
Build.BuildV1(designData, componentData); | ||
} | ||
if (!!designData && designData["v"] === 2) { | ||
logger.info(`Building ${designData.name} on V2`); | ||
Build.BuildV2(designData, componentData); | ||
} else { | ||
logger.info(`Building ${designData.name} on V1`); | ||
Build.BuildV1(designData, componentData); | ||
} | ||
Build.zipArchive(); | ||
Build.zipArchive(); | ||
} catch (error) { | ||
if (error.message) { | ||
logger.error(error.message); | ||
} catch (error) { | ||
if (error.message) { | ||
logger.error(error.message); | ||
} | ||
// show js errors | ||
if (error.error) { | ||
logger.error(error.error); | ||
} | ||
} | ||
// show js errors | ||
if (error.error) { | ||
logger.error(error.error); | ||
} | ||
return true; | ||
} | ||
export default build; | ||
export { | ||
build | ||
} |
const configurationDefaults = { | ||
"configurationSelector": "[type=\"ld-conf\"]", | ||
"build": { | ||
"design": "./src/config.json", | ||
"components": "./src/components/**/*.html", | ||
"design": "./livingdocs.config.json", | ||
"components": "./livingdocs/**/*.html", | ||
"requiredFolders": [ | ||
"./src/css", | ||
"./src/fonts" | ||
"./.output/ldd/assets" | ||
], | ||
"dist": "./dist", | ||
"dist": "./.output/livingdocs", | ||
"dest": "./", | ||
"archiveName": "design.zip" | ||
"archiveName": "./.output/livingdocs.zip" | ||
}, | ||
"migration": { | ||
"design": "./src/config.json", | ||
"components": "./src/components/**/*.html", | ||
"design": "./livingdocs.config.json", | ||
"components": "./livingdocs/**/*.html", | ||
"dest": "./design-v2", | ||
@@ -18,0 +17,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
350704
4838
0