Skip to content

Commit

Permalink
chore: deno version requirement bump.
Browse files Browse the repository at this point in the history
  • Loading branch information
eser committed Jul 14, 2024
1 parent f2d9e1d commit 9969c44
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
# - windows-latest
# - macOS-latest
deno-version:
- 1.39.2
- 1.45.2

steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
deno 1.45.1
deno 1.45.2
pre-commit 3.7.1
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM denoland/deno:distroless-1.44.4
FROM denoland/deno:distroless-1.45.2

# The port that the application listens to.
EXPOSE 8080
Expand All @@ -8,15 +8,15 @@ USER deno

WORKDIR /app

# Cache the dependencies as a layer (the following two steps are re-run only when deps.ts is modified).
# Ideally cache deps.ts will download and compile _all_ external files used in main.ts.
COPY deps.ts .
RUN deno cache deps.ts
# # Cache the dependencies as a layer (the following two steps are re-run only when deps.ts is modified).
# # Ideally cache deps.ts will download and compile _all_ external files used in main.ts.
# COPY deps.ts .
# RUN deno cache deps.ts

# These steps will be re-run upon each file change in your working directory:
COPY ./pkg/ ./
COPY ./ ./

# Compile the main app so that it doesn't need to be compiled each startup/entry.
RUN deno cache mod.ts
RUN deno cache ./pkg/mod.ts

ENTRYPOINT ["deno", "task", "repl"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ portable across all these platforms.

## 🚀 Jumpstart

Ensure that [Deno](https://deno.land/) 1.36 or higher is installed on your
Ensure that [Deno](https://deno.land/) 1.45 or higher is installed on your
system first.

First, install `cool cli` globally, then create a new project:
Expand Down Expand Up @@ -182,7 +182,7 @@ your fork, and then submit a pull request.

### Requirements

- Deno 1.36 or higher (https://deno.land/)
- Deno 1.45 or higher (https://deno.land/)

### Versioning

Expand Down
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test:coverage": "deno coverage ./_etc/coverage/ --exclude='\\.(j|t)sx$'",
"test:coverage-gen": "deno coverage ./_etc/coverage --exclude='\\.(j|t)sx$' --lcov --output=./_etc/coverage.lcov",
"ok": "deno fmt --check && deno lint && deno task script:validate-licenses --check && deno task check:mod && deno task test:run",
"repl": "deno repl --unstable-cron --unstable-kv --unstable-temporal --allow-all --eval-file=./repl-init.ts",
"repl": "deno repl --unstable-cron --unstable-kv --unstable-temporal --allow-all --eval-file=./scripts/repl-init.ts",
"container:build": "docker build -t cool .",
"container:run": "docker run --interactive --tty --rm cool"
},
Expand Down
28 changes: 19 additions & 9 deletions scripts/repl-init.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
// Copyright 2023-present Eser Ozvataf and other contributors. All rights reserved. Apache-2.0 license.

import * as config from "@eser/config";
import * as jsRuntime from "@eser/standards/js-runtime";
// import * as mod from "@eser/";
import * as configFile from "@eser/config/file";
// import * as jsRuntime from "@eser/standards/js-runtime";
import * as mod from "./pkg/mod.ts";

// TODO(@eser) get dependency injection container entries instead of this
await (async () => {
const env = await config.dotenv.load();
const kv = await jsRuntime.current.openKv();
// const env = await config.dotenv.load();
// const kv = await jsRuntime.current.openKv();

const denoConfigLoader = await configFile.load(".", [
"deno.jsonc",
"deno.json",
]);
const denoConfig = denoConfigLoader.content;

const variables: Record<string, unknown> = {
// ...mod,
env,
kv,
...mod,
denoConfig,
// env,
// kv,
};

const vars = () => {
Expand All @@ -36,7 +43,10 @@ await (async () => {
globalThis[key] = value;
}

console.log(`%ccool REPL, version ${mod.metadata.version}`, "color: #00ff00");
console.log(
`%ccool REPL, version ${denoConfig.version ?? "unknown"}`,
"color: #00ff00",
);

vars();
})();

0 comments on commit 9969c44

Please sign in to comment.