Skip to content

Commit

Permalink
Change the way ts utilities are run for latest typescript in Node 20+
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardsph committed Jan 9, 2025
1 parent 54f2ea1 commit d4bf280
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "authorization-management-component",
"version": "0.1.1",
"private": true,
"type": "module",
"scripts": {
"build": "next build",
"prepare:e2e": "cd e2e/test-app ; npm ci; npm run build",
Expand All @@ -17,11 +18,11 @@
"start": "next start",
"test": "TZ=UTC jest --runInBand",
"test:e2e": "playwright test",
"update-clientId": "npm ci && npx ts-node --skip-project scripts/updateClientId.ts",
"update-clientId": "npm ci && node --experimental-specifier-resolution=node --loader ts-node/esm/transpile-only scripts/updateClientId.ts",
"bump-version": "changeset add",
"version": "changeset version",
"release": "changeset publish",
"preparePurposes": "npx ts-node --skip-project scripts/preparePurposes.ts"
"preparePurposes": "node --experimental-specifier-resolution=node --loader ts-node/esm/transpile-only scripts/preparePurposes.ts"
},
"dependencies": {
"@changesets/changelog-github": "^0.5.0",
Expand Down
8 changes: 6 additions & 2 deletions scripts/preparePurposes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
import fs from "fs";
import path from "path";
import path, { dirname } from "path";
import { fileURLToPath } from "url";
import { addToCache, defaultUrls } from "../src/session/PurposeCache";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

// Undici struggles to follow these redirects for some reason,
// but the browser handles it fine
const redirected = {
Expand Down Expand Up @@ -52,6 +56,6 @@ async function main() {
}

main().catch((e) => {
console.log("Error occured preparing purposes", e);
console.log("Error occurred preparing purposes", e);
process.exit(1);
});

0 comments on commit d4bf280

Please sign in to comment.