Skip to content

Commit

Permalink
feat: add back deno runtime testing without type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
yjp20 committed Nov 11, 2024
1 parent 4dfb0c6 commit 1626cf5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
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

0 comments on commit 1626cf5

Please sign in to comment.