oc-template-react-compiler 7.0.2 → 7.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-react-compiler",
3
- "version": "7.0.2",
3
+ "version": "7.1.0",
4
4
  "description": "Compiler for the React OC template",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@vitejs/plugin-react": "^4.3.1",
32
32
  "oc-template-react": "^4.1.0",
33
- "oc-vite-compiler": "^4.0.1",
33
+ "oc-vite-compiler": "^4.1.0",
34
34
  "react": "18.2.0",
35
35
  "react-dom": "18.2.0"
36
36
  },
@@ -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": {},
@@ -35,8 +26,8 @@
35
26
  "@testing-library/user-event": "^14.4.3",
36
27
  "@types/react": "^18.0.28",
37
28
  "jsdom": "^21.1.1",
38
- "oc-server": "^2.0.1",
39
- "oc-template-react-compiler": "^7.0.1",
29
+ "oc-server": "^2.0.4",
30
+ "oc-template-react-compiler": "^7.0.3",
40
31
  "react": "18.3.1",
41
32
  "react-dom": "18.3.1",
42
33
  "typescript": "5.1.3",
@@ -26,14 +26,19 @@ describe('App - Page', () => {
26
26
  lastName: 'lastName',
27
27
  userId: 0,
28
28
  getData,
29
- getSetting
29
+ getSetting,
30
30
  }}
31
31
  >
32
- <App firstName="firstName" lastName="lastName" userId={0} />
32
+ <App
33
+ firstName="firstName"
34
+ lastName="lastName"
35
+ born={1991}
36
+ hobbies={[]}
37
+ />
33
38
  </DataProvider>
34
39
  );
35
40
 
36
- const extraInfoButton = screen.getByText(/Get extra information/i);
41
+ const extraInfoButton = screen.getByText(/Fun year fact/i);
37
42
  expect(extraInfoButton).toBeTruthy();
38
43
  });
39
44
  });
@@ -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+/);