Switch some scripts to ESM (#10867)
This commit is contained in:
1 parent
383f622942
commit
f4a6232848
18 files changed
+139
-134
No files matched your search
@@ -98,6 +98,9 @@ overrides:
|
|||||||
- "**/*.mjs"
|
- "**/*.mjs"
|
||||||
parserOptions:
|
parserOptions:
|
||||||
sourceType: module
|
sourceType: module
|
||||||
|
rules:
|
||||||
|
unicorn/prefer-module: error
|
||||||
|
unicorn/prefer-node-protocol: error
|
||||||
- files:
|
- files:
|
||||||
- "tests/format/**/jsfmt.spec.js"
|
- "tests/format/**/jsfmt.spec.js"
|
||||||
- "tests/config/**/*.js"
|
- "tests/config/**/*.js"
|
||||||
|
|||||||
+5
-4
@@ -115,6 +115,7 @@
|
|||||||
"eslint-plugin-react": "7.23.2",
|
"eslint-plugin-react": "7.23.2",
|
||||||
"eslint-plugin-regexp": "0.10.0",
|
"eslint-plugin-regexp": "0.10.0",
|
||||||
"eslint-plugin-unicorn": "31.0.0",
|
"eslint-plugin-unicorn": "31.0.0",
|
||||||
|
"esm-utils": "1.0.1",
|
||||||
"execa": "5.0.0",
|
"execa": "5.0.0",
|
||||||
"jest": "26.6.3",
|
"jest": "26.6.3",
|
||||||
"jest-snapshot-serializer-ansi": "1.0.0",
|
"jest-snapshot-serializer-ansi": "1.0.0",
|
||||||
@@ -148,15 +149,15 @@
|
|||||||
"lint": "run-p lint:*",
|
"lint": "run-p lint:*",
|
||||||
"lint:typecheck": "tsc",
|
"lint:typecheck": "tsc",
|
||||||
"lint:eslint": "cross-env EFF_NO_LINK_RULES=true eslint . --format friendly",
|
"lint:eslint": "cross-env EFF_NO_LINK_RULES=true eslint . --format friendly",
|
||||||
"lint:changelog": "node ./scripts/lint-changelog.js",
|
"lint:changelog": "node ./scripts/lint-changelog.mjs",
|
||||||
"lint:prettier": "prettier . \"!test*\" --check",
|
"lint:prettier": "prettier . \"!test*\" --check",
|
||||||
"lint:dist": "eslint --no-eslintrc --no-ignore --no-inline-config --env=es6,browser --parser-options=ecmaVersion:2019 \"dist/!(bin-prettier|index|third-party).js\"",
|
"lint:dist": "eslint --no-eslintrc --no-ignore --no-inline-config --env=es6,browser --parser-options=ecmaVersion:2019 \"dist/!(bin-prettier|index|third-party).js\"",
|
||||||
"lint:spellcheck": "cspell \"**/*\" \".github/**/*\"",
|
"lint:spellcheck": "cspell \"**/*\" \".github/**/*\"",
|
||||||
"lint:deps": "node ./scripts/check-deps.js",
|
"lint:deps": "node ./scripts/check-deps.mjs",
|
||||||
"fix": "run-s fix:eslint fix:prettier",
|
"fix": "run-s fix:eslint fix:prettier",
|
||||||
"fix:eslint": "yarn lint:eslint --fix",
|
"fix:eslint": "yarn lint:eslint --fix",
|
||||||
"fix:prettier": "yarn lint:prettier --write",
|
"fix:prettier": "yarn lint:prettier --write",
|
||||||
"build": "node --max-old-space-size=3072 ./scripts/build/build.js",
|
"build": "node --max-old-space-size=3072 ./scripts/build/build.mjs",
|
||||||
"build-docs": "node ./scripts/build-docs.js"
|
"build-docs": "node ./scripts/build-docs.mjs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
"use strict";
|
import path from "node:path";
|
||||||
|
import fs from "node:fs";
|
||||||
const path = require("path");
|
import shell from "shelljs";
|
||||||
const fs = require("fs");
|
import globby from "globby";
|
||||||
const shell = require("shelljs");
|
import prettier from "prettier";
|
||||||
const globby = require("globby");
|
import createEsmUtils from "esm-utils";
|
||||||
const prettier = require("prettier");
|
|
||||||
|
|
||||||
shell.config.fatal = true;
|
shell.config.fatal = true;
|
||||||
|
|
||||||
|
const { __dirname, require } = createEsmUtils(import.meta);
|
||||||
const rootDir = path.join(__dirname, "..");
|
const rootDir = path.join(__dirname, "..");
|
||||||
const docs = path.join(rootDir, "website/static/lib");
|
const docs = path.join(rootDir, "website/static/lib");
|
||||||
|
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
"use strict";
|
#!/usr/bin/env node
|
||||||
|
|
||||||
const path = require("path");
|
import path from "node:path";
|
||||||
const fs = require("fs").promises;
|
import fs from "node:fs/promises";
|
||||||
const readline = require("readline");
|
import readline from "node:readline";
|
||||||
const chalk = require("chalk");
|
import chalk from "chalk";
|
||||||
const execa = require("execa");
|
import execa from "execa";
|
||||||
const minimist = require("minimist");
|
import minimist from "minimist";
|
||||||
|
import prettyBytes from "pretty-bytes";
|
||||||
const bundler = require("./bundler");
|
import bundler from "./bundler.mjs";
|
||||||
const bundleConfigs = require("./config");
|
import bundleConfigs from "./config.mjs";
|
||||||
const util = require("./util");
|
import * as utils from "./utils.mjs";
|
||||||
const Cache = require("./cache");
|
import Cache from "./cache.mjs";
|
||||||
|
|
||||||
// Errors in promises should be fatal.
|
// Errors in promises should be fatal.
|
||||||
const loggedErrors = new Set();
|
const loggedErrors = new Set();
|
||||||
@@ -84,7 +84,6 @@ async function createBundle(bundleConfig, cache, options) {
|
|||||||
readline.clearLine(process.stdout, 0);
|
readline.clearLine(process.stdout, 0);
|
||||||
readline.cursorTo(process.stdout, 0, null);
|
readline.cursorTo(process.stdout, 0, null);
|
||||||
|
|
||||||
const prettyBytes = require("pretty-bytes");
|
|
||||||
const getSizeText = async (file) =>
|
const getSizeText = async (file) =>
|
||||||
prettyBytes((await fs.stat(file)).size);
|
prettyBytes((await fs.stat(file)).size);
|
||||||
const sizeTexts = [await getSizeText(file)];
|
const sizeTexts = [await getSizeText(file)];
|
||||||
@@ -133,7 +132,7 @@ async function cacheFiles(cache) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function preparePackage() {
|
async function preparePackage() {
|
||||||
const pkg = await util.readJson("package.json");
|
const pkg = await utils.readJson("package.json");
|
||||||
pkg.bin = "./bin-prettier.js";
|
pkg.bin = "./bin-prettier.js";
|
||||||
pkg.engines.node = ">=10.13.0";
|
pkg.engines.node = ">=10.13.0";
|
||||||
delete pkg.dependencies;
|
delete pkg.dependencies;
|
||||||
@@ -143,10 +142,10 @@ async function preparePackage() {
|
|||||||
"node -e \"assert.equal(require('.').version, require('..').version)\"",
|
"node -e \"assert.equal(require('.').version, require('..').version)\"",
|
||||||
};
|
};
|
||||||
pkg.files = ["*.js", "esm/*.mjs"];
|
pkg.files = ["*.js", "esm/*.mjs"];
|
||||||
await util.writeJson("dist/package.json", pkg);
|
await utils.writeJson("dist/package.json", pkg);
|
||||||
|
|
||||||
await util.copyFile("./README.md", "./dist/README.md");
|
await utils.copyFile("./README.md", "./dist/README.md");
|
||||||
await util.copyFile("./LICENSE", "./dist/LICENSE");
|
await utils.copyFile("./LICENSE", "./dist/LICENSE");
|
||||||
}
|
}
|
||||||
|
|
||||||
async function run(params) {
|
async function run(params) {
|
||||||
@@ -1,21 +1,22 @@
|
|||||||
"use strict";
|
import path from "node:path";
|
||||||
|
import fs from "node:fs";
|
||||||
const path = require("path");
|
import { rollup } from "rollup";
|
||||||
const fs = require("fs");
|
import webpack from "webpack";
|
||||||
const { rollup } = require("rollup");
|
import { nodeResolve as rollupPluginNodeResolve } from "@rollup/plugin-node-resolve";
|
||||||
const webpack = require("webpack");
|
import rollupPluginAlias from "@rollup/plugin-alias";
|
||||||
const { nodeResolve } = require("@rollup/plugin-node-resolve");
|
import rollupPluginCommonjs from "@rollup/plugin-commonjs";
|
||||||
const rollupPluginAlias = require("@rollup/plugin-alias");
|
import rollupPluginPolyfillNode from "rollup-plugin-polyfill-node";
|
||||||
const commonjs = require("@rollup/plugin-commonjs");
|
import rollupPluginJson from "@rollup/plugin-json";
|
||||||
const rollupPluginPolyfillNode = require("rollup-plugin-polyfill-node");
|
import rollupPluginReplace from "@rollup/plugin-replace";
|
||||||
const json = require("@rollup/plugin-json");
|
import { terser as rollupPluginTerser } from "rollup-plugin-terser";
|
||||||
const replace = require("@rollup/plugin-replace");
|
import { babel as rollupPluginBabel } from "@rollup/plugin-babel";
|
||||||
const { terser } = require("rollup-plugin-terser");
|
import WebpackPluginTerser from "terser-webpack-plugin";
|
||||||
const { babel } = require("@rollup/plugin-babel");
|
import createEsmUtils from "esm-utils";
|
||||||
const executable = require("./rollup-plugins/executable");
|
import rollupPluginExecutable from "./rollup-plugins/executable.mjs";
|
||||||
const evaluate = require("./rollup-plugins/evaluate");
|
import rollupPluginEvaluate from "./rollup-plugins/evaluate.mjs";
|
||||||
const externals = require("./rollup-plugins/externals");
|
import rollupPluginExternals from "./rollup-plugins/externals.mjs";
|
||||||
|
|
||||||
|
const { __dirname, require } = createEsmUtils(import.meta);
|
||||||
const PROJECT_ROOT = path.join(__dirname, "../..");
|
const PROJECT_ROOT = path.join(__dirname, "../..");
|
||||||
|
|
||||||
const EXTERNALS = [
|
const EXTERNALS = [
|
||||||
@@ -195,20 +196,20 @@ function getRollupConfig(bundle) {
|
|||||||
alias.entries = [...entries, ...(alias.entries || [])];
|
alias.entries = [...entries, ...(alias.entries || [])];
|
||||||
|
|
||||||
config.plugins = [
|
config.plugins = [
|
||||||
replace({
|
rollupPluginReplace({
|
||||||
values: replaceStrings,
|
values: replaceStrings,
|
||||||
delimiters: ["", ""],
|
delimiters: ["", ""],
|
||||||
preventAssignment: true,
|
preventAssignment: true,
|
||||||
}),
|
}),
|
||||||
executable(),
|
rollupPluginExecutable(),
|
||||||
evaluate(),
|
rollupPluginEvaluate(),
|
||||||
json(),
|
rollupPluginJson(),
|
||||||
rollupPluginAlias(alias),
|
rollupPluginAlias(alias),
|
||||||
nodeResolve({
|
rollupPluginNodeResolve({
|
||||||
extensions: [".js", ".json"],
|
extensions: [".js", ".json"],
|
||||||
preferBuiltins: bundle.target === "node",
|
preferBuiltins: bundle.target === "node",
|
||||||
}),
|
}),
|
||||||
commonjs({
|
rollupPluginCommonjs({
|
||||||
ignoreGlobal: bundle.target === "node",
|
ignoreGlobal: bundle.target === "node",
|
||||||
...bundle.commonjs,
|
...bundle.commonjs,
|
||||||
ignore:
|
ignore:
|
||||||
@@ -217,12 +218,12 @@ function getRollupConfig(bundle) {
|
|||||||
: (id) => /\.\/parser-.*?/.test(id),
|
: (id) => /\.\/parser-.*?/.test(id),
|
||||||
requireReturnsDefault: "preferred",
|
requireReturnsDefault: "preferred",
|
||||||
}),
|
}),
|
||||||
externals(bundle.externals),
|
rollupPluginExternals(bundle.externals),
|
||||||
bundle.target === "universal" && rollupPluginPolyfillNode(),
|
bundle.target === "universal" && rollupPluginPolyfillNode(),
|
||||||
babel(babelConfig),
|
rollupPluginBabel(babelConfig),
|
||||||
bundle.minify !== false &&
|
bundle.minify !== false &&
|
||||||
bundle.target === "universal" &&
|
bundle.target === "universal" &&
|
||||||
terser({
|
rollupPluginTerser({
|
||||||
output: {
|
output: {
|
||||||
ascii_only: true,
|
ascii_only: true,
|
||||||
},
|
},
|
||||||
@@ -311,8 +312,9 @@ function getWebpackConfig(bundle) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (bundle.terserOptions) {
|
if (bundle.terserOptions) {
|
||||||
const TerserPlugin = require("terser-webpack-plugin");
|
config.optimization.minimizer = [
|
||||||
config.optimization.minimizer = [new TerserPlugin(bundle.terserOptions)];
|
new WebpackPluginTerser(bundle.terserOptions),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
// config.optimization.minimize = false;
|
// config.optimization.minimize = false;
|
||||||
|
|
||||||
@@ -345,7 +347,7 @@ function runWebpack(config) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = async function createBundle(bundle, cache, options) {
|
async function createBundle(bundle, cache, options) {
|
||||||
const inputOptions = getRollupConfig(bundle);
|
const inputOptions = getRollupConfig(bundle);
|
||||||
const outputOptions = getRollupOutputOptions(bundle, options);
|
const outputOptions = getRollupOutputOptions(bundle, options);
|
||||||
|
|
||||||
@@ -374,4 +376,6 @@ module.exports = async function createBundle(bundle, cache, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return { bundled: true };
|
return { bundled: true };
|
||||||
};
|
}
|
||||||
|
|
||||||
|
export default createBundle;
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
"use strict";
|
import { strict as assert } from "node:assert";
|
||||||
|
import crypto from "node:crypto";
|
||||||
const assert = require("assert").strict;
|
import fs from "node:fs/promises";
|
||||||
const crypto = require("crypto");
|
import path from "node:path";
|
||||||
const fs = require("fs").promises;
|
import execa from "execa";
|
||||||
const path = require("path");
|
import { rollup } from "rollup";
|
||||||
const execa = require("execa");
|
import createEsmUtils from "esm-utils";
|
||||||
const { rollup } = require("rollup");
|
|
||||||
|
|
||||||
|
const { __dirname } = createEsmUtils(import.meta);
|
||||||
const ROOT = path.join(__dirname, "..", "..");
|
const ROOT = path.join(__dirname, "..", "..");
|
||||||
|
|
||||||
class Cache {
|
class Cache {
|
||||||
@@ -146,4 +146,4 @@ function getRollupConfig(rollupConfig) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Cache;
|
export default Cache;
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
"use strict";
|
import path from "node:path";
|
||||||
|
|
||||||
const path = require("path");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Bundle
|
* @typedef {Object} Bundle
|
||||||
@@ -171,7 +169,7 @@ function getFileOutput(bundle) {
|
|||||||
return bundle.output || path.basename(bundle.input);
|
return bundle.output || path.basename(bundle.input);
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = [...coreBundles, ...parsers].map((bundle) => ({
|
export default [...coreBundles, ...parsers].map((bundle) => ({
|
||||||
...bundle,
|
...bundle,
|
||||||
output: getFileOutput(bundle),
|
output: getFileOutput(bundle),
|
||||||
}));
|
}));
|
||||||
+5
-3
@@ -1,6 +1,8 @@
|
|||||||
"use strict";
|
import createEsmUtils from "esm-utils";
|
||||||
|
|
||||||
module.exports = function () {
|
const { require } = createEsmUtils(import.meta);
|
||||||
|
|
||||||
|
export default function () {
|
||||||
return {
|
return {
|
||||||
name: "evaluate",
|
name: "evaluate",
|
||||||
|
|
||||||
@@ -25,4 +27,4 @@ module.exports = function () {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
+4
-6
@@ -1,9 +1,7 @@
|
|||||||
"use strict";
|
import fs from "node:fs";
|
||||||
|
import path from "node:path";
|
||||||
|
|
||||||
const fs = require("fs");
|
export default function () {
|
||||||
const path = require("path");
|
|
||||||
|
|
||||||
module.exports = function () {
|
|
||||||
let banner;
|
let banner;
|
||||||
let entry;
|
let entry;
|
||||||
let file;
|
let file;
|
||||||
@@ -46,4 +44,4 @@ module.exports = function () {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
+3
-5
@@ -1,8 +1,6 @@
|
|||||||
"use strict";
|
import path from "node:path";
|
||||||
|
|
||||||
const path = require("path");
|
export default function (modules = []) {
|
||||||
|
|
||||||
module.exports = function (modules = []) {
|
|
||||||
const requires = modules.reduce((obj, mod) => {
|
const requires = modules.reduce((obj, mod) => {
|
||||||
obj[mod] = path.basename(mod).replace(/\.js$/, "");
|
obj[mod] = path.basename(mod).replace(/\.js$/, "");
|
||||||
return obj;
|
return obj;
|
||||||
@@ -17,4 +15,4 @@ module.exports = function (modules = []) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
"use strict";
|
import fs from "node:fs/promises";
|
||||||
|
|
||||||
const fs = require("fs").promises;
|
|
||||||
|
|
||||||
async function readJson(file) {
|
async function readJson(file) {
|
||||||
const data = await fs.readFile(file);
|
const data = await fs.readFile(file);
|
||||||
@@ -17,8 +15,4 @@ async function copyFile(from, to) {
|
|||||||
return fs.writeFile(to, data);
|
return fs.writeFile(to, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
export { readJson, writeJson, copyFile };
|
||||||
readJson,
|
|
||||||
writeJson,
|
|
||||||
copyFile,
|
|
||||||
};
|
|
||||||
@@ -1,10 +1,14 @@
|
|||||||
"use strict";
|
import fs from "node:fs/promises";
|
||||||
|
import chalk from "chalk";
|
||||||
|
|
||||||
const chalk = require("chalk");
|
(async () => {
|
||||||
const pkg = require("../package.json");
|
const packageJson = JSON.parse(
|
||||||
|
await fs.readFile(new URL("../package.json", import.meta))
|
||||||
|
);
|
||||||
|
|
||||||
validateDependencyObject(pkg.dependencies);
|
validateDependencyObject(packageJson.dependencies);
|
||||||
validateDependencyObject(pkg.devDependencies);
|
validateDependencyObject(packageJson.devDependencies);
|
||||||
|
})();
|
||||||
|
|
||||||
function validateDependencyObject(object) {
|
function validateDependencyObject(object) {
|
||||||
for (const key of Object.keys(object)) {
|
for (const key of Object.keys(object)) {
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
const path = require("path");
|
|
||||||
const globby = require("globby");
|
|
||||||
|
|
||||||
const changelogUnreleasedDir = path.join(__dirname, "../changelog_unreleased");
|
|
||||||
|
|
||||||
const files = globby.sync(["blog-post-intro.md", "*/*.md"], {
|
|
||||||
cwd: changelogUnreleasedDir,
|
|
||||||
absolute: true,
|
|
||||||
});
|
|
||||||
for (const file of files) {
|
|
||||||
fs.unlinkSync(file);
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
import fs from "node:fs";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
import globby from "globby";
|
||||||
|
|
||||||
|
const changelogUnreleasedDir = fileURLToPath(
|
||||||
|
new URL("../changelog_unreleased", import.meta.url)
|
||||||
|
);
|
||||||
|
|
||||||
|
const files = globby.sync(["blog-post-intro.md", "*/*.md"], {
|
||||||
|
cwd: changelogUnreleasedDir,
|
||||||
|
absolute: true,
|
||||||
|
});
|
||||||
|
for (const file of files) {
|
||||||
|
fs.unlinkSync(file);
|
||||||
|
}
|
||||||
@@ -1,19 +1,16 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
"use strict";
|
import fs from "node:fs/promises";
|
||||||
|
import execa from "execa";
|
||||||
|
|
||||||
const fs = require("fs");
|
const CSPELL_CONFIG_FILE = new URL("../cspell.json", import.meta.url);
|
||||||
const path = require("path");
|
|
||||||
const execa = require("execa");
|
|
||||||
|
|
||||||
const CSPELL_CONFIG_FILE = path.join(__dirname, "../cspell.json");
|
const updateConfig = async (config) =>
|
||||||
|
await fs.writeFile(CSPELL_CONFIG_FILE, JSON.stringify(config, undefined, 4));
|
||||||
const updateConfig = (config) =>
|
|
||||||
fs.writeFileSync(CSPELL_CONFIG_FILE, JSON.stringify(config, undefined, 4));
|
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
console.log("Empty words ...");
|
console.log("Empty words ...");
|
||||||
const config = JSON.parse(fs.readFileSync(CSPELL_CONFIG_FILE, "utf8"));
|
const config = JSON.parse(await fs.readFile(CSPELL_CONFIG_FILE, "utf8"));
|
||||||
updateConfig({ ...config, words: [] });
|
updateConfig({ ...config, words: [] });
|
||||||
|
|
||||||
console.log("Running spellcheck with empty words ...");
|
console.log("Running spellcheck with empty words ...");
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
"use strict";
|
import fs from "node:fs";
|
||||||
|
import path from "node:path";
|
||||||
const fs = require("fs");
|
import rimraf from "rimraf";
|
||||||
const path = require("path");
|
import semver from "semver";
|
||||||
const rimraf = require("rimraf");
|
import createEsmUtils from "esm-utils";
|
||||||
const semver = require("semver");
|
|
||||||
|
|
||||||
|
const { __dirname, require } = createEsmUtils(import.meta);
|
||||||
const changelogUnreleasedDir = path.join(__dirname, "../changelog_unreleased");
|
const changelogUnreleasedDir = path.join(__dirname, "../changelog_unreleased");
|
||||||
const blogDir = path.join(__dirname, "../website/blog");
|
const blogDir = path.join(__dirname, "../website/blog");
|
||||||
const introTemplateFile = path.join(
|
const introTemplateFile = path.join(
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
"use strict";
|
|
||||||
const fs = require("fs");
|
|
||||||
const path = require("path");
|
|
||||||
const { outdent } = require("outdent");
|
|
||||||
|
|
||||||
|
import path from "node:path";
|
||||||
|
import fs from "node:fs";
|
||||||
|
import { outdent } from "outdent";
|
||||||
|
import createEsmUtils from "esm-utils";
|
||||||
|
|
||||||
|
const { __dirname } = createEsmUtils(import.meta);
|
||||||
const CHANGELOG_DIR = "changelog_unreleased";
|
const CHANGELOG_DIR = "changelog_unreleased";
|
||||||
const TEMPLATE_FILE = "TEMPLATE.md";
|
const TEMPLATE_FILE = "TEMPLATE.md";
|
||||||
const BLOG_POST_INTRO_TEMPLATE_FILE = "BLOG_POST_INTRO_TEMPLATE.md";
|
const BLOG_POST_INTRO_TEMPLATE_FILE = "BLOG_POST_INTRO_TEMPLATE.md";
|
||||||
@@ -3263,6 +3263,11 @@ eslint@7.26.0:
|
|||||||
text-table "^0.2.0"
|
text-table "^0.2.0"
|
||||||
v8-compile-cache "^2.0.3"
|
v8-compile-cache "^2.0.3"
|
||||||
|
|
||||||
|
esm-utils@1.0.1:
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/esm-utils/-/esm-utils-1.0.1.tgz#297085fbb352140c70789744c0b858fd43f0b391"
|
||||||
|
integrity sha512-flJFfIoZmKFiz2wqz++NVT4rUia3ht80fDKmixuhmvCdf4JZyAx9RO5SSzfZY5Rv7/vBhB1xYzzFUM5qt1MBBg==
|
||||||
|
|
||||||
espree@7.3.1, espree@^7.3.0, espree@^7.3.1:
|
espree@7.3.1, espree@^7.3.0, espree@^7.3.1:
|
||||||
version "7.3.1"
|
version "7.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6"
|
resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6"
|
||||||
|
|||||||
Reference in new issue
Block a user