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

feat: add back deno runtime testing without type checks #1186

Closed
wants to merge 1 commit into from
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions ecosystem-tests/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,14 @@ const projectRunners = {
await run('bun', ['test']);
}
},
// Temporarily comment this out until we can test with JSR transformations end-to-end.
// deno: async () => {
// // we don't need to explicitly install the package here
// // because our deno setup relies on `rootDir/deno` to exist
// // which is an artifact produced from our build process
// await run('deno', ['task', 'install']);
// await run('deno', ['task', 'check']);

// if (state.live) await run('deno', ['task', 'test']);
// },
deno: async () => {
// we don't need to explicitly install the package here
// because our deno setup relies on `rootDir/dist-deno` to exist
// which is an artifact produced from our build process
await run('deno', ['task', 'install', '--unstable-sloppy-imports']);

if (state.live) await run('deno', ['task', 'test']);
},
};

let projectNames = Object.keys(projectRunners) as Array<keyof typeof projectRunners>;
Expand Down
7 changes: 3 additions & 4 deletions ecosystem-tests/deno/deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"tasks": {
"install": "deno install --node-modules-dir main_test.ts -f",
"check": "deno lint && deno check main_test.ts",
"test": "deno test --allow-env --allow-net --allow-read --node-modules-dir"
"test": "deno test --allow-env --allow-net --allow-read --node-modules-dir --unstable-sloppy-imports --no-check"
},
"imports": {
"openai": "../../deno/mod.ts",
"openai/": "../../deno/"
"openai": "../../dist-deno/index.ts",
"openai/": "../../dist-deno/"
}
}
18 changes: 13 additions & 5 deletions scripts/build-deno
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@ cd "$(dirname "$0")/.."
rm -rf dist-deno; mkdir dist-deno
cp -rp src/* jsr.json dist-deno

rm -rf dist-deno/shims

rm dist-deno/_shims/node*.{js,mjs,ts}
rm dist-deno/_shims/manual*.{js,mjs,ts}
rm dist-deno/_shims/index.{d.ts,js,mjs}
for file in dist-deno/_shims/*-deno.ts; do
mv -- "$file" "${file%-deno.ts}.ts"
done

rm dist-deno/_shims/auto/*-node.ts
for dir in dist-deno/_shims dist-deno/_shims/auto; do
rm "${dir}"/*.{d.ts,js,mjs}
for file in "${dir}"/*-deno.ts; do
mv -- "$file" "${file%-deno.ts}.ts"
done
rm dist-deno/_shims/auto/*.{d.ts,js,mjs}
for file in dist-deno/_shims/auto/*-deno.ts; do
mv -- "$file" "${file%-deno.ts}.ts"
done

for file in README.md LICENSE CHANGELOG.md; do
if [ -e "${file}" ]; then cp "${file}" dist-deno; fi
done