Skip to content

Commit

Permalink
Merge pull request #118 from code-dot-org/stephen/deps
Browse files Browse the repository at this point in the history
chore(deps): bump all dependencies except remark-*
  • Loading branch information
stephenliang committed Feb 22, 2024
2 parents ebb75f0 + 4d59205 commit 950f7af
Show file tree
Hide file tree
Showing 14 changed files with 1,101 additions and 897 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module.exports = {

parserOptions: {
sourceType: "module",
ecmaVersion: 2017,
ecmaFeatures: {
modules: true,
ecmaVersion: 6,
experimentalObjectRestSpread: true,
},
},
Expand Down
1,868 changes: 1,036 additions & 832 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@code-dot-org/redactable-markdown",
"version": "0.9.3",
"version": "0.9.4",
"description": "",
"main": "dist/main.js",
"bin": {
Expand Down Expand Up @@ -35,32 +35,32 @@
"author": "Code.org <dev@code.org> (http://code.org)",
"license": "SEE LICENSE IN LICENSE",
"devDependencies": {
"@babel/core": "^7.18.10",
"babel-loader": "^8.2.2",
"@babel/core": "^7.23.9",
"babel-loader": "^9.1.3",
"babel-plugin-transform-class-properties": "^6.24.1",
"@babel/preset-env": "^7.18.10",
"@babel/preset-react": "^7.18.6",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"html-webpack-plugin": "^5.5.0",
"@babel/preset-env": "^7.23.9",
"@babel/preset-react": "^7.23.3",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"html-webpack-plugin": "^5.6.0",
"jest": "^29.7.0",
"prettier": "2.8.7",
"prettier": "3.2.5",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"webpack": "^5.74.0",
"webpack": "^5.90.3",
"webpack-cli": "5.1.4"
},
"dependencies": {
"@code-dot-org/remark-plugins": "1.2.4",
"minimist": "^1.2.0",
"minimist": "^1.2.8",
"remark-html": "^9.0.0",
"remark-parse": "^6.0.0",
"remark-redactable": "2.0.2",
"remark-stringify": "^6.0.0",
"unified": "^7.0.0",
"unist-util-select": "^2.0.2",
"xtend": "^4.0.1"
"xtend": "^4.0.2"
},
"jest": {
"testEnvironment": "node"
Expand Down
10 changes: 5 additions & 5 deletions src/bin/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ if (helpFlag) {
process.stdout.write("usage: normalize [INFILE] [options]\n");
process.stdout.write("\n");
process.stdout.write(
"Reads content from INFILE if specified, STDIN otherwise.\n"
"Reads content from INFILE if specified, STDIN otherwise.\n",
);
process.stdout.write("Content can be plain text or JSON.\n");
process.stdout.write(
"Content will be parsed as markdown then rendered back to markdown, normalizing it. If the content is JSON, all string values (including those several levels deep) will be normalized.\n"
"Content will be parsed as markdown then rendered back to markdown, normalizing it. If the content is JSON, all string values (including those several levels deep) will be normalized.\n",
);
process.stdout.write("\n");
process.stdout.write("options:\n");
process.stdout.write("\t-h, --help: print this help message\n");
process.stdout.write("\t-o OUTFILE: output to OUTFILE rather than stdout\n");
process.stdout.write(
"\t-p, --parserPlugins PLUGINS: comma-separated list of parser plugins to include in addition to the defaults\n"
"\t-p, --parserPlugins PLUGINS: comma-separated list of parser plugins to include in addition to the defaults\n",
);
process.stdout.write(
"\t-c, --compilerPlugins PLUGINS: comma-separated list of compiler plugins to include in addition to the defaults\n"
"\t-c, --compilerPlugins PLUGINS: comma-separated list of compiler plugins to include in addition to the defaults\n",
);
process.exit();
}
Expand All @@ -46,7 +46,7 @@ if (compilerPlugins) {
function normalize(data) {
return recursivelyProcessAll(
processor.sourceToProcessed.bind(processor),
data
data,
);
}

Expand Down
10 changes: 5 additions & 5 deletions src/bin/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ if (helpFlag) {
process.stdout.write("usage: parse [INFILE] [options]\n");
process.stdout.write("\n");
process.stdout.write(
"Reads content from INFILE if specified, STDIN otherwise.\n"
"Reads content from INFILE if specified, STDIN otherwise.\n",
);
process.stdout.write("Content can be plain text or JSON.\n");
process.stdout.write(
"Content will be parsed from markdown to a Markdown Abstract Syntax Tree (MDAST). If the content is JSON, all string values (including those several levels deep) will be parseed.\n"
"Content will be parsed from markdown to a Markdown Abstract Syntax Tree (MDAST). If the content is JSON, all string values (including those several levels deep) will be parseed.\n",
);
process.stdout.write("\n");
process.stdout.write("options:\n");
process.stdout.write("\t-h, --help: print this help message\n");
process.stdout.write("\t-o OUTFILE: output to OUTFILE rather than stdout\n");
process.stdout.write(
"\t-p, --parserPlugins PLUGINS: comma-separated list of parser plugins to include in addition to the defaults\n"
"\t-p, --parserPlugins PLUGINS: comma-separated list of parser plugins to include in addition to the defaults\n",
);
process.stdout.write(
"\t-c, --compilerPlugins PLUGINS: comma-separated list of compiler plugins to include in addition to the defaults\n"
"\t-c, --compilerPlugins PLUGINS: comma-separated list of compiler plugins to include in addition to the defaults\n",
);
process.exit();
}
Expand All @@ -46,7 +46,7 @@ if (compilerPlugins) {
function parse(data) {
return recursivelyProcessAll(
processor.sourceToSyntaxTree.bind(processor),
data
data,
);
}

Expand Down
12 changes: 6 additions & 6 deletions src/bin/redact.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ if (helpFlag) {
process.stdout.write("usage: redact [INFILE] [options]\n");
process.stdout.write("\n");
process.stdout.write(
"Reads content from INFILE if specified, STDIN otherwise.\n"
"Reads content from INFILE if specified, STDIN otherwise.\n",
);
process.stdout.write("Content can be plain text or JSON.\n");
process.stdout.write(
"Content will be redacted. If the content is JSON, all string values (including those several levels deep) will be redacted.\n"
"Content will be redacted. If the content is JSON, all string values (including those several levels deep) will be redacted.\n",
);
process.stdout.write("\n");
process.stdout.write("options:\n");
process.stdout.write("\t-h, --help: print this help message\n");
process.stdout.write("\t-o OUTFILE: output to OUTFILE rather than stdout\n");
process.stdout.write(
"\t-f, --format [md|txt]: specify format of content (default to markdown)\n"
"\t-f, --format [md|txt]: specify format of content (default to markdown)\n",
);
process.stdout.write(
"\t-p, --parserPlugins PLUGINS: comma-separated list of parser plugins to include in addition to the defaults\n"
"\t-p, --parserPlugins PLUGINS: comma-separated list of parser plugins to include in addition to the defaults\n",
);
process.stdout.write(
"\t-c, --compilerPlugins PLUGINS: comma-separated list of compiler plugins to include in addition to the defaults\n"
"\t-c, --compilerPlugins PLUGINS: comma-separated list of compiler plugins to include in addition to the defaults\n",
);
process.exit();
}
Expand All @@ -59,7 +59,7 @@ if (compilerPlugins) {
function redact(data) {
return recursivelyProcessAll(
processor.sourceToRedacted.bind(processor),
data
data,
);
}

Expand Down
8 changes: 4 additions & 4 deletions src/bin/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ if (helpFlag) {
process.stdout.write("usage: render [INFILE] [options]\n");
process.stdout.write("\n");
process.stdout.write(
"Reads content from INFILE if specified, STDIN otherwise.\n"
"Reads content from INFILE if specified, STDIN otherwise.\n",
);
process.stdout.write("Content can be plain text or JSON.\n");
process.stdout.write(
"Content will be rendered as HTML. If the content is JSON, all string values (including those several levels deep) will be rendered.\n"
"Content will be rendered as HTML. If the content is JSON, all string values (including those several levels deep) will be rendered.\n",
);
process.stdout.write("\n");
process.stdout.write("options:\n");
process.stdout.write("\t-h, --help: print this help message\n");
process.stdout.write("\t-o OUTFILE: output to OUTFILE rather than stdout\n");
process.stdout.write(
"\t-p, --parserPlugins PLUGINS: comma-separated list of parser plugins to include in addition to the defaults\n"
"\t-p, --parserPlugins PLUGINS: comma-separated list of parser plugins to include in addition to the defaults\n",
);
process.stdout.write(
"\t-c, --compilerPlugins PLUGINS: comma-separated list of compiler plugins to include in addition to the defaults\n"
"\t-c, --compilerPlugins PLUGINS: comma-separated list of compiler plugins to include in addition to the defaults\n",
);
process.exit();
}
Expand Down
10 changes: 5 additions & 5 deletions src/bin/restore.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ if (helpFlag || missingRequiredFlags) {
process.stdout.write("\t-h, --help: print this help message\n");
process.stdout.write("\t-o OUTFILE: output to OUTFILE rather than stdout\n");
process.stdout.write(
"\t-f, --format [md|txt]: specify format of content (default to markdown)\n"
"\t-f, --format [md|txt]: specify format of content (default to markdown)\n",
);
process.stdout.write(
"\t-p, --parserPlugins PLUGINS: comma-separated list of parser plugins to include in addition to the defaults\n"
"\t-p, --parserPlugins PLUGINS: comma-separated list of parser plugins to include in addition to the defaults\n",
);
process.stdout.write(
"\t-c, --compilerPlugins PLUGINS: comma-separated list of compiler plugins to include in addition to the defaults\n"
"\t-c, --compilerPlugins PLUGINS: comma-separated list of compiler plugins to include in addition to the defaults\n",
);
process.stdout.write(
"\t--strict Discard restoration if redactions are added or missing"
"\t--strict Discard restoration if redactions are added or missing",
);
process.exit();
}
Expand Down Expand Up @@ -60,7 +60,7 @@ function restore(data) {
return recursivelyProcessAll(
(source, redacted) =>
processor.sourceAndRedactedToRestored(source, redacted, strict),
data
data,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/compiler/TextCompiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = function textCompile(options) {
Local.prototype.options = xtend(
Local.prototype.options,
this.data("settings"),
options
options,
);

// Don't escape text like markdown does
Expand Down
2 changes: 1 addition & 1 deletion src/redactableMarkdownProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = class RedactableMarkdownProcessor extends RedactableProcessor {
const restoredMarkdown = this.sourceAndRedactedToRestored(
source,
redacted,
strict
strict,
);
return this.sourceToHtml(restoredMarkdown);
}
Expand Down
8 changes: 4 additions & 4 deletions src/redactableProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ module.exports = class RedactableProcessor {
// Check that we found as many restorations as redactions
const expectedRedactions = selectAll(
"blockRedaction,inlineRedaction",
sourceTree
sourceTree,
);
const expectedRestorations = selectAll(
"blockRestoration,inlineRestoration",
restorationTree
restorationTree,
);
if (expectedRedactions.length !== expectedRestorations.length) {
return false;
Expand Down Expand Up @@ -119,13 +119,13 @@ module.exports = class RedactableProcessor {
const restorationTree = this.redactedToSyntaxTree(redacted, strict);
const mergedSyntaxTree = this.sourceAndRedactedToMergedSyntaxTree(
sourceTree,
restorationTree
restorationTree,
);
if (strict) {
const valid = this.checkRestorationNodes(
sourceTree,
restorationTree,
mergedSyntaxTree
mergedSyntaxTree,
);
if (!valid) {
return "";
Expand Down
8 changes: 4 additions & 4 deletions test/integration/scripts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ describe("Command-Line Scripts", () => {
const redactedPath = path.resolve(
dataDir,
example,
"redacted" + extension
"redacted" + extension,
);
const translatedPath = path.resolve(
dataDir,
example,
"translated" + extension
"translated" + extension,
);
const restoredPath = path.resolve(
dataDir,
example,
"restored" + extension
"restored" + extension,
);
const normalizedPath = path.resolve(
dataDir,
example,
"normalized" + extension
"normalized" + extension,
);
const pluginPath = path.resolve(dataDir, example, "plugin.js");

Expand Down
4 changes: 2 additions & 2 deletions test/unit/plugins/parser/paragraph.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("paragraph", () => {
const input = `First Paragraph\n${" ".repeat(i)}\nSecondParagraph`;
const output = processor.sourceToHtml(input);
expect(output).toEqual(
"<p>First Paragraph</p>\n<p>SecondParagraph</p>\n"
"<p>First Paragraph</p>\n<p>SecondParagraph</p>\n",
);
}
});
Expand All @@ -18,7 +18,7 @@ describe("paragraph", () => {
const input = `First Paragraph\n${" ".repeat(i)}\nSecondParagraph`;
const output = processor.sourceToHtml(input);
expect(output).toEqual(
"<p>First Paragraph</p>\n<p>SecondParagraph</p>\n"
"<p>First Paragraph</p>\n<p>SecondParagraph</p>\n",
);
}
});
Expand Down
Loading

0 comments on commit 950f7af

Please sign in to comment.