Skip to content

Commit

Permalink
Update to Vite 5
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeckem committed May 14, 2024
1 parent 64645aa commit a4817c3
Show file tree
Hide file tree
Showing 7 changed files with 735 additions and 629 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@open-pioneer/build-package-cli": "^2.0.0",
"@open-pioneer/build-support": "^2.0.0",
"@open-pioneer/build-package-cli": "^2.0.2",
"@open-pioneer/build-support": "^2.0.1",
"@open-pioneer/runtime": "workspace:^",
"@open-pioneer/tag-current-versions": "^2.0.0",
"@open-pioneer/vite-plugin-pioneer": "^2.0.0",
"@open-pioneer/tag-current-versions": "^2.0.2",
"@open-pioneer/vite-plugin-pioneer": "^3.0.0",
"@testing-library/dom": "^9.3.3",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^14.1.2",
Expand Down Expand Up @@ -113,9 +113,9 @@
"ts-node": "^10.9.1",
"typedoc": "^0.25.4",
"typescript": "~5.3.2",
"vite": "^4.5.3",
"vite": "^5.2.11",
"vite-plugin-eslint": "^1.8.1",
"vitest": "^0.34.6"
"vitest": "^1.6.0"
},
"engines": {
"node": ">= 18",
Expand Down
1,314 changes: 710 additions & 604 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/packages/authentication/ForceAuth.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ it("renders no children if the state is pending", async () => {
);

const result = await screen.findByTestId("1234");
expect(result.outerHTML).toMatchInlineSnapshot('"<div data-testid=\\"1234\\"></div>"');
expect(result.outerHTML).toMatchInlineSnapshot(`"<div data-testid="1234"></div>"`);
});

it("renders AuthFallback if the user is not authenticated", async () => {
Expand Down Expand Up @@ -91,7 +91,7 @@ it("renders the AuthFallback with custom props", async () => {
);

const result = await screen.findByTestId("LoginFallBack");
expect(result.textContent).toMatchInlineSnapshot('"\\"TestProp\\""');
expect(result.textContent).toMatchInlineSnapshot(`""TestProp""`);
});

it("renders the AuthFallback with a custom render function", async () => {
Expand Down Expand Up @@ -154,7 +154,7 @@ it("re-renders when the service's state changes", async () => {
);

const result = await screen.findByTestId("outer-div");
expect(result.outerHTML).toMatchInlineSnapshot('"<div data-testid=\\"outer-div\\"></div>"');
expect(result.outerHTML).toMatchInlineSnapshot(`"<div data-testid="outer-div"></div>"`);

act(() => {
testAuthService.setAuthState({
Expand All @@ -167,7 +167,7 @@ it("re-renders when the service's state changes", async () => {

const innerDiv = await screen.findByTestId("inner-div");
expect(innerDiv.outerHTML).toMatchInlineSnapshot(
'"<div data-testid=\\"inner-div\\">testDiv</div>"'
`"<div data-testid="inner-div">testDiv</div>"`
);
});

Expand Down
16 changes: 8 additions & 8 deletions src/packages/local-storage/LocalStorageServiceImpl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ it("Detects missing local storage", async () => {
`);

expect(() => storageService.get("foo")).toThrowErrorMatchingInlineSnapshot(
'"local-storage:not-supported: Local storage is not supported by this browser."'
`[Error: local-storage:not-supported: Local storage is not supported by this browser.]`
);
});

Expand Down Expand Up @@ -135,7 +135,7 @@ it("Overwrites invalid data on load", async () => {
expect(args[0]).toMatchInlineSnapshot(
'"[WARN] local-storage: Invalid persisted data, reverting to default."'
);
expect(args[1]).toMatch(/unexpected token/i);
expect(String(args[1])).toMatch(/unexpected token/i);
});

it("Returns previously set values in get()", async () => {
Expand Down Expand Up @@ -184,13 +184,13 @@ it("Supports removing all keys", async () => {
it("Throws for invalid values", async () => {
const storageService = await setup();
expect(() => storageService.set("foo", () => 1)).toThrowErrorMatchingInlineSnapshot(
'"local-storage:invalid-value: The value is not supported by local storage."'
`[Error: local-storage:invalid-value: The value is not supported by local storage.]`
);
expect(() => storageService.set("foo", Symbol("symbol"))).toThrowErrorMatchingInlineSnapshot(
'"local-storage:invalid-value: The value is not supported by local storage."'
`[Error: local-storage:invalid-value: The value is not supported by local storage.]`
);
expect(() => storageService.set("foo", BigInt(1))).toThrowErrorMatchingInlineSnapshot(
'"local-storage:invalid-value: The value is not supported by local storage."'
`[Error: local-storage:invalid-value: The value is not supported by local storage.]`
);
});

Expand Down Expand Up @@ -296,7 +296,7 @@ describe("nested namespaces", () => {
const storageService = await setup();
storageService.set("a", "invalid");
expect(() => storageService.getNamespace("a")).toThrowErrorMatchingInlineSnapshot(
"\"local-storage:invalid-path: Cannot use 'a' as a namespace because it is not associated with an object.\""
`[Error: local-storage:invalid-path: Cannot use 'a' as a namespace because it is not associated with an object.]`
);
});

Expand All @@ -305,7 +305,7 @@ describe("nested namespaces", () => {
const namespace = storageService.getNamespace("a");
storageService.set("a", 123);
expect(() => namespace.set("foo", 456)).toThrowErrorMatchingInlineSnapshot(
"\"local-storage:invalid-path: Cannot set property on 'a' because it is no object.\""
`[Error: local-storage:invalid-path: Cannot set property on 'a' because it is no object.]`
);
});

Expand All @@ -314,7 +314,7 @@ describe("nested namespaces", () => {
const namespace = storageService.getNamespace("a");
storageService.set("a", 123);
expect(() => namespace.get("foo")).toThrowErrorMatchingInlineSnapshot(
"\"local-storage:invalid-path: Cannot get nested property 'foo' because the parent is no object.\""
`[Error: local-storage:invalid-path: Cannot get nested property 'foo' because the parent is no object.]`
);
});

Expand Down
2 changes: 1 addition & 1 deletion src/packages/runtime/i18n.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ it("throws if a locale cannot be forced", () => {
expect(() =>
pickLocale("de-simple", appLocales, userLocales)
).toThrowErrorMatchingInlineSnapshot(
"\"runtime:unsupported-locale: Locale 'de-simple' cannot be forced because it is not supported by the application. Supported locales are en, zh.\""
`[Error: runtime:unsupported-locale: Locale 'de-simple' cannot be forced because it is not supported by the application. Supported locales are en, zh.]`
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ exports[`should be able to read properties from react component 1`] = `
</span>
`;

exports[`should deny access to all services if declaration is missing 1`] = `"runtime:undeclared-dependency: Package 'test' did not declare an UI dependency on all services implementing interface 'test.Provider'. Add the dependency (\\"all\\": true) to the package configuration or remove the usage."`;
exports[`should deny access to all services if declaration is missing 1`] = `[Error: runtime:undeclared-dependency: Package 'test' did not declare an UI dependency on all services implementing interface 'test.Provider'. Add the dependency ("all": true) to the package configuration or remove the usage.]`;

exports[`should deny access to service when the qualifier does not match 1`] = `"runtime:undeclared-dependency: Package 'test' did not declare an UI dependency on interface 'test.Provider' (qualifier: 'bar'). Add the dependency to the package configuration or remove the usage."`;
exports[`should deny access to service when the qualifier does not match 1`] = `[Error: runtime:undeclared-dependency: Package 'test' did not declare an UI dependency on interface 'test.Provider' (qualifier: 'bar'). Add the dependency to the package configuration or remove the usage.]`;

exports[`should get error when using undefined service 1`] = `"runtime:undeclared-dependency: Package 'test' did not declare an UI dependency on interface 'test.Provider'. Add the dependency to the package configuration or remove the usage."`;
exports[`should get error when using undefined service 1`] = `[Error: runtime:undeclared-dependency: Package 'test' did not declare an UI dependency on interface 'test.Provider'. Add the dependency to the package configuration or remove the usage.]`;

exports[`should provide the autogenerated useProperties hook 1`] = `
<div
Expand Down Expand Up @@ -57,4 +57,4 @@ exports[`should provide the autogenerated useServices hook 1`] = `
</div>
`;

exports[`should throw error when requesting properties from an unknown package 1`] = `"runtime:internal-error: Package 'test' was not found in application."`;
exports[`should throw error when requesting properties from an unknown package 1`] = `[Error: runtime:internal-error: Package 'test' was not found in application.]`;
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports[`should render a web component with a shadow dom 1`] = `

exports[`should render the same component multiple times (needs shared tag name) 1`] = `
[
"<span class=\\"hello\\">Hello</span>",
"<span class=\\"hello\\">Bye</span>",
"<span class="hello">Hello</span>",
"<span class="hello">Bye</span>",
]
`;

0 comments on commit a4817c3

Please sign in to comment.