Skip to content

Commit

Permalink
🐛 Fix a bug for npm
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob committed Feb 2, 2024
1 parent 59410c1 commit ee210ea
Show file tree
Hide file tree
Showing 9 changed files with 329 additions and 71 deletions.
5 changes: 5 additions & 0 deletions .changeset/happy-feet-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@panora/integration-card-react": major
---

fix
11 changes: 9 additions & 2 deletions apps/embedded-catalog/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
"preview": "vite preview"
},
"dependencies": {
"@panora/shared": "workspace:*",
"@tanstack/react-query": "^5.12.2",
"api": "workspace:*",
"@panora/shared": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-loader-spinner": "^5.4.5"
"react-loader-spinner": "^5.4.5",
"vite-plugin-dts": "^3.7.2"
},
"devDependencies": {
"@types/react": "^18.2.43",
Expand All @@ -31,8 +32,14 @@
"typescript": "^5.2.2",
"vite": "^5.0.8"
},
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@tanstack/react-query": "^5.12.2"
},
"main": "./dist/integration-card.umd.js",
"module": "./dist/integration-card.es.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/integration-card.es.js",
Expand Down
10 changes: 8 additions & 2 deletions apps/embedded-catalog/react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,29 @@
"module": "ESNext",
"skipLibCheck": true,
"paths": {
"integration-card": [ "./src/component/index.ts" ],
"@/*": [
"./src/*"
],
},
/* Bundler mode */
"moduleResolution": "bundler",
"moduleResolution": "Node",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"allowSyntheticDefaultImports": true,

/* Linting */
"strict": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
"typeRoots": [
"node_modules/@types",
"src/component/index.d.ts"
]
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
Expand Down
5 changes: 3 additions & 2 deletions apps/embedded-catalog/react/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"moduleResolution": "Node",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
"include": ["vite.config.ts", "package.json"]
}
21 changes: 12 additions & 9 deletions apps/embedded-catalog/react/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import path from 'path'
import dts from 'vite-plugin-dts'
import * as packageJson from './package.json'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [
react(),
dts({
include: ['src/component/'],
})
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
},
build: {
lib: {
entry: path.resolve("", 'src/components/index.ts'),
entry: path.resolve("src", 'components/index.ts'),
name: 'integration-card',
fileName: (format) => `integration-card.${format}.ts`
formats: ['es', 'umd'],
fileName: (format) => `integration-card.${format}.js`
},
rollupOptions: {
external: ['react', 'react-dom'],
output: {
globals: {
react: 'React'
}
}
external:[...Object.keys(packageJson.peerDependencies)],
}
},
})
3 changes: 1 addition & 2 deletions apps/magic-link/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"ci": "pnpm run lint && pnpm run build"
},
"dependencies": {
"@panora/integration-card-react": "workspace:^",
"@panora/shared": "workspace:*",
"@panora/shared": "^0.0.1",
"@panora/typescript-sdk": "^1.0.3",
"@tanstack/react-query": "^5.12.2",
"api": "workspace:*",
Expand Down
6 changes: 0 additions & 6 deletions apps/magic-link/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import './App.css'
import ProviderModal from './lib/ProviderModal'
import { PanoraSDK } from "@panora/typescript-sdk";
//import { PanoraIntegrationCard } from "@panora/integration-card-react";

function App() {
const sdk = new PanoraSDK({accessToken: 'YOUR_ACCESS_TOKEN'});
Expand All @@ -12,15 +11,10 @@ function App() {
console.log(result);
})();

const queryClient = new QueryClient();

return (
<QueryClientProvider client={queryClient}>
<div className="card">
{/*<PanoraIntegrationCard name={"1"} projectId={"1"} returnUrl={"1"} linkedUserIdOrRemoteUserInfo={"1"} />*/}
<ProviderModal/>
</div>
</QueryClientProvider>
)
}

Expand Down
7 changes: 6 additions & 1 deletion apps/magic-link/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import './index.css'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'

const queryClient = new QueryClient();

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
<QueryClientProvider client={queryClient}>
<App />
</QueryClientProvider>
</React.StrictMode>,
)
Loading

0 comments on commit ee210ea

Please sign in to comment.