Closed darr1s closed 10 months ago
hey @darr1s,
can you try a top-level import? if you cannot do that, why not?
import { RunnableWs } from '@runnablejs/sdk';
otherwise, you might be able to use require
:
const RunnableWs = require('@runnablejs/sdk').RunnableWs;
Hey there! On a second note, I think its not related to my own tsconfig.
As I gotten @runnable/api installed, I noticed node_modules/@runnable/api/index.ts
is indeed not exporting ids
from the package. Could it be the npm release are not up to date?
You might be right, I can investigate and fix the published typed. In the meantime, I think you can add "skipLibCheck": true
in your tsconfig.json
@darr1s, i just released 0.4.14
. can you try that out?
I'm on 0.4.14
, still facing the same issues.
1 import type { NamespaceId, WorkflowId, WorkflowTypeId } from './ids';
~~~~~~~
node_modules/.pnpm/@runnablejs+api@0.4.14/node_modules/@runnablejs/api/index.ts:4:15 - error TS2307: Cannot find module './ids' or its corresponding type declarations.
4 export * from './ids';
~~~~~~~
node_modules/.pnpm/@runnablejs+api@0.4.14/node_modules/@runnablejs/api/ws.ts:2:62 - error TS2307: Cannot find module './ids' or its corresponding type declarations.
2 import type { WorkflowId, NamespaceId, WorkflowTypeId } from './ids';
~~~~~~~
src/main.ts:74:39 - error TS2339: Property '_events' does not exist on type 'Server<typeof IncomingMessage, typeof ServerResponse>'.
74 installRunnable(app.getHttpServer()._events.request, actions, context);
~~~~~~~
@darr1s, apologies for the consistent typing issues (but that is all they are and the JS should still run fine if you want to ignore the type errors)
you can use 0.4.15
which should fix both of those. i've updated the nestjs docs too, so all you need to do instead is:
installRunnable(app, actions, context);
Hey @mscolnick, again, thanks for the prompt response!
I managed to see the interface at the URL. However, the form is rendering empty.
What I have tried:
RUNNABLE_AUTH_PROVIDER_FORM
This is my env:
RUNNABLE_AUTH_PROVIDER_FORM=false
RUNNABLE_BASE_URL="playground"
RUNNABLE_SECRET="super-duper-s3cret"
RUNNABLE_AUTH_SECRET="another-secret"
This is my context provider:
export const RunnableAppContextProvider: Provider<RunnableAppContext> = {
provide: 'RUNNABLE_CONTEXT',
inject: [AuthService],
useFactory: (authService: AuthService) => ({
auth: {
form: {
verifyLogin: async ({ email, password }) => {
const auth = await authService.challengeAdmin({ loginType: AuthenticationMethodField.EMAIL_PASSWORD, email, password });
if (!auth) throw new Error('Invalid credentials');
return {
id: '1',
email: email,
name: 'Admin'
}
},
}
},
}),
};
This is my console output: (I believe the line __session comes from @runnable/app remix, but I not sure if its the cause)
[12:33:42 PM] Found 0 errors. Watching for file changes.
**The "__session" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://remix.run/utils/cookies#signing-cookies for more information.**
NewRelicInterceptor instantiated
**Installing Runnable at /playground**
INFO [2023-10-28T04:33:45.133Z]: Starting Nest application... {"context":"NestFactory"}
On a side note, I am actually a Prisma user and have been searching for solutions that allow developers to quickly get a playground (admin with CRUD and custom actions). I've checked a few solutions out there, some are hosted open/core such as Forest Admin, Retool, some are open source code-first AdminJS, Refine etc.
However, all of those mentioned did not utilize Prisma exposed DMMF to automatically provide CRUD and allows custom action to be defined easily. Your solution is the closest, and I just wanted to ask you about your roadmap to understand and align better.
May I know what is your goal/roadmap for the library?
Hmm it looks like your environment variables are not being picked up. Can you try printing out your process.env right before installRunnable
.
For roadmap, I don't really have one. This isn't an active project I'm working on (currently building https://github.com/marimo-team/marimo), but I will happily support it and build small features if they are requested in the issues.
I've used Runnable in 3 projects now and continue to do so. It does everything I need at the moment, but will continue to improve it over time when features are needed.
oh also looking at your env, you should set RUNNABLE_AUTH_PROVIDER_FORM=true
. right now you need some sort of auth: either a form
(email/password) or google oauth. we can also support more as needed
It seems like the package is pure CJS, is there a plan to support import?