diff --git a/frontend/apps/editor3d/app/src/components/signaled/TopBar/TopBar.tsx b/frontend/apps/editor3d/app/src/components/signaled/TopBar/TopBar.tsx index 10907d2ebf..4c52053bf1 100644 --- a/frontend/apps/editor3d/app/src/components/signaled/TopBar/TopBar.tsx +++ b/frontend/apps/editor3d/app/src/components/signaled/TopBar/TopBar.tsx @@ -156,13 +156,13 @@ export const TopBar = ({ pageName, loginSignUpPressed }: Props) => { const creditsStore = useCreditsState(); const sumTotalCredits = creditsStore.totalCredits; - //const subscriptionStore = useSubscriptionState(); - //const hasPaidPlan = subscriptionStore.hasPaidPlan(); - const hasPaidPlan = false; + // Just calling this function kills the app: + const subscriptionStore = useSubscriptionState(); + const hasPaidPlan = subscriptionStore.hasPaidPlan(); useEffect(() => { creditsStore.fetchFromServer(); - //subscriptionStore.fetchFromServer(); + subscriptionStore.fetchFromServer(); }, []); useCreditsBalanceChangedEvent(async () => { @@ -170,7 +170,7 @@ export const TopBar = ({ pageName, loginSignUpPressed }: Props) => { }); useSubscriptionPlanChangedEvent(async () => { - //subscriptionStore.fetchFromServer(); + subscriptionStore.fetchFromServer(); }); const disableTabSwitcher = () => { diff --git a/frontend/libs/state/subscription/package.json b/frontend/libs/state/subscription/package.json index 5ac07d5180..47e4fc873f 100644 --- a/frontend/libs/state/subscription/package.json +++ b/frontend/libs/state/subscription/package.json @@ -1,7 +1,6 @@ { "name": "@storyteller/subscription", "version": "0.0.1", - "private": true, "type": "module", "main": "./dist/index.js", "module": "./dist/index.js", diff --git a/frontend/libs/state/subscription/src/index.ts b/frontend/libs/state/subscription/src/index.ts index e557558cab..eb81a7b19e 100644 --- a/frontend/libs/state/subscription/src/index.ts +++ b/frontend/libs/state/subscription/src/index.ts @@ -1,4 +1,4 @@ -export * from './lib/subscription-plan-details.js'; -export * from './lib/subscription-plans.js'; -export * from './lib/subscription-state.js'; +export * from './lib/subscription-plan-details'; +export * from './lib/subscription-plans'; +export * from './lib/subscription-state'; diff --git a/frontend/libs/state/subscription/tsconfig.spec.json b/frontend/libs/state/subscription/tsconfig.spec.json index 8ea0b9c41b..b1ea04c1be 100644 --- a/frontend/libs/state/subscription/tsconfig.spec.json +++ b/frontend/libs/state/subscription/tsconfig.spec.json @@ -1,19 +1,28 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./out-tsc/vitest", + "outDir": "dist", "types": [ - "vitest/globals", - "vitest/importMeta", - "vite/client", "node", - "vitest" + "@nx/react/typings/cssmodule.d.ts", + "@nx/react/typings/image.d.ts", + "vite/client" ], - "module": "nodenext", - "moduleResolution": "nodenext", - "forceConsistentCasingInFileNames": true + "rootDir": "src", + "jsx": "react-jsx", + "tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo" }, - "include": [ + "exclude": [ + "out-tsc", + "dist", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.spec.tsx", + "**/*.test.tsx", + "**/*.spec.js", + "**/*.test.js", + "**/*.spec.jsx", + "**/*.test.jsx", "vite.config.ts", "vite.config.mts", "vitest.config.ts", @@ -25,12 +34,17 @@ "src/**/*.test.js", "src/**/*.spec.js", "src/**/*.test.jsx", - "src/**/*.spec.jsx", - "src/**/*.d.ts" + "src/**/*.spec.jsx" + ], + "include": [ + "src/**/*.js", + "src/**/*.jsx", + "src/**/*.ts", + "src/**/*.tsx" ], "references": [ { - "path": "./tsconfig.lib.json" + "path": "../../tauri-api/tsconfig.lib.json" } ] } diff --git a/frontend/libs/state/subscription/vite.config.ts b/frontend/libs/state/subscription/vite.config.ts index d7e70d3882..3856f64387 100644 --- a/frontend/libs/state/subscription/vite.config.ts +++ b/frontend/libs/state/subscription/vite.config.ts @@ -1,12 +1,13 @@ /// import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; import dts from 'vite-plugin-dts'; import * as path from 'path'; export default defineConfig(() => ({ root: __dirname, cacheDir: '../../../node_modules/.vite/libs/state/subscription', - plugins: [dts({ entryRoot: 'src', tsconfigPath: path.join(__dirname, 'tsconfig.lib.json') })], + plugins: [react(), dts({ entryRoot: 'src', tsconfigPath: path.join(__dirname, 'tsconfig.lib.json') })], // Uncomment this if you are using workers. // worker: { // plugins: [ nxViteTsPaths() ], @@ -31,7 +32,7 @@ export default defineConfig(() => ({ }, rollupOptions: { // External packages that should not be bundled into your library. - external: [] + external: ['react','react-dom','react/jsx-runtime'] }, }, test: {