Skip to content

Commit

Permalink
Revert "ci: add typechecking for deno (#4715)" (#4856)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcansh authored and chaance committed Dec 16, 2022
1 parent 07b9b0a commit 7086b49
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 53 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ jobs:
node-version-file: ".nvmrc"
cache: "yarn"

- name: 🦕 Setup deno
uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x

- name: 📥 Install deps
run: yarn --frozen-lockfile

Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/reusable-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ jobs:
node-version-file: ".nvmrc"
cache: "yarn"

- name: 🦕 Setup deno
uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x

- name: 📥 Install deps
run: yarn --frozen-lockfile

Expand Down Expand Up @@ -66,11 +61,6 @@ jobs:
node-version: ${{ matrix.node }}
cache: "yarn"

- name: 🦕 Setup deno
uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x

- name: 📥 Install deps
run: yarn --frozen-lockfile

Expand Down Expand Up @@ -103,11 +93,6 @@ jobs:
node-version: ${{ matrix.node }}
cache: "yarn"

- name: 🦕 Setup deno
uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x

- name: 📥 Install deps
run: yarn --frozen-lockfile

Expand Down Expand Up @@ -139,11 +124,6 @@ jobs:
node-version: ${{ matrix.node }}
cache: "yarn"

- name: 🦕 Setup deno
uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x

- name: 📥 Install deps
run: yarn --frozen-lockfile

Expand Down Expand Up @@ -175,11 +155,6 @@ jobs:
node-version: ${{ matrix.node }}
cache: "yarn"

- name: 🦕 Setup deno
uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x

- name: 📥 Install deps
run: yarn --frozen-lockfile

Expand Down
22 changes: 11 additions & 11 deletions packages/remix-deno/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function defaultCacheControl(url: URL, assetsPublicPath = "/build/") {
}

export function createRequestHandler<
Context extends AppLoadContext | undefined = undefined,
Context extends AppLoadContext | undefined = undefined
>({
build,
mode,
Expand All @@ -22,11 +22,11 @@ export function createRequestHandler<
mode?: string;
getLoadContext?: (request: Request) => Promise<Context> | Context;
}) {
const handleRequest = createRemixRequestHandler(build, mode);
let handleRequest = createRemixRequestHandler(build, mode);

return async (request: Request) => {
try {
const loadContext = await getLoadContext?.(request);
let loadContext = await getLoadContext?.(request);

return handleRequest(request, loadContext);
} catch (error: unknown) {
Expand All @@ -53,12 +53,12 @@ export async function serveStaticFiles(
cacheControl?: string | ((url: URL) => string);
publicDir?: string;
assetsPublicPath?: string;
},
}
) {
const url = new URL(request.url);
let url = new URL(request.url);

const headers = new Headers();
const contentType = mime.getType(url.pathname);
let headers = new Headers();
let contentType = mime.getType(url.pathname);
if (contentType) {
headers.set("Content-Type", contentType);
}
Expand All @@ -71,9 +71,9 @@ export async function serveStaticFiles(
headers.set("Cache-Control", defaultCacheControl(url, assetsPublicPath));
}

const filePath = path.join(publicDir, url.pathname);
let filePath = path.join(publicDir, url.pathname);
try {
const file = await Deno.readFile(filePath);
let file = await Deno.readFile(filePath);
return new Response(file, { headers });
} catch (error) {
if (error.code === "EISDIR" || error.code === "ENOENT") {
Expand All @@ -84,7 +84,7 @@ export async function serveStaticFiles(
}

export function createRequestHandlerWithStaticFiles<
Context extends AppLoadContext | undefined = undefined,
Context extends AppLoadContext | undefined = undefined
>({
build,
mode,
Expand All @@ -103,7 +103,7 @@ export function createRequestHandlerWithStaticFiles<
assetsPublicPath?: string;
};
}) {
const remixHandler = createRequestHandler({ build, mode, getLoadContext });
let remixHandler = createRequestHandler({ build, mode, getLoadContext });

return async (request: Request) => {
try {
Expand Down
12 changes: 0 additions & 12 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
import { spawn } from "cross-spawn";
import glob from "glob";

const args = process.argv.slice(2);
const publish = process.env.CI || args.includes("--publish");
const tsc = process.env.CI || args.includes("--tsc") || publish;
// const denoCheck = process.env.CI || args.includes("--deno");
const denoCheck = false;

exec("yarn", ["rollup", "-c"])
.then(() => tsc && exec("yarn", ["tsc", "-b"]))
.then(
() =>
denoCheck &&
exec("deno", [
"check",
"--import-map=.vscode/deno_resolve_npm_imports.json",
...glob.sync("packages/remix-deno/**/*.ts"),
])
)
.then(() => publish && exec("node", ["scripts/copy-build-to-dist.mjs"]))
.then(() => process.exit(0))
.catch((err) => {
Expand Down

0 comments on commit 7086b49

Please sign in to comment.