diff --git a/apps/web-ui/app/root.tsx b/apps/web-ui/app/root.tsx index aa89ec5e..a3af85c5 100644 --- a/apps/web-ui/app/root.tsx +++ b/apps/web-ui/app/root.tsx @@ -175,7 +175,6 @@ export default function App() { diff --git a/apps/web-ui/app/routes/invocations.tsx b/apps/web-ui/app/routes/invocations.tsx new file mode 100644 index 00000000..47a0a187 --- /dev/null +++ b/apps/web-ui/app/routes/invocations.tsx @@ -0,0 +1,3 @@ +import { invocations } from '@restate/features/invocations-route'; + +export default invocations.Component; diff --git a/libs/features/invocations-route/.babelrc b/libs/features/invocations-route/.babelrc new file mode 100644 index 00000000..1ea870ea --- /dev/null +++ b/libs/features/invocations-route/.babelrc @@ -0,0 +1,12 @@ +{ + "presets": [ + [ + "@nx/react/babel", + { + "runtime": "automatic", + "useBuiltIns": "usage" + } + ] + ], + "plugins": [] +} diff --git a/libs/features/invocations-route/README.md b/libs/features/invocations-route/README.md new file mode 100644 index 00000000..9f70b792 --- /dev/null +++ b/libs/features/invocations-route/README.md @@ -0,0 +1,7 @@ +# invocations-route + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test invocations-route` to execute the unit tests via [Vitest](https://vitest.dev/). diff --git a/libs/features/invocations-route/eslint.config.js b/libs/features/invocations-route/eslint.config.js new file mode 100644 index 00000000..2016babe --- /dev/null +++ b/libs/features/invocations-route/eslint.config.js @@ -0,0 +1,12 @@ +const nx = require('@nx/eslint-plugin'); +const baseConfig = require('../../../eslint.config.js'); + +module.exports = [ + ...baseConfig, + ...nx.configs['flat/react'], + { + files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'], + // Override or add rules here + rules: {}, + }, +]; diff --git a/libs/features/invocations-route/project.json b/libs/features/invocations-route/project.json new file mode 100644 index 00000000..f9fad5dc --- /dev/null +++ b/libs/features/invocations-route/project.json @@ -0,0 +1,9 @@ +{ + "name": "invocations-route", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/features/invocations-route/src", + "projectType": "library", + "tags": [], + "// targets": "to see all targets run: nx show project invocations-route --web", + "targets": {} +} diff --git a/libs/features/invocations-route/src/index.ts b/libs/features/invocations-route/src/index.ts new file mode 100644 index 00000000..a3c78d63 --- /dev/null +++ b/libs/features/invocations-route/src/index.ts @@ -0,0 +1 @@ +export * from './lib/invocations.route'; diff --git a/libs/features/invocations-route/src/lib/invocations.route.tsx b/libs/features/invocations-route/src/lib/invocations.route.tsx new file mode 100644 index 00000000..8f8fb833 --- /dev/null +++ b/libs/features/invocations-route/src/lib/invocations.route.tsx @@ -0,0 +1,40 @@ +import { Code, Snippet } from '@restate/ui/code'; +import { Link } from '@restate/ui/link'; + +function Component() { + return ( +
+
+

Coming soon!

+

+ The Invocations page is currently under development and will be + available soon. In the meantime, you can use our{' '} + + CLI + {' '} + to manage invocations. Below are a few examples of how you can use CLI + commands to perform tasks: +

+ + #List the invocations + + restate invocations list + + + #Cancel an invocation + + {`restate invocation cancel `} + +
+
+ ); +} + +export const invocations = { Component }; diff --git a/libs/features/invocations-route/tsconfig.json b/libs/features/invocations-route/tsconfig.json new file mode 100644 index 00000000..4daaf45c --- /dev/null +++ b/libs/features/invocations-route/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "allowJs": false, + "esModuleInterop": false, + "allowSyntheticDefaultImports": true, + "strict": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ], + "extends": "../../../tsconfig.base.json" +} diff --git a/libs/features/invocations-route/tsconfig.lib.json b/libs/features/invocations-route/tsconfig.lib.json new file mode 100644 index 00000000..61dcc663 --- /dev/null +++ b/libs/features/invocations-route/tsconfig.lib.json @@ -0,0 +1,32 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "types": [ + "node", + "@nx/react/typings/cssmodule.d.ts", + "@nx/react/typings/image.d.ts" + ] + }, + "exclude": [ + "**/*.spec.ts", + "**/*.test.ts", + "**/*.spec.tsx", + "**/*.test.tsx", + "**/*.spec.js", + "**/*.test.js", + "**/*.spec.jsx", + "**/*.test.jsx", + "vite.config.ts", + "vitest.config.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.test.tsx", + "src/**/*.spec.tsx", + "src/**/*.test.js", + "src/**/*.spec.js", + "src/**/*.test.jsx", + "src/**/*.spec.jsx" + ], + "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"] +} diff --git a/libs/features/invocations-route/tsconfig.spec.json b/libs/features/invocations-route/tsconfig.spec.json new file mode 100644 index 00000000..05a0e183 --- /dev/null +++ b/libs/features/invocations-route/tsconfig.spec.json @@ -0,0 +1,26 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "types": [ + "vitest/globals", + "vitest/importMeta", + "vite/client", + "node", + "vitest" + ] + }, + "include": [ + "vite.config.ts", + "vitest.config.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.test.tsx", + "src/**/*.spec.tsx", + "src/**/*.test.js", + "src/**/*.spec.js", + "src/**/*.test.jsx", + "src/**/*.spec.jsx", + "src/**/*.d.ts" + ] +} diff --git a/libs/features/invocations-route/vite.config.ts b/libs/features/invocations-route/vite.config.ts new file mode 100644 index 00000000..2e5e13d9 --- /dev/null +++ b/libs/features/invocations-route/vite.config.ts @@ -0,0 +1,25 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; +import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; +import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin'; + +export default defineConfig({ + root: __dirname, + cacheDir: '../../../node_modules/.vite/libs/features/invocations-route', + plugins: [react(), nxViteTsPaths(), nxCopyAssetsPlugin(['*.md'])], + // Uncomment this if you are using workers. + // worker: { + // plugins: [ nxViteTsPaths() ], + // }, + test: { + watch: false, + globals: true, + environment: 'jsdom', + include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + reporters: ['default'], + coverage: { + reportsDirectory: '../../../coverage/libs/features/invocations-route', + provider: 'v8', + }, + }, +}); diff --git a/tsconfig.base.json b/tsconfig.base.json index 40704b8c..a1c1ec50 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -27,6 +27,9 @@ "@restate/data-access/admin-api/spec": [ "libs/data-access/admin-api/src/api.ts" ], + "@restate/features/invocations-route": [ + "libs/features/invocations-route/src/index.ts" + ], "@restate/features/overview-route": [ "libs/features/overview-route/src/index.ts" ],