Skip to content

Commit

Permalink
Merge pull request #75 from jsenv/update_deps
Browse files Browse the repository at this point in the history
Update deps
  • Loading branch information
dmail authored Jul 25, 2024
2 parents 1a55876 + ad3a5aa commit 21d9b44
Show file tree
Hide file tree
Showing 297 changed files with 1,990 additions and 1,341 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
/scripts/performance/**/fake_project/
/experiment/**/dist/
/tests/**/root/
/tests/**/input/
/node_modules/
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04, macos-12, windows-2022]
node: [20.8.0]
node: [22.3.0]
runs-on: ${{ matrix.os }}
name: test on ${{ matrix.os }} and node ${{ matrix.node }}
env:
Expand All @@ -55,7 +55,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "20.8.0"
node-version: "22.3.0"
- name: Install node modules
run: npm install
- name: Publish package
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/performance_impact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
# "setup-node@v3" documentation available at https://github.com/actions/setup-node
uses: actions/setup-node@v3
with:
node-version: "20.8.0"
node-version: "22.3.0"
- name: Install node modules
run: npm install
- name: Report performance impact
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/report_performance_impact.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import {
reportPerformanceImpact,
readGitHubWorkflowEnv,
reportPerformanceImpact,
} from "@jsenv/performance-impact";

await reportPerformanceImpact({
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@

.DS_Store

**/git_ignored/
/todo.txt

2 changes: 2 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
trailingComma: "all"
quoteProps: "consistent"
plugins: ["prettier-plugin-organize-imports"]
organizeImportsSkipDestructiveCodeActions: true
2 changes: 1 addition & 1 deletion experiment/getImportMapFromFile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assertAndNormalizeDirectoryUrl, readFile } from "@jsenv/filesystem";
import { resolveUrl } from "@jsenv/urls";
import { moveImportMap, sortImportMap } from "@jsenv/importmap";
import { resolveUrl } from "@jsenv/urls";

export const getImportMapFromFile = async ({
projectDirectoryUrl,
Expand Down
2 changes: 1 addition & 1 deletion experiment/lit_typescript/dist/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-unused-vars */
import { html, css } from "lit";
import { css, html } from "lit";
import { customElement, property } from "lit/decorators.js";
console.log({
html: html,
Expand Down
2 changes: 1 addition & 1 deletion experiment/lit_typescript/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-unused-vars */

import { html, css } from "lit";
import { css, html } from "lit";
import { customElement, property } from "lit/decorators.js";

console.log({ html, css, customElement, property });
52 changes: 28 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jsenv/importmap-node-module",
"version": "7.0.0",
"version": "7.0.1",
"description": "Generate importmap for node_modules",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -28,41 +28,45 @@
"workspaces": [
"./docs/demo"
],
"volta": {
"node": "22.3.0"
},
"scripts": {
"eslint": "npx eslint . --ext=.js,.mjs,.cjs,.html",
"performance": "node --expose-gc ./scripts/performance.mjs --log",
"test": "node ./scripts/test.mjs",
"prettier": "prettier --write ."
"prettier": "prettier --write .",
"performance": "node --expose-gc ./scripts/performance.mjs --log"
},
"dependencies": {
"@babel/core": "7.23.7",
"@babel/traverse": "7.23.7",
"@jsenv/ast": "6.0.1",
"@jsenv/filesystem": "4.6.1",
"@babel/core": "7.24.9",
"@babel/traverse": "7.24.8",
"@jsenv/ast": "6.2.8",
"@jsenv/filesystem": "4.9.4",
"@jsenv/importmap": "1.2.1",
"@jsenv/logger": "4.1.1",
"@jsenv/urls": "2.2.1"
"@jsenv/urls": "2.4.0"
},
"devDependencies": {
"@babel/eslint-parser": "7.23.3",
"@babel/eslint-parser": "7.24.8",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-decorators": "7.23.7",
"@babel/plugin-syntax-import-assertions": "7.23.3",
"@babel/plugin-syntax-jsx": "7.23.3",
"@jsenv/assert": "2.13.1",
"@babel/plugin-proposal-decorators": "7.24.7",
"@babel/plugin-syntax-import-attributes": "7.24.7",
"@babel/plugin-syntax-jsx": "7.24.7",
"@jsenv/assert": "4.1.6",
"@jsenv/babel-preset": "1.1.3",
"@jsenv/core": "38.3.11",
"@jsenv/eslint-config": "16.4.5",
"@jsenv/github-release-package": "1.5.4",
"@jsenv/core": "39.2.10",
"@jsenv/eslint-config": "16.5.2",
"@jsenv/github-release-package": "1.5.5",
"@jsenv/importmap-eslint-resolver": "5.2.5",
"@jsenv/package-publish": "1.10.4",
"@jsenv/performance-impact": "4.2.0",
"@jsenv/server": "15.1.8",
"@jsenv/snapshot": "1.2.0",
"@jsenv/test": "2.1.3",
"eslint": "8.56.0",
"eslint-plugin-html": "7.1.0",
"@jsenv/package-publish": "1.10.5",
"@jsenv/performance-impact": "4.2.1",
"@jsenv/server": "15.2.15",
"@jsenv/snapshot": "2.6.1",
"@jsenv/test": "3.3.20",
"eslint": "8.57.0",
"eslint-plugin-html": "8.1.1",
"eslint-plugin-import": "2.29.1",
"prettier": "3.1.1"
"prettier": "3.3.3",
"prettier-plugin-organize-imports": "4.0.0"
}
}
2 changes: 0 additions & 2 deletions scripts/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ await executeTestPlan({
},
},
},
logShortForCompletedExecutions: true,
concurrency: true,
});
2 changes: 1 addition & 1 deletion src/cli.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node

import { parseArgs } from "node:util";
import { pathToFileURL } from "node:url";
import { parseArgs } from "node:util";
import { writeImportmaps } from "./main.js";

const options = {
Expand Down
10 changes: 5 additions & 5 deletions src/step_entry_point/html_parser.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { readFile } from "@jsenv/filesystem";
import {
parseHtml,
visitHtmlNodes,
getHtmlNodeAttribute,
getHtmlNodeText,
generateUrlForInlineContent,
getHtmlNodeAttribute,
getHtmlNodeAttributePosition,
getHtmlNodePosition,
getHtmlNodeText,
parseHtml,
visitHtmlNodes,
} from "@jsenv/ast";
import { readFile } from "@jsenv/filesystem";

export const parseHTMLRessources = async ({ code, url, asFileUrl }) => {
const htmlAst = parseHtml({ html: code, url, storeOriginalPositions: false });
Expand Down
2 changes: 1 addition & 1 deletion src/step_entry_point/js_parser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createRequire } from "node:module";
import { parseAsync } from "@babel/core";
import { urlToFileSystemPath } from "@jsenv/urls";
import { createRequire } from "node:module";

const require = createRequire(import.meta.url);

Expand Down
28 changes: 14 additions & 14 deletions src/step_entry_point/test_importmap_on_entry_points.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import { loadOptionsAsync } from "@babel/core";
import { readFile } from "@jsenv/filesystem";
import {
resolveUrl,
urlToExtension,
urlToRelativeUrl,
urlIsInsideOf,
urlToFileSystemPath,
} from "@jsenv/urls";
import {
composeTwoImportMaps,
normalizeImportMap,
resolveImport,
composeTwoImportMaps,
} from "@jsenv/importmap";
import { isSpecifierForNodeCoreModule } from "@jsenv/importmap/src/isSpecifierForNodeCoreModule.js";

import {
memoizeAsyncFunctionByUrl,
memoizeAsyncFunctionBySpecifierAndImporter,
} from "../util/memoize_async_function.js";
import { resolveFile } from "../util/resolve_file.js";
resolveUrl,
urlIsInsideOf,
urlToExtension,
urlToFileSystemPath,
urlToRelativeUrl,
} from "@jsenv/urls";

import {
createBareSpecifierAutomappingMessage,
createExtensionAutomappingMessage,
createImportResolutionFailedWarning,
} from "../util/logs.js";
import { parseSpecifiersFromJs } from "./js_parser.js";
import {
memoizeAsyncFunctionBySpecifierAndImporter,
memoizeAsyncFunctionByUrl,
} from "../util/memoize_async_function.js";
import { resolveFile } from "../util/resolve_file.js";
import { parseHTMLRessources } from "./html_parser.js";
import { parseSpecifiersFromJs } from "./js_parser.js";
import { showSource } from "./show_source.js";

export const testImportmapOnEntryPoints = async (
Expand Down
8 changes: 4 additions & 4 deletions src/step_node_esm/node_module_resolution.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { readFile, ensureWindowsDriveLetter } from "@jsenv/filesystem";
import { ensureWindowsDriveLetter, readFile } from "@jsenv/filesystem";
import {
urlToRelativeUrl,
resolveUrl,
urlToParentUrl,
urlToFileSystemPath,
urlToParentUrl,
urlToRelativeUrl,
} from "@jsenv/urls";

import { memoizeAsyncFunctionByUrl } from "../util/memoize_async_function.js";
import { findAsync } from "../util/find_async.js";
import { memoizeAsyncFunctionByUrl } from "../util/memoize_async_function.js";

export const createFindNodeModulePackage = () => {
const readPackageFileMemoized = memoizeAsyncFunctionByUrl(
Expand Down
2 changes: 1 addition & 1 deletion src/step_node_esm/resolve_package_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { createDetailedMessage } from "@jsenv/logger";
import { resolveUrl, urlToFileSystemPath, urlToRelativeUrl } from "@jsenv/urls";

import {
createPreferExportsFieldWarning,
createBrowserFieldNotImplementedWarning,
createPreferExportsFieldWarning,
} from "../util/logs.js";
import { resolveFile } from "../util/resolve_file.js";

Expand Down
8 changes: 4 additions & 4 deletions src/step_node_esm/visit_node_module_resolution.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { readFileSync } from "node:fs";
import { createDetailedMessage } from "@jsenv/logger";
import { urlToRelativeUrl, urlToFileSystemPath } from "@jsenv/urls";
import { urlToFileSystemPath, urlToRelativeUrl } from "@jsenv/urls";
import { readFileSync } from "node:fs";

import { createFindNodeModulePackage } from "./node_module_resolution.js";
import { resolvePackageMain } from "./resolve_package_main.js";
import { visitPackageExports } from "./visit_package_exports.js";
import { visitPackageImportmap } from "./visit_package_importmap.js";
import { visitPackageImports } from "./visit_package_imports.js";
import { visitPackageExports } from "./visit_package_exports.js";
import { createFindNodeModulePackage } from "./node_module_resolution.js";

export const visitNodeModuleResolution = async (
visitors,
Expand Down
2 changes: 1 addition & 1 deletion src/step_node_esm/visit_package_exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ https://nodejs.org/docs/latest-v15.x/api/packages.html#packages_node_js_package_
*/

import { urlToFileSystemPath, urlToRelativeUrl, resolveUrl } from "@jsenv/urls";
import { createDetailedMessage } from "@jsenv/logger";
import { resolveUrl, urlToFileSystemPath, urlToRelativeUrl } from "@jsenv/urls";

import { specifierIsRelative } from "./specifier_is_relative.js";

Expand Down
2 changes: 1 addition & 1 deletion src/step_node_esm/visit_package_importmap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { resolveUrl, moveImportMap } from "@jsenv/importmap";
import { readFile } from "@jsenv/filesystem";
import { moveImportMap, resolveUrl } from "@jsenv/importmap";
import { urlToFileSystemPath } from "@jsenv/urls";

export const visitPackageImportmap = async ({
Expand Down
12 changes: 6 additions & 6 deletions src/step_write_into_files/write_into_files.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { readFileSync, writeFileSync } from "@jsenv/filesystem";
import { urlToFileSystemPath } from "@jsenv/urls";
import {
parseHtml,
createHtmlNode,
findHtmlNode,
getHtmlNodeAttribute,
injectHtmlNodeAsEarlyAsPossible,
parseHtml,
setHtmlNodeAttributes,
setHtmlNodeText,
createHtmlNode,
injectHtmlNodeAsEarlyAsPossible,
stringifyHtmlAst,
} from "@jsenv/ast";
import { readFileSync, writeFileSync } from "@jsenv/filesystem";
import { urlToFileSystemPath } from "@jsenv/urls";

export const writeIntoFiles = (
importmapInfos,
Expand Down Expand Up @@ -64,7 +64,7 @@ const writeIntoHtmlFile = (htmlFileUrl, importmapAsJson, { logger }) => {
const importmapNode = createHtmlNode({
tagName: "script",
type: "importmap",
textContent: importmapAsJson,
children: importmapAsJson,
});
injectHtmlNodeAsEarlyAsPossible(htmlAst, importmapNode);
setHtmlNodeAttributes(importmapNode, {
Expand Down
2 changes: 1 addition & 1 deletion src/util/logs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createDetailedMessage } from "@jsenv/logger";
import { urlToFileSystemPath, urlToRelativeUrl, resolveUrl } from "@jsenv/urls";
import { resolveUrl, urlToFileSystemPath, urlToRelativeUrl } from "@jsenv/urls";

export const createPreferExportsFieldWarning = ({
packageInfo,
Expand Down
2 changes: 1 addition & 1 deletion src/util/memoize_async_function.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const memoizeAsyncFunctionBySpecifierAndImporter = (fn) => {
};

const memoizeAsyncFunction = (fn, { getMemoryEntryFromArguments }) => {
const memoized = async (...args) => {
const memoized = (...args) => {
const memoryEntry = getMemoryEntryFromArguments(args);
const promiseFromMemory = memoryEntry.get();
if (promiseFromMemory) {
Expand Down
8 changes: 4 additions & 4 deletions src/write_importmaps.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { createLogger } from "@jsenv/logger";
import { assertAndNormalizeDirectoryUrl } from "@jsenv/filesystem";
import {
composeTwoImportMaps,
sortImportMap,
moveImportMap,
sortImportMap,
} from "@jsenv/importmap";
import { createLogger } from "@jsenv/logger";

import { generateImportmapForNodeESMResolution } from "./step_node_esm/importmap_for_node_esm.js";
import { testImportmapOnEntryPoints } from "./step_entry_point/test_importmap_on_entry_points.js";
import { updateJsConfigForVsCode } from "./step_jsconfig/update_js_config_for_vscode.js";
import { generateImportmapForNodeESMResolution } from "./step_node_esm/importmap_for_node_esm.js";
import { writeIntoFiles } from "./step_write_into_files/write_into_files.js";

const importResolutionDefault = {
Expand Down Expand Up @@ -54,7 +54,7 @@ export const writeImportmaps = async ({
const logger = createLogger({ logLevel });
const warn = wrapWarnToWarnOnce((warning) => {
onWarn(warning, () => {
logger.warn(`\n${warning.message}\n`);
console.warn(`\n${warning.message}\n`);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { importmapToVsCodeConfigPaths } from "@jsenv/importmap-node-module/src/s
"foo/": "./node_modules/foo/",
},
});
const expected = {
const expect = {
"foo": ["./node_modules/foo/index.js"],
"foo/*": ["./node_modules/foo/*"],
};
assert({ actual, expected });
assert({ actual, expect });
}
Loading

0 comments on commit 21d9b44

Please sign in to comment.