Skip to content
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
30 changes: 0 additions & 30 deletions integrations/react/README.md

This file was deleted.

17 changes: 9 additions & 8 deletions integrations/react/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ import { mergeConfig, defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import { tanstackBuildConfig } from '@tanstack/config/build'

const config = defineConfig({
plugins: [react()],
test: {
name: 'react-integration',
watch: false,
},
})

export default mergeConfig(
config,
tanstackBuildConfig({
entry: 'src/index.ts',
srcDir: 'src',
exclude: ['src/__tests__'],
}),
defineConfig({
plugins: [react()],
test: {
name: 'react',
watch: false,
},
}),
)
24 changes: 24 additions & 0 deletions integrations/solid/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
15 changes: 15 additions & 0 deletions integrations/solid/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "solid-integration",
"private": true,
"type": "module",
"scripts": {
"test:build": "vite build && vitest"
},
"dependencies": {
"solid-js": "^1.8.7"
},
"devDependencies": {
"@tanstack/config": "<1.0.0",
"vite-plugin-solid": "^2.8.0"
}
}
17 changes: 17 additions & 0 deletions integrations/solid/snap/cjs/App.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use strict";
const web = require("solid-js/web");
const solidJs = require("solid-js");
const _tmpl$ = /* @__PURE__ */ web.template(`<h1>Vite + Solid`), _tmpl$2 = /* @__PURE__ */ web.template(`<div class=card><button>count is </button><p>Edit <code>src/App.tsx</code> and save to test HMR`), _tmpl$3 = /* @__PURE__ */ web.template(`<p class=read-the-docs>Click on the Vite and Solid logos to learn more`);
function App() {
const [count, setCount] = solidJs.createSignal(0);
return [_tmpl$(), (() => {
const _el$2 = _tmpl$2(), _el$3 = _el$2.firstChild;
_el$3.firstChild;
_el$3.$$click = () => setCount((count2) => count2 + 1);
web.insert(_el$3, count, null);
return _el$2;
})(), _tmpl$3()];
}
web.delegateEvents(["click"]);
module.exports = App;
//# sourceMappingURL=App.cjs.map
1 change: 1 addition & 0 deletions integrations/solid/snap/cjs/App.cjs.map

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

2 changes: 2 additions & 0 deletions integrations/solid/snap/cjs/App.d.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare function App(): import("solid-js").JSX.Element;
export default App;
5 changes: 5 additions & 0 deletions integrations/solid/snap/cjs/index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const App = require("./App.cjs");
exports.App = App;
//# sourceMappingURL=index.cjs.map
1 change: 1 addition & 0 deletions integrations/solid/snap/cjs/index.cjs.map

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

1 change: 1 addition & 0 deletions integrations/solid/snap/cjs/index.d.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as App } from './App';
2 changes: 2 additions & 0 deletions integrations/solid/snap/esm/App.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare function App(): import("solid-js").JSX.Element;
export default App;
18 changes: 18 additions & 0 deletions integrations/solid/snap/esm/App.js

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

1 change: 1 addition & 0 deletions integrations/solid/snap/esm/App.js.map

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

1 change: 1 addition & 0 deletions integrations/solid/snap/esm/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as App } from './App';
5 changes: 5 additions & 0 deletions integrations/solid/snap/esm/index.js

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

1 change: 1 addition & 0 deletions integrations/solid/snap/esm/index.js.map

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

24 changes: 24 additions & 0 deletions integrations/solid/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { createSignal } from 'solid-js'

function App() {
const [count, setCount] = createSignal(0)

return (
<>
<h1>Vite + Solid</h1>
<div class="card">
<button onClick={() => setCount((count) => count + 1)}>
count is {count()}
</button>
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
</div>
<p class="read-the-docs">
Click on the Vite and Solid logos to learn more
</p>
</>
)
}

export default App
1 change: 1 addition & 0 deletions integrations/solid/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as App } from './App'
41 changes: 41 additions & 0 deletions integrations/solid/tests/build.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { readFileSync, readdirSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
import { dirname, resolve } from 'node:path'
import { describe, expect, it } from 'vitest'

const __dirname = dirname(fileURLToPath(import.meta.url))
const rootDir = resolve(__dirname, '..')

const esmExtensions = ['.js', '.js.map', '.d.ts']
const cjsExtensions = ['.cjs', '.cjs.map', '.d.cts']

const files = ['index', 'App']

describe('Check Solid build output', () => {
it('should output the same file structure', () => {
const distFiles = readdirSync(`${rootDir}/dist`, { recursive: true })
const snapFiles = readdirSync(`${rootDir}/snap`, { recursive: true })

expect(distFiles).toEqual(snapFiles)
})

it('should build the same ESM output', () => {
files.forEach((file) => {
esmExtensions.forEach((ext) => {
expect(
readFileSync(`${rootDir}/dist/esm/${file}${ext}`).toString(),
).toMatchFileSnapshot(`${rootDir}/snap/esm/${file}${ext}`)
})
})
})

it('should build the same CJS output', () => {
files.forEach((file) => {
cjsExtensions.forEach((ext) => {
expect(
readFileSync(`${rootDir}/dist/cjs/${file}${ext}`).toString(),
).toMatchFileSnapshot(`${rootDir}/snap/cjs/${file}${ext}`)
})
})
})
})
25 changes: 25 additions & 0 deletions integrations/solid/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src", "tests", "vite.config.ts"]
}
19 changes: 19 additions & 0 deletions integrations/solid/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { mergeConfig, defineConfig } from 'vitest/config'
import solid from 'vite-plugin-solid'
import { tanstackBuildConfig } from '@tanstack/config/build'

const config = defineConfig({
plugins: [solid()],
test: {
name: 'solid-integration',
watch: false,
},
})

export default mergeConfig(
config,
tanstackBuildConfig({
entry: 'src/index.ts',
srcDir: 'src',
}),
)
18 changes: 0 additions & 18 deletions integrations/vue/README.md

This file was deleted.

17 changes: 9 additions & 8 deletions integrations/vue/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ import { mergeConfig, defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
import { tanstackBuildConfig } from '@tanstack/config/build'

const config = defineConfig({
plugins: [vue()],
test: {
name: 'vue-integration',
watch: false,
},
})

export default mergeConfig(
config,
tanstackBuildConfig({
entry: 'src/index.ts',
srcDir: 'src',
exclude: ['src/__tests__'],
}),
defineConfig({
plugins: [vue()],
test: {
name: 'react',
watch: false,
},
}),
)
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"jsdom": "^23.0.1",
"nx": "^17.2.8",
"prettier": "^4.0.0-alpha.8",
"publint": "^0.2.7",
Expand Down
Loading