Rename .mjs files to .js (#14605)
This commit is contained in:
1 parent
47f4e59fc0
commit
186a177017
41 files changed
+39
-44
No files matched your search
+2
-2
@@ -127,7 +127,7 @@ module.exports = {
|
||||
"error",
|
||||
{
|
||||
devDependencies: [
|
||||
"jest.config.mjs",
|
||||
"jest.config.js",
|
||||
"tests/**",
|
||||
"scripts/**",
|
||||
"website/**/*",
|
||||
@@ -260,7 +260,7 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["scripts/**/*.mjs"],
|
||||
files: ["scripts/**/*.js"],
|
||||
rules: {
|
||||
"unicorn/prefer-top-level-await": "error",
|
||||
},
|
||||
|
||||
File renamed without changes.
+4
-4
@@ -168,15 +168,15 @@
|
||||
"lint": "run-p \"lint:*\"",
|
||||
"lint:typecheck": "tsc",
|
||||
"lint:eslint": "cross-env EFF_NO_LINK_RULES=true eslint . --format friendly",
|
||||
"lint:changelog": "node ./scripts/lint-changelog.mjs",
|
||||
"lint:changelog": "node ./scripts/lint-changelog.js",
|
||||
"lint:prettier": "prettier . \"!test*\" --check",
|
||||
"lint:spellcheck": "cspell --no-progress --relative --dot --gitignore",
|
||||
"lint:deps": "node ./scripts/check-deps.mjs",
|
||||
"lint:deps": "node ./scripts/check-deps.js",
|
||||
"fix": "run-s fix:eslint fix:prettier",
|
||||
"fix:eslint": "yarn lint:eslint --fix",
|
||||
"fix:prettier": "yarn lint:prettier --write",
|
||||
"build": "node ./scripts/build/build.mjs",
|
||||
"build:website": "node ./scripts/build-website.mjs"
|
||||
"build": "node ./scripts/build/build.js",
|
||||
"build:website": "node ./scripts/build-website.js"
|
||||
},
|
||||
"c8": {
|
||||
"reporter": [
|
||||
|
||||
File renamed without changes.
@@ -18,8 +18,8 @@ for commit in "${commits[@]}"; do
|
||||
rm -rf $commit
|
||||
git -C "$root" archive $commit --prefix $commit/ ':!tests*' ':!website' ':!docs' | tar -x
|
||||
(cd $commit; yarn; yarn build)
|
||||
args+=("node ./bench.mjs $commit serial")
|
||||
args+=("node ./bench.mjs $commit parallel")
|
||||
args+=("node ./bench.js $commit serial")
|
||||
args+=("node ./bench.js $commit parallel")
|
||||
done
|
||||
|
||||
hyperfine --warmup 3 "${args[@]}"
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
writeJson,
|
||||
copyFile,
|
||||
writeFile,
|
||||
} from "./utils/index.mjs";
|
||||
} from "./utils/index.js";
|
||||
|
||||
const { require } = createEsmUtils(import.meta);
|
||||
const runYarn = (command, args, options) =>
|
||||
@@ -4,16 +4,16 @@ import createEsmUtils from "esm-utils";
|
||||
import esbuild from "esbuild";
|
||||
import { NodeModulesPolyfillPlugin as esbuildPluginNodeModulePolyfills } from "@esbuild-plugins/node-modules-polyfill";
|
||||
import browserslistToEsbuild from "browserslist-to-esbuild";
|
||||
import { PROJECT_ROOT, DIST_DIR } from "../utils/index.mjs";
|
||||
import esbuildPluginEvaluate from "./esbuild-plugins/evaluate.mjs";
|
||||
import esbuildPluginReplaceModule from "./esbuild-plugins/replace-module.mjs";
|
||||
import esbuildPluginLicense from "./esbuild-plugins/license.mjs";
|
||||
import esbuildPluginUmd from "./esbuild-plugins/umd.mjs";
|
||||
import esbuildPluginVisualizer from "./esbuild-plugins/visualizer.mjs";
|
||||
import esbuildPluginStripNodeProtocol from "./esbuild-plugins/strip-node-protocol.mjs";
|
||||
import esbuildPluginThrowWarnings from "./esbuild-plugins/throw-warnings.mjs";
|
||||
import esbuildPluginShimCommonjsObjects from "./esbuild-plugins/shim-commonjs-objects.mjs";
|
||||
import esbuildPluginPrimitiveDefine from "./esbuild-plugins/primitive-define.mjs";
|
||||
import { PROJECT_ROOT, DIST_DIR } from "../utils/index.js";
|
||||
import esbuildPluginEvaluate from "./esbuild-plugins/evaluate.js";
|
||||
import esbuildPluginReplaceModule from "./esbuild-plugins/replace-module.js";
|
||||
import esbuildPluginLicense from "./esbuild-plugins/license.js";
|
||||
import esbuildPluginUmd from "./esbuild-plugins/umd.js";
|
||||
import esbuildPluginVisualizer from "./esbuild-plugins/visualizer.js";
|
||||
import esbuildPluginStripNodeProtocol from "./esbuild-plugins/strip-node-protocol.js";
|
||||
import esbuildPluginThrowWarnings from "./esbuild-plugins/throw-warnings.js";
|
||||
import esbuildPluginShimCommonjsObjects from "./esbuild-plugins/shim-commonjs-objects.js";
|
||||
import esbuildPluginPrimitiveDefine from "./esbuild-plugins/primitive-define.js";
|
||||
import transform from "./transform/index.js";
|
||||
import { getPackageFile } from "./utils.js";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import path from "node:path";
|
||||
import fs from "node:fs/promises";
|
||||
import { outdent } from "outdent";
|
||||
import { DIST_DIR, PROJECT_ROOT } from "../utils/index.mjs";
|
||||
import { DIST_DIR, PROJECT_ROOT } from "../utils/index.js";
|
||||
|
||||
const PROJECT_LICENSE_FILE = path.join(PROJECT_ROOT, "LICENSE");
|
||||
const LICENSE_FILE = path.join(DIST_DIR, "LICENSE");
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import path from "node:path";
|
||||
import {
|
||||
PROJECT_ROOT,
|
||||
DIST_DIR,
|
||||
readJson,
|
||||
writeJson,
|
||||
} from "../utils/index.mjs";
|
||||
import { PROJECT_ROOT, DIST_DIR, readJson, writeJson } from "../utils/index.js";
|
||||
|
||||
const keysToKeep = [
|
||||
"name",
|
||||
|
||||
@@ -3,7 +3,7 @@ import path from "node:path";
|
||||
import url from "node:url";
|
||||
import { isValidIdentifier } from "@babel/types";
|
||||
import { outdent } from "outdent";
|
||||
import { PROJECT_ROOT, DIST_DIR, writeFile } from "../utils/index.mjs";
|
||||
import { PROJECT_ROOT, DIST_DIR, writeFile } from "../utils/index.js";
|
||||
|
||||
async function typesFileBuilder({ file }) {
|
||||
/**
|
||||
|
||||
@@ -7,8 +7,8 @@ import chalk from "chalk";
|
||||
import minimist from "minimist";
|
||||
import prettyBytes from "pretty-bytes";
|
||||
import createEsmUtils from "esm-utils";
|
||||
import { DIST_DIR } from "../utils/index.mjs";
|
||||
import files from "./config.mjs";
|
||||
import { DIST_DIR } from "../utils/index.js";
|
||||
import files from "./config.js";
|
||||
|
||||
const { require } = createEsmUtils(import.meta);
|
||||
|
||||
@@ -3,12 +3,12 @@ import url from "node:url";
|
||||
import fs from "node:fs";
|
||||
import { createRequire } from "node:module";
|
||||
import createEsmUtils from "esm-utils";
|
||||
import { PROJECT_ROOT, DIST_DIR, copyFile } from "../utils/index.mjs";
|
||||
import { PROJECT_ROOT, DIST_DIR, copyFile } from "../utils/index.js";
|
||||
import buildJavascriptModule from "./build-javascript-module.js";
|
||||
import buildPackageJson from "./build-package-json.js";
|
||||
import buildLicense from "./build-license.js";
|
||||
import buildTypes from "./build-types.js";
|
||||
import modifyTypescriptModule from "./modify-typescript-module.mjs";
|
||||
import modifyTypescriptModule from "./modify-typescript-module.js";
|
||||
import { getPackageFile } from "./utils.js";
|
||||
|
||||
const {
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -2,7 +2,7 @@ import path from "node:path";
|
||||
import escapeStringRegexp from "escape-string-regexp";
|
||||
import { outdent } from "outdent";
|
||||
import MagicString from "magic-string";
|
||||
import { writeFile, PROJECT_ROOT } from "../utils/index.mjs";
|
||||
import { writeFile, PROJECT_ROOT } from "../utils/index.js";
|
||||
|
||||
function* getModules(text) {
|
||||
const parts = text.split(/(?<=\n)( {2}\/\/ src\/\S+\n)/);
|
||||
@@ -2,7 +2,7 @@ import { parse } from "@babel/parser";
|
||||
import { traverseFast as traverse } from "@babel/types";
|
||||
import babelGenerator from "@babel/generator";
|
||||
import { outdent } from "outdent";
|
||||
import { SOURCE_DIR } from "../../utils/index.mjs";
|
||||
import { SOURCE_DIR } from "../../utils/index.js";
|
||||
import allTransforms from "./transforms/index.js";
|
||||
|
||||
const generate = babelGenerator.default;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import path from "node:path";
|
||||
import fs from "node:fs";
|
||||
import { PROJECT_ROOT } from "../utils/index.mjs";
|
||||
import { PROJECT_ROOT } from "../utils/index.js";
|
||||
|
||||
function getPackageFile(file) {
|
||||
const resolved = path.join(PROJECT_ROOT, `node_modules/${file}`);
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
getEntries,
|
||||
printEntries,
|
||||
replaceVersions,
|
||||
} from "./utils/changelog.mjs";
|
||||
} from "./utils/changelog.js";
|
||||
|
||||
const { previousVersion, newVersion } = parseArgv();
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -10,7 +10,7 @@ import {
|
||||
changelogUnreleasedDirPath,
|
||||
changelogUnreleasedDirs,
|
||||
printEntries,
|
||||
} from "./utils/changelog.mjs";
|
||||
} from "./utils/changelog.js";
|
||||
|
||||
const { __dirname, require } = createEsmUtils(import.meta);
|
||||
const blogDir = path.join(__dirname, "../website/blog");
|
||||
@@ -13,7 +13,7 @@ import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import createEsmUtils from "esm-utils";
|
||||
import enquirer from "enquirer";
|
||||
import { CHANGELOG_CATEGORIES } from "./utils/changelog-categories.mjs";
|
||||
import { CHANGELOG_CATEGORIES } from "./utils/changelog-categories.js";
|
||||
|
||||
const { __dirname } = createEsmUtils(import.meta);
|
||||
|
||||
File renamed without changes.
@@ -5,7 +5,7 @@ import fs from "node:fs";
|
||||
import { outdent } from "outdent";
|
||||
import createEsmUtils from "esm-utils";
|
||||
import { LinesAndColumns } from "lines-and-columns";
|
||||
import { CHANGELOG_CATEGORIES } from "./utils/changelog-categories.mjs";
|
||||
import { CHANGELOG_CATEGORIES } from "./utils/changelog-categories.js";
|
||||
|
||||
const { __dirname } = createEsmUtils(import.meta);
|
||||
const CHANGELOG_DIR = "changelog_unreleased";
|
||||
@@ -12,7 +12,7 @@ const EDIT_URL = `https://github.com/${SCHEMA_REPO}/edit/master/${SCHEMA_PATH}`;
|
||||
|
||||
async function checkSchema() {
|
||||
const { stdout: schema } = await execa("node", [
|
||||
"scripts/generate-schema.mjs",
|
||||
"scripts/generate-schema.js",
|
||||
]);
|
||||
const remoteSchema = await logPromise(
|
||||
"Checking current schema in SchemaStore",
|
||||
|
||||
@@ -18,7 +18,7 @@ function writeChangelog(params) {
|
||||
|
||||
async function getChangelogForPatch({ version, previousVersion }) {
|
||||
const { stdout: changelog } = await execa("node", [
|
||||
"scripts/changelog-for-patch.mjs",
|
||||
"scripts/changelog-for-patch.js",
|
||||
"--prev-version",
|
||||
previousVersion,
|
||||
"--new-version",
|
||||
|
||||
@@ -2,8 +2,8 @@ import url from "node:url";
|
||||
import path from "node:path";
|
||||
import { createRequire } from "node:module";
|
||||
import webpack from "webpack";
|
||||
import { DIST_DIR } from "../../utils/index.mjs";
|
||||
import files from "../../build/config.mjs";
|
||||
import { DIST_DIR } from "../../utils/index.js";
|
||||
import files from "../../build/config.js";
|
||||
|
||||
function runWebpack(config) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,5 @@
|
||||
import prettier from "../../config/prettier-entry.js";
|
||||
import generateSchema from "../../../scripts/utils/generate-schema.mjs";
|
||||
import generateSchema from "../../../scripts/utils/generate-schema.js";
|
||||
|
||||
test("schema", async () => {
|
||||
const { options } = await prettier.getSupportInfo();
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
"exclude": [
|
||||
"coverage/",
|
||||
"test*.*",
|
||||
"jest.config.mjs",
|
||||
"jest.config.js",
|
||||
// [TBD] JavaScript sources *not* affected by src/language-*:
|
||||
"src/main/ast-to-doc.js",
|
||||
"src/main/core.js",
|
||||
|
||||
Reference in new issue
Block a user