Skip to content

Commit

Permalink
Additional fixes for using ESM
Browse files Browse the repository at this point in the history
Signed-off-by: Yoriyasu Yano <[email protected]>
  • Loading branch information
yorinasub17 committed Oct 3, 2023
1 parent 74d6cdd commit 0217578
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 18 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/lint-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: "lts/*"

- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598
name: Install pnpm
Expand Down
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
src
.eslintrc.cjs
.prettierrc.cjs
jest.config.js
jest.config.cjs
decs.d.ts
tsconfig.json
6 changes: 3 additions & 3 deletions src/engine/from_github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import * as nodecrypto from "crypto";

import { Octokit } from "@octokit/rest";

import { parseUnifiedDiff } from "./patch";
import { IPatch, PatchOp } from "./patch_types";
import { SourcePlatform } from "./from";
import { parseUnifiedDiff } from "./patch.ts";
import { IPatch, PatchOp } from "./patch_types.ts";
import { SourcePlatform } from "./from.ts";

const crypto = nodecrypto.webcrypto;

Expand Down
12 changes: 6 additions & 6 deletions src/engine/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

export * from "./compile";
export * from "./from";
export * from "./from_github";
export * from "./interpreter";
export * from "./patch";
export * from "./patch_types";
export * from "./compile.ts";
export * from "./from.ts";
export * from "./from_github.ts";
export * from "./interpreter.ts";
export * from "./patch.ts";
export * from "./patch_types.ts";
6 changes: 3 additions & 3 deletions src/engine/interpreter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import { expect, test } from "@jest/globals";

import { PatchOp } from "./patch_types";
import { runRule, RuleLogMode, RuleLogLevel } from "./interpreter";
import { compileRuleFn, RuleFnSourceLang } from "./compile";
import { PatchOp } from "./patch_types.ts";
import { runRule, RuleLogMode, RuleLogLevel } from "./interpreter.ts";
import { compileRuleFn, RuleFnSourceLang } from "./compile.ts";

test("sanity check", async () => {
const ruleFn = `function main(inp) {
Expand Down
2 changes: 1 addition & 1 deletion src/engine/interpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ globalThis.acorn = acorn;

import { Octokit } from "@octokit/rest";

import { IPatch } from "./patch_types";
import { IPatch } from "./patch_types.ts";

declare global {
// eslint-disable-next-line no-var,@typescript-eslint/no-explicit-any
Expand Down
2 changes: 1 addition & 1 deletion src/engine/patch.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

import { IHunk, ILineDiff, LineOp } from "./patch_types";
import { IHunk, ILineDiff, LineOp } from "./patch_types.ts";

/**
* Parse a unified diff text into a list of hunk objects.
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Fensak, LLC.
// SPDX-License-Identifier: AGPL-3.0-or-later OR BUSL-1.1

export * from "./engine";
export * from "./engine/index.ts";
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
"allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
Expand Down

0 comments on commit 0217578

Please sign in to comment.