Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate code to ESM #73

Merged
merged 4 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
41 changes: 30 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,17 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os:
- ubuntu-latest
- windows-latest
- macos-latest
deno:
[1.x, "1.33.1", canary, ~1.32, b290fd01f3f5d32f9d010fc719ced0240759c049, rc]
- "1.x"
- "1.33.1"
- "canary"
- "~1.32"
- "b290fd01f3f5d32f9d010fc719ced0240759c049"
- "rc"

steps:
- uses: actions/checkout@v3
Expand All @@ -38,14 +46,6 @@ jobs:
deno install --allow-net -n deno_curl https://deno.land/std@0.198.0/examples/curl.ts
deno_curl https://deno.land/std@0.198.0/examples/curl.ts

- name: Format
if: runner.os == 'Linux' && matrix.deno == 'canary'
run: npm run fmt:check

- name: Lint
if: runner.os == 'Linux' && matrix.deno == 'canary'
run: npm run lint

test-version-file:
runs-on: ubuntu-latest
strategy:
Expand All @@ -66,7 +66,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3

Expand All @@ -77,3 +77,22 @@ jobs:

- name: Check binary exists
run: deno_foo -V

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Deno
uses: ./
with:
deno-version: "rc"

- name: Lint
run: deno lint

- name: Format
run: deno fmt --check

- name: Check types
run: deno check main.mjs
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ outputs:
description: "The release channel of the installed version."
runs:
using: "node20"
main: "main.js"
main: "main.mjs"
6 changes: 6 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"compilerOptions": {
"checkJs": true,
"allowJs": true
}
}
98 changes: 98 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 7 additions & 8 deletions main.js → main.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
const process = require("process");
const core = require("@actions/core");

const {
parseVersionRange,
import process from "node:process";
import core from "@actions/core";
import {
getDenoVersionFromFile,
parseVersionRange,
resolveVersion,
} = require("./src/version.js");
const { install } = require("./src/install.js");
} from "./src/version.mjs";
import { install } from "./src/install.mjs";

/**
* @param {string} message
Expand Down Expand Up @@ -46,7 +45,7 @@ async function main() {

core.info("Installation complete.");
} catch (err) {
core.setFailed(err);
core.setFailed((err instanceof Error) ? err : String(err));
process.exit();
}
}
Expand Down
2 changes: 1 addition & 1 deletion node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/.bin/uuid

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added node_modules/.deno/.deno.lock
Empty file.
1 change: 1 addition & 0 deletions node_modules/.deno/.deno.lock.poll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added node_modules/.deno/.setup-cache.bin
Binary file not shown.
Empty file.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading