oc-template-solid-compiler 0.0.2 → 0.0.4
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/lib/compile.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const createCompile = require('oc-generic-template-compiler').createCompile;
|
|
4
4
|
const compileStatics = require('oc-statics-compiler');
|
|
5
|
-
const getInfo = require('oc-template-
|
|
5
|
+
const getInfo = require('oc-template-typescript-react').getInfo;
|
|
6
6
|
const solid = require('vite-plugin-solid');
|
|
7
7
|
|
|
8
8
|
const viteView = require('./to-publish/viteView');
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "sold",
|
|
3
3
|
"description": "",
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint --max-warnings 0 --ext .js,.jsx,.ts,.tsx src",
|
|
7
7
|
"build": "tsc --noEmit && oc package .",
|
|
8
|
-
"test": "vitest"
|
|
8
|
+
"test": "vitest",
|
|
9
|
+
"start": "oc dev .. --components sold"
|
|
9
10
|
},
|
|
10
11
|
"oc": {
|
|
11
12
|
"files": {
|
|
@@ -28,13 +29,13 @@
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
},
|
|
31
|
-
"dependencies": {},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@testing-library
|
|
34
|
-
"@testing-library/
|
|
33
|
+
"@solidjs/testing-library": "^0.7.0",
|
|
34
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
35
|
+
"@types/testing-library__jest-dom": "^5.14.5",
|
|
35
36
|
"jsdom": "^21.1.1",
|
|
36
37
|
"oc-template-solid": "0.0.1",
|
|
37
|
-
"oc-template-solid-compiler": "0.0.
|
|
38
|
+
"oc-template-solid-compiler": "0.0.4",
|
|
38
39
|
"solid-js": "^1.7.0",
|
|
39
40
|
"typescript": "5.0.2",
|
|
40
41
|
"vitest": "^0.29.7"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, afterEach, beforeEach, expect, vi } from 'vitest';
|
|
2
|
-
import { render
|
|
2
|
+
import { render } from '@solidjs/testing-library';
|
|
3
3
|
import { DataProvider } from 'oc-template-solid-compiler/utils/useData';
|
|
4
4
|
|
|
5
5
|
import App from './App';
|
|
@@ -16,13 +16,20 @@ describe('App - Page', () => {
|
|
|
16
16
|
|
|
17
17
|
it('Gets more data when clicking the button', () => {
|
|
18
18
|
getData.mockImplementationOnce(() => Promise.resolve({}));
|
|
19
|
-
render(
|
|
20
|
-
<DataProvider
|
|
21
|
-
|
|
19
|
+
const { getByText } = render(() => (
|
|
20
|
+
<DataProvider
|
|
21
|
+
value={{
|
|
22
|
+
firstName: 'firstName',
|
|
23
|
+
lastName: 'lastName',
|
|
24
|
+
userId: 0,
|
|
25
|
+
getData,
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<App />
|
|
22
29
|
</DataProvider>
|
|
23
|
-
);
|
|
30
|
+
));
|
|
24
31
|
|
|
25
|
-
const extraInfoButton =
|
|
32
|
+
const extraInfoButton = getByText(/Get extra information/i);
|
|
26
33
|
expect(extraInfoButton).toBeTruthy();
|
|
27
34
|
});
|
|
28
35
|
});
|
package/scaffold/src/src/App.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createSignal, Show, For } from 'solid-js';
|
|
2
|
-
import { useData } from 'oc-template-
|
|
2
|
+
import { useData } from 'oc-template-solid-compiler/utils/useData';
|
|
3
3
|
import styles from './styles.css';
|
|
4
4
|
import type { AdditionalData, ClientProps } from './types';
|
|
5
5
|
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"moduleResolution": "node",
|
|
20
20
|
"resolveJsonModule": true,
|
|
21
21
|
"isolatedModules": true,
|
|
22
|
-
"jsx": "
|
|
23
|
-
"jsxImportSource": "
|
|
22
|
+
"jsx": "preserve",
|
|
23
|
+
"jsxImportSource": "solid-js"
|
|
24
24
|
},
|
|
25
25
|
"include": ["src"],
|
|
26
26
|
"exclude": ["src/_package"]
|
|
@@ -4,6 +4,15 @@ import { defineConfig } from 'vite';
|
|
|
4
4
|
export default defineConfig({
|
|
5
5
|
// @ts-ignore Missing test property
|
|
6
6
|
test: {
|
|
7
|
-
environment: 'jsdom'
|
|
8
|
-
|
|
7
|
+
environment: 'jsdom',
|
|
8
|
+
globals: true,
|
|
9
|
+
transformMode: { web: [/\.[jt]sx?$/] },
|
|
10
|
+
setupFiles: ['node_modules/@testing-library/jest-dom/extend-expect.js'],
|
|
11
|
+
// otherwise, solid would be loaded twice:
|
|
12
|
+
deps: { registerNodeLoader: true },
|
|
13
|
+
// if you have few tests, try commenting one
|
|
14
|
+
// or both out to improve performance:
|
|
15
|
+
threads: false,
|
|
16
|
+
isolate: false,
|
|
17
|
+
},
|
|
9
18
|
});
|