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

chore: Import planx-core as ESM #4105

Merged
merged 6 commits into from
Jan 6, 2025
Merged
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
2 changes: 1 addition & 1 deletion api.planx.uk/modules/send/bops/bops.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import nock from "nock";
import supertest from "supertest";
import type planxCore from "@opensystemslab/planx-core";
import type * as planxCore from "@opensystemslab/planx-core";
import { queryMock } from "../../../tests/graphqlQueryMock.js";
import app from "../../../server.js";
import { expectedPlanningPermissionPayload } from "../../../tests/mocks/digitalPlanningDataMocks.js";
Expand Down
2 changes: 1 addition & 1 deletion api.planx.uk/modules/send/email/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import supertest from "supertest";
import type planxCore from "@opensystemslab/planx-core";
import type * as planxCore from "@opensystemslab/planx-core";
import { queryMock } from "../../../tests/graphqlQueryMock.js";
import app from "../../../server.js";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type planxCore from "@opensystemslab/planx-core";
import type * as planxCore from "@opensystemslab/planx-core";
import { queryMock } from "../../../../tests/graphqlQueryMock.js";
import {
getSubmittedUnAnalyzedSessionIds,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type planxCore from "@opensystemslab/planx-core";
import type * as planxCore from "@opensystemslab/planx-core";
import { runSQL } from "../../../../lib/hasura/schema/index.js";
import { queryMock } from "../../../../tests/graphqlQueryMock.js";
import {
Expand Down
2 changes: 1 addition & 1 deletion api.planx.uk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@airbrake/node": "^2.1.8",
"@aws-sdk/client-s3": "^3.696.0",
"@aws-sdk/s3-request-presigner": "^3.701.0",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#a9848d4",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#d004278",
"@types/isomorphic-fetch": "^0.0.36",
"adm-zip": "^0.5.10",
"axios": "^1.7.4",
Expand Down
57 changes: 33 additions & 24 deletions api.planx.uk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api.planx.uk/tests/mockJWT.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Role } from "@opensystemslab/planx-core/types";
import { sign } from "jsonwebtoken";
import jwt from "jsonwebtoken";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required change due to this issue - auth0/node-jsonwebtoken#655


function getJWT({ role }: { role: Role }) {
const data = {
Expand All @@ -12,7 +12,7 @@ function getJWT({ role }: { role: Role }) {
},
};

return sign(data, process.env.JWT_SECRET!);
return jwt.sign(data, process.env.JWT_SECRET!);
}

function authHeader({ role }: { role: Role }) {
Expand Down
1 change: 1 addition & 0 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"packageManager": "[email protected]",
"devDependencies": {
"@types/jsonwebtoken": "^9.0.7",
"@types/node": "22.10.5",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
Expand Down
9 changes: 9 additions & 0 deletions e2e/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions e2e/tests/api-driven/cucumber.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"default": {
"requireModule": ["ts-node/register"],
"require": ["src/env.ts", "src/**/*.ts"],
"loader": ["ts-node/esm"],
"import": ["src/env.ts", "src/**/*.ts"],
"paths": ["src/**/*.feature"],
"format": ["summary"],
"publishQuiet": true,
"formatOptions": {
"snippetInterface": "async-await"
}
Expand Down
6 changes: 4 additions & 2 deletions e2e/tests/api-driven/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"test": "cucumber-js --tags 'not @regression'",
"test:regression": "cucumber-js"
},
"type": "module",
"packageManager": "[email protected]",
"dependencies": {
"@cucumber/cucumber": "^9.3.0",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#a9848d4",
"@cucumber/cucumber": "^11.1.1",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#d004278",
"axios": "^1.7.4",
"dotenv": "^16.3.1",
"dotenv-expand": "^10.0.0",
Expand All @@ -17,6 +18,7 @@
"nock": "^13.3.1"
},
"devDependencies": {
"@types/jsonwebtoken": "^9.0.7",
"@types/lodash.zipobject": "^4.1.7",
"@types/node": "22.10.5",
"ts-node": "^10.9.1",
Expand Down
Loading
Loading