oc-template-preact-compiler 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oc-template-preact-compiler",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "description": "Compiler for the Preact OC template",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@preact/preset-vite": "^2.7.0",
32
32
  "oc-template-preact": "^0.1.1",
33
- "oc-vite-compiler": "^4.0.2",
33
+ "oc-vite-compiler": "^4.1.0",
34
34
  "preact": "^10"
35
35
  },
36
36
  "peerDependencies": {
@@ -18,15 +18,6 @@
18
18
  "static": [
19
19
  "public"
20
20
  ]
21
- },
22
- "parameters": {
23
- "userId": {
24
- "default": 1,
25
- "description": "The user id from the user database",
26
- "example": 1,
27
- "mandatory": true,
28
- "type": "number"
29
- }
30
21
  }
31
22
  },
32
23
  "dependencies": {},
@@ -17,12 +17,24 @@ describe('App - Page', () => {
17
17
  it('Gets more data when clicking the button', () => {
18
18
  getData.mockImplementationOnce(() => Promise.resolve({}));
19
19
  render(
20
- <DataProvider value={{ firstName: 'firstName', lastName: 'lastName', userId: 0, getData }}>
21
- <App firstName="firstName" lastName="lastName" userId={0} />
20
+ <DataProvider
21
+ value={{
22
+ firstName: 'firstName',
23
+ lastName: 'lastName',
24
+ userId: 0,
25
+ getData,
26
+ }}
27
+ >
28
+ <App
29
+ firstName="firstName"
30
+ lastName="lastName"
31
+ born={1991}
32
+ hobbies={[]}
33
+ />
22
34
  </DataProvider>
23
35
  );
24
36
 
25
- const extraInfoButton = screen.getByText(/Get extra information/i);
37
+ const extraInfoButton = screen.getByText(/Fun year fact/i);
26
38
  expect(extraInfoButton).toBeTruthy();
27
39
  });
28
40
  });
@@ -20,7 +20,16 @@ async function getFunFact(year: number) {
20
20
  }
21
21
 
22
22
  export const server = new Server()
23
- .handler(async (params: { userId: number }) => {
23
+ .withParameters({
24
+ userId: {
25
+ default: 1,
26
+ description: 'The user id from the user database',
27
+ example: 1,
28
+ mandatory: true,
29
+ type: 'number',
30
+ },
31
+ })
32
+ .handler(async (params) => {
24
33
  const { userId } = params;
25
34
  const user = await getUser(userId);
26
35
  const [firstName, lastName] = user.name.split(/\s+/);