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

Update to Deno 2.0 #3

Open
thoroc opened this issue Dec 13, 2024 · 0 comments
Open

Update to Deno 2.0 #3

thoroc opened this issue Dec 13, 2024 · 0 comments

Comments

@thoroc
Copy link

thoroc commented Dec 13, 2024

Just looking at this and it seems the templates' code are producing pre deno 2.0 code.

For example:

  • packages/deno/src/generators/application/files/framework-none/main.ts__template__
import { handler } from './handler.ts';

const port = Number(Deno.env.get('PORT') || 4200);

Deno.serve({ port }, handler); // <-- this has changed
  • packages/deno/src/generators/application/files/framework-none/handler.test.ts__template__
import { assertInstanceOf } from 'jsr:@std/assert'; // <-- this has changed
import { handler } from './handler.ts';

Deno.test('handler', async () => {
  const response = await handler(new Request('http://localhost:3000'));
  assertInstanceOf(
    response,
    Response,
    'handler did not return an instance of a Response'
  );
});

I am sure there are plenty of other places updates are needed, including the deno.json file itself (I don't think importMap are a thing anymore btw).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant