Skip to content

Commit

Permalink
build(npm): updates external dependencies
Browse files Browse the repository at this point in the history
Up'em just updated these outdated dependencies in package.json:

@typescript-eslint/eslint-plugin  5.60.1    -> 6.1.0    devDependencies   (policy: latest)
@typescript-eslint/parser         5.60.1    -> 6.1.0    devDependencies   (policy: latest)
dependency-cruiser                13.0.4    -> 13.1.1   devDependencies   (policy: latest)
esbuild                           0.18.11   -> 0.18.16  devDependencies   (policy: latest)
eslint                            8.44.0    -> 8.45.0   devDependencies   (policy: latest)
eslint-plugin-unicorn             47.0.0    -> 48.0.0   devDependencies   (policy: latest)
fast-xml-parser                   4.2.5     -> 4.2.6    dependencies      (policy: latest)
prettier                          2.8.8     -> 3.0.0    devDependencies   (policy: latest)
semver                            7.5.3     -> 7.5.4    dependencies      (policy: latest)
watskeburt                        0.11.5    -> 0.11.6   devDependencies   (policy: latest)
  • Loading branch information
sverweij committed Jul 23, 2023
1 parent 0d449cc commit bc017d6
Show file tree
Hide file tree
Showing 36 changed files with 211 additions and 217 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ try {
`,
{
outputType: "svg",
}
},
);
console.log(lSVGInAString);
} catch (pError) {
Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ try {
{
outputType: "svg",
direction: "left-right",
}
},
);
console.log(lSVGInAString);
} catch (pError) {
Expand Down
24 changes: 12 additions & 12 deletions docs/smcat-online-interpreter.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function toVectorURI(pSVGSource) {
return (
"data:image/svg+xml;charset=utf-8," +
encodeURIComponent(
'<!DOCTYPE svg [<!ENTITY nbsp "&#160;">]>'.concat(pSVGSource)
'<!DOCTYPE svg [<!ENTITY nbsp "&#160;">]>'.concat(pSVGSource),
)
);
}
Expand Down Expand Up @@ -108,12 +108,12 @@ function showModel(pModel) {
const lUniqueIshPostfix = new Date().toISOString();
document.getElementById("save-svg").href = toVectorURI(lSVGs[0].outerHTML);
document.getElementById(
"save-svg"
"save-svg",
).download = `state-machine-${lUniqueIshPostfix}.svg`;
toRasterURI(lSVGs[0].outerHTML, (pRasterURI) => {
document.getElementById("save-png").href = pRasterURI;
document.getElementById(
"save-png"
"save-png",
).download = `state-machine-${lUniqueIshPostfix}.png`;
});
}
Expand Down Expand Up @@ -170,13 +170,13 @@ function render() {
desugar: gModel.desugar,
},
theme2attr(themeAttributeMap, gModel.theme),
getAttrFromQueryParams(queryString.parse(lSanitizedLocation))
getAttrFromQueryParams(queryString.parse(lSanitizedLocation)),
);
const lResult = smcat.render(gModel.inputscript, lOptions);
window.output.style = `background-color: ${
(
lOptions.dotGraphAttrs.find(
(pOption) => pOption.name === "bgcolor"
(pOption) => pOption.name === "bgcolor",
) || {
value: "transparent",
}
Expand All @@ -185,7 +185,7 @@ function render() {
window.output.innerHTML = formatToOutput(
lResult,
gModel.outputType,
gModel.fitToWidth
gModel.fitToWidth,
);
} catch (pError) {
window.output.innerHTML = pError;
Expand All @@ -198,7 +198,7 @@ function formatToOutput(pResult, pOutputType, pFitToWidth) {
case "scjson": {
return `<pre>${JSON.stringify(pResult, null, " ").replace(
/</g,
"&lt;"
"&lt;",
)}</pre>`;
}
case "svg": {
Expand All @@ -215,7 +215,7 @@ function formatToOutput(pResult, pOutputType, pFitToWidth) {
function setTextAreaToWindowHeight() {
window.inputscript.style.height = "${height}px".replace(
"${height}",
window.innerHeight - 120
window.innerHeight - 120,
);
}

Expand Down Expand Up @@ -253,17 +253,17 @@ window.theme.addEventListener("change", updateViewModel());
window.input_json.addEventListener(
"click",
updateViewModel("inputType"),
false
false,
);
window.input_smcat.addEventListener(
"click",
updateViewModel("inputType"),
false
false,
);
window.input_scxml.addEventListener(
"click",
updateViewModel("inputType"),
false
false,
);
window.fitToWidth.addEventListener("click", updateViewModel(), false);
window.autoRender.addEventListener("click", updateViewModel(), false);
Expand Down Expand Up @@ -314,7 +314,7 @@ window.sample.addEventListener("change", (pEvent) => {

window.version.innerHTML = "state machine cat ${version}".replace(
"${version}",
smcat.version
smcat.version,
);
setTextAreaToWindowHeight();
showModel(gModel);
Expand Down
28 changes: 13 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"depcruise:github-actions:markdown": "dependency-cruise bin src test types tools --config config/dependency-cruiser/base.mjs --output-type markdown",
"depcruise:github-actions:mermaid": "dependency-cruise bin src --config config/dependency-cruiser/graph.mjs --output-type mermaid",
"depcruise:github-actions:mermaid:affected": "dependency-cruise bin src test types tools --no-cache --config config/dependency-cruiser/base.mjs --output-type mermaid --reaches \"$(watskeburt $SHA -T regex)\"",
"format": "prettier --cache --loglevel warn --write \"bin/*.mjs\" \"{src,test}/**/*.{js,mjs}\" \"{config,test}/**/*.{js,json}\" \"tools/*.{js,mjs,json}\" \"{src,types}/**/*.{ts,mts}\" \"*.{json,yml,md}\" \"docs/{smcat-online-interpreter.js,*.md}\"",
"format": "prettier --cache --log-level warn --write \"bin/*.mjs\" \"{src,test}/**/*.{js,mjs}\" \"{config,test}/**/*.{js,json}\" \"tools/*.{js,mjs,json}\" \"{src,types}/**/*.{ts,mts}\" \"*.{json,yml,md}\" \"docs/{smcat-online-interpreter.js,*.md}\"",
"format:check": "prettier --cache --check \"bin/*.mjs\" \"{src,test}/**/*.{js,mjs}\" \"{config,test}/**/*.{js,json}\" \"tools/*.{js,mjs,json}\" \"{src,types}/**/*.{ts,mts}\" \"*.{json,yml,md}\" \"docs/{smcat-online-interpreter.js,*.md}\"",
"lint": "run-p lint:eslint format:check lint:types",
"lint:eslint": "eslint --cache --cache-location node_modules/.cache/eslint/cache.json --color src test config",
Expand Down Expand Up @@ -94,12 +94,12 @@
"ajv": "8.12.0",
"chalk": "5.3.0",
"commander": "11.0.0",
"fast-xml-parser": "4.2.5",
"fast-xml-parser": "4.2.6",
"handlebars": "4.7.7",
"he": "1.2.0",
"indent-string": "5.0.0",
"lodash": "4.17.21",
"semver": "^7.5.3",
"semver": "^7.5.4",
"traverse": "0.6.7",
"wrap-ansi": "8.1.0"
},
Expand All @@ -109,16 +109,16 @@
"@types/he": "1.2.0",
"@types/lodash": "4.14.195",
"@types/mocha": "10.0.1",
"@typescript-eslint/eslint-plugin": "5.60.1",
"@typescript-eslint/parser": "5.60.1",
"@typescript-eslint/eslint-plugin": "6.1.0",
"@typescript-eslint/parser": "6.1.0",
"c8": "8.0.0",
"chai": "4.3.7",
"chai-as-promised": "7.1.1",
"chai-json-schema": "1.5.1",
"chai-xml": "0.4.1",
"dependency-cruiser": "13.0.4",
"esbuild": "0.18.11",
"eslint": "8.44.0",
"dependency-cruiser": "13.1.1",
"esbuild": "0.18.16",
"eslint": "8.45.0",
"eslint-config-moving-meadow": "4.0.2",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-budapestian": "5.0.1",
Expand All @@ -127,29 +127,27 @@
"eslint-plugin-mocha": "10.1.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-security": "1.7.1",
"eslint-plugin-unicorn": "47.0.0",
"eslint-plugin-unicorn": "48.0.0",
"husky": "8.0.3",
"is-pdf": "1.0.0",
"is-png": "3.0.1",
"lint-staged": "13.2.3",
"mocha": "10.2.0",
"npm-run-all": "4.1.5",
"peggy": "3.0.2",
"prettier": "2.8.8",
"prettier": "3.0.0",
"query-string": "8.1.0",
"ts-node": "10.9.1",
"typescript": "5.1.6",
"upem": "8.0.0",
"watskeburt": "0.11.5",
"watskeburt": "0.11.6",
"xml-name-validator": "4.0.0"
},
"overrides": {
"xml2js": "^0.5.0",
"semver": "^7.5.3"
"xml2js": "^0.5.0"
},
"resolutions": {
"xml2js": "^0.5.0",
"semver": "^7.5.3"
"xml2js": "^0.5.0"
},
"engines": {
"node": "^16.14||>=18"
Expand Down
2 changes: 1 addition & 1 deletion src/cli/actions.mts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function transform(pOptions: ICLIRenderOptions) {
typeof lOutput === "string"
? lOutput
: JSON.stringify(lOutput, null, " "),
"binary"
"binary",
);
});
}
Expand Down
36 changes: 18 additions & 18 deletions src/cli/execute-command-line.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import validations from "./validations.mjs";

const $package = JSON.parse(
// eslint-disable-next-line security/detect-non-literal-fs-filename
readFileSync(new URL("../../package.json", import.meta.url), "utf8")
readFileSync(new URL("../../package.json", import.meta.url), "utf8"),
);

/**
Expand All @@ -25,60 +25,60 @@ function presentError(pError: any, pErrorStream: Writable) {
function parseArguments(pArguments: string[]): Command {
return new Command()
.description(
"Write beautiful state charts - https://github.com/sverweij/state-machine-cat"
"Write beautiful state charts - https://github.com/sverweij/state-machine-cat",
)
.option(
"-T, --output-type <type>",
validations.validOutputTypeRE,
validations.validOutputType as any,
validations.defaultOutputType
validations.defaultOutputType,
)
.option(
"-I, --input-type <type>",
validations.validInputTypeRE,
validations.validInputType as any,
validations.defaultInputType
validations.defaultInputType,
)
.option(
"-E, --engine <type>",
validations.validEngineRE,
validations.validEngine as any,
validations.defaultEngine
validations.defaultEngine,
)
.option(
"-d, --direction <dir>",
validations.validDirectionRE,
validations.validDirection as any,
validations.defaultDirection
validations.defaultDirection,
)
.option("-o --output-to <file>", "File to write to. use - for stdout.")
.addOption(
new Option(
"--dot-graph-attrs <string>",
"graph attributes to pass to the dot render engine"
"graph attributes to pass to the dot render engine",
)
.argParser(validations.validDotAttrs as any)
.hideHelp(true)
.hideHelp(true),
)
.addOption(
new Option(
"--dot-node-attrs <string>",
"node attributes to pass to the dot render engine"
"node attributes to pass to the dot render engine",
)
.argParser(validations.validDotAttrs as any)
.hideHelp(true)
.hideHelp(true),
)
.addOption(
new Option(
"--dot-edge-attrs <string>",
"edge attributes to pass to the dot render engine"
"edge attributes to pass to the dot render engine",
)
.argParser(validations.validDotAttrs as any)
.hideHelp(true)
.hideHelp(true),
)
.option(
"--desugar",
"transform pseudo states into transitions (!experimental!)"
"transform pseudo states into transitions (!experimental!)",
)
.version($package.version)
.option("-l, --license", "Display license and exit")
Expand All @@ -88,13 +88,13 @@ function parseArguments(pArguments: string[]): Command {

function assertNodeVersion(
pCurrentNodeVersion: string,
pSupportedEngines: string
pSupportedEngines: string,
) {
/* c8 ignore start */
if (!satisfies(pCurrentNodeVersion, pSupportedEngines)) {
throw new Error(
`\nERROR: your node version (${pCurrentNodeVersion}) is not recent enough.\n` +
` state-machine-cat is supported on node ${pSupportedEngines}\n\n`
` state-machine-cat is supported on node ${pSupportedEngines}\n\n`,
);
}
/* c8 ignore stop */
Expand All @@ -109,7 +109,7 @@ interface IExecuteCommandLineOptions {

export default async function executeCommandLine(
pArguments = process.argv,
pOptions?: Partial<IExecuteCommandLineOptions>
pOptions?: Partial<IExecuteCommandLineOptions>,
) {
const lOptions: IExecuteCommandLineOptions = {
currentNodeVersion: process.versions.node,
Expand All @@ -128,8 +128,8 @@ export default async function executeCommandLine(
}
await transform(
validations.validateArguments(
normalize(lProgram.args[0], lProgram.opts())
)
normalize(lProgram.args[0], lProgram.opts()),
),
);
} catch (pError) {
presentError(pError, lOptions.errorStream);
Expand Down
Loading

0 comments on commit bc017d6

Please sign in to comment.