Skip to content

Commit

Permalink
chore: migrate code to ESM (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacasonato authored Sep 13, 2024
1 parent f8480e6 commit f1ac2c8
Show file tree
Hide file tree
Showing 905 changed files with 69,754 additions and 56,084 deletions.
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/[email protected]/examples/curl.ts
deno_curl https://deno.land/[email protected]/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.
File renamed without changes.

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

File renamed without changes.
File renamed without changes.

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

File renamed without changes.
File renamed without changes.

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.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

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.

1 change: 1 addition & 0 deletions node_modules/.deno/@[email protected]/node_modules/uuid

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

Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

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

Empty file.
File renamed without changes.
File renamed without changes.

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

0 comments on commit f1ac2c8

Please sign in to comment.