Skip to content

Commit

Permalink
chore: use shared ts config
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud committed Sep 27, 2024
1 parent f6195d5 commit d8f2635
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 22 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"test:coverage": "tap",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"types": "run-s types:tsc types:fixup",
"types": "run-s types:tsc types:fixup types:test",
"types:tsc": "tsc",
"types:test": "tsc --project tsconfig.test.json",
"types:fixup": "node ./fixup.js"
Expand All @@ -49,6 +49,7 @@
"@podium/eslint-config": "1.0.0",
"@podium/podlet": "5.1.17",
"@podium/test-utils": "2.5.2",
"@podium/typescript-config": "1.0.0",
"@semantic-release/changelog": "6.0.3",
"@semantic-release/git": "10.0.1",
"eslint": "9.9.1",
Expand Down
7 changes: 7 additions & 0 deletions test/podlet-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,22 @@ class Server {
this.app.register(fastifyForm); // Needed to handle non GET requests

this.app.get(podlet.content(), async (req, reply) => {
// @ts-ignore
if (reply.app.podium.context.locale === 'nb-NO') {
// @ts-ignore
return reply.podiumSend('nb-NO');
}
// @ts-ignore
if (reply.app.podium.context.locale === 'en-NZ') {
// @ts-ignore
return reply.podiumSend('en-NZ');
}
// @ts-ignore
return reply.podiumSend('en-US');
});

this.app.get(podlet.fallback(), async (req, reply) => {
// @ts-ignore
return reply.podiumSend('fallback');
});

Expand Down Expand Up @@ -67,6 +73,7 @@ class Server {
.listen({ port: 0, host: '127.0.0.1' })
.then(() => {
const address = this.app.server.address();
// @ts-ignore
const url = `http://${address.address}:${address.port}`;
resolve(url);
})
Expand Down
19 changes: 5 additions & 14 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
{
"compilerOptions": {
"lib": ["es2020"],
"module": "nodenext",
"target": "es2020",
"resolveJsonModule": true,
"checkJs": true,
"allowJs": true,
"moduleResolution": "nodenext",
"emitDeclarationOnly": true,
"declaration": true,
"allowSyntheticDefaultImports": true,
"outDir": "types"
},
"include": ["./lib/**/*.js"]
"extends": "@podium/typescript-config/module.json",
"include": ["./lib/**/*.js"],
"compilerOptions": {
"outDir": "types"
}
}
9 changes: 2 additions & 7 deletions tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["./tests/**/*.js"],
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "nodenext",
"noEmit": true
}
"extends": "@podium/typescript-config/test.json",
"include": ["./test/**/*.js"]
}

0 comments on commit d8f2635

Please sign in to comment.