Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contribution documentation: Local setup to be able to develop and use Prisma #574

Closed
janpio opened this issue Sep 19, 2019 · 5 comments
Closed
Assignees
Labels
kind/feature A request for a new feature.
Milestone

Comments

@janpio
Copy link
Contributor

janpio commented Sep 19, 2019

Currently it is not trivial to find out what one has to do to get a working setup with the multiple packages, what commands to use in what order etc.

It would be nice if we have a CONTRIBUTING.md (or other documentation) that explains how to set up your local environment to confidently edit code, test it and then create a PR from that.

(Also for Windows if possible)

@janpio janpio changed the title Contribution documentation: Local setup to be able to use CLI Contribution documentation: Local setup to be able to develop and use CLI Sep 19, 2019
@janpio janpio changed the title Contribution documentation: Local setup to be able to develop and use CLI Contribution documentation: Local setup to be able to develop and use Prisma Sep 19, 2019
@janpio
Copy link
Contributor Author

janpio commented Sep 19, 2019

image

@timsuchanek
Copy link
Contributor

All three main repos now have a CONTRIBUTING.md, linking to https://github.com/prisma/prisma2-development-environment

@nikolasburk
Copy link
Member

I adjusted path to src/bin.ts in the Lift section. Also, I couldn't actually tried to follow the instructions for both Lift and the init command an in both cases I just got an error when I ran bin.ts, not sure if that had something to do with my environment though or I was missing anything 🙈

The issue with Lift:

~/D/p/l/e/blog (master|✔) $ ts-node ../../src/bin.ts up
The above error occurred in the <TabIndexProvider> component:
    in TabIndexProvider
    in App

React will try to recreate this component tree from scratch using the error boundary you provided, App.
Warning: App: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem. [object Promise]

The issue with init:

~/D/p/p/c/i/test (master|✔) $ ts-node ../src/bin.ts
The above error occurred in the <TabIndexProvider> component:
    in TabIndexProvider
    in div (created by Box)
    in Box
    in Unknown
    in App

React will try to recreate this component tree from scratch using the error boundary you provided, App.
Warning: App: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
    at resolveDispatcher (/Users/nikolasburk/Desktop/prisma2-development-environment/prisma2/cli/ink-components/node_modules/react/cjs/react.development.js:1590:13)
    at useContext (/Users/nikolasburk/Desktop/prisma2-development-environment/prisma2/cli/ink-components/node_modules/react/cjs/react.development.js:1598:20)
    at Object._default (/Users/nikolasburk/Desktop/prisma2-development-environment/prisma2/cli/ink-components/node_modules/ink/build/hooks/use-stdin.js:14:44)
    at Object.useStdin (/Users/nikolasburk/Desktop/prisma2-development-environment/prisma2/cli/ink-components/src/hooks/useStdin.ts:11:9)
    at TabIndexProvider (/Users/nikolasburk/Desktop/prisma2-development-environment/prisma2/cli/ink-components/src/components/TabIndex.tsx:75:3)
    at renderWithHooks (/Users/nikolasburk/Desktop/prisma2-development-environment/prisma2/cli/introspection/node_modules/react-reconciler/cjs/react-reconciler.development.js:5671:18)
    at mountIndeterminateComponent (/Users/nikolasburk/Desktop/prisma2-development-environment/prisma2/cli/introspection/node_modules/react-reconciler/cjs/react-reconciler.development.js:7905:13)
    at beginWork$1 (/Users/nikolasburk/Desktop/prisma2-development-environment/prisma2/cli/introspection/node_modules/react-reconciler/cjs/react-reconciler.development.js:9049:16)
    at Object.invokeGuardedCallbackImpl (/Users/nikolasburk/Desktop/prisma2-development-environment/prisma2/cli/introspection/node_modules/react-reconciler/cjs/react-reconciler.development.js:10317:10)
    at invokeGuardedCallback (/Users/nikolasburk/Desktop/prisma2-development-environment/prisma2/cli/introspection/node_modules/react-reconciler/cjs/react-reconciler.development.js:10501:31)

@timsuchanek
Copy link
Contributor

Thanks @nikolasburk! That should be fixed in the latest version.

@nikolasburk
Copy link
Member

Yup, just tested again the issues from before are all fixed. I only ran into an issue when tyring Photon.js this time:

At step 4. I ran into this error:

~/D/p/p/photon (master|✔) $ ts-node examples/generate.ts ./examples/blog/
                            
[Error: ENOENT: no such file or directory, stat '/Users/nikolasburk/Desktop/photonjs/packages/photon/runtime'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'stat',
  path: '/Users/nikolasburk/Desktop/photonjs/packages/photon/runtime',
  state: { wip: [], counts: { directories: 0, files: 0, copies: 0 } }
}

And in the last step in this error:

~/D/p/p/p/e/blog (master|✔) $ ts-node main.ts
                              

/Users/nikolasburk/.config/yarn/global/node_modules/ts-node/src/index.ts:245
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
@generated/photon/index.ts:14:8 - error TS2307: Cannot find module './runtime'.

14 } from './runtime'
          ~~~~~~~~~~~

    at createTSError (/Users/nikolasburk/.config/yarn/global/node_modules/ts-node/src/index.ts:245:12)
    at reportTSError (/Users/nikolasburk/.config/yarn/global/node_modules/ts-node/src/index.ts:249:19)
    at getOutput (/Users/nikolasburk/.config/yarn/global/node_modules/ts-node/src/index.ts:357:34)
    at Object.compile (/Users/nikolasburk/.config/yarn/global/node_modules/ts-node/src/index.ts:415:32)
    at Module.m._compile (/Users/nikolasburk/.config/yarn/global/node_modules/ts-node/src/index.ts:493:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/nikolasburk/.config/yarn/global/node_modules/ts-node/src/index.ts:496:12)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)

Otherwise everything worked well! 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for a new feature.
Projects
None yet
Development

No branches or pull requests

4 participants