Skip to content

feat(cli): log the prisma schema path when loaded - #3666

Merged
Jolg42 merged 12 commits into
masterfrom
feat/log-schema-loaded
Sep 16, 2020
Merged

Jolg42 merged 12 commits into
masterfrom
feat/log-schema-loaded

Conversation

@flaviaan

@flaviaan flaviaan commented Sep 15, 2020 •

Copy link
Copy Markdown
Contributor

Closes #3647

@flaviaan
flaviaan force-pushed the feat/log-schema-loaded branch from 41a1aeb to b8064ea Compare September 15, 2020 15:30
const result = Doctor.new().parse([])
await expect(result).rejects.toThrowErrorMatchingInlineSnapshot(
`Either provide --schema or make sure that you are in a folder with a schema.prisma file.`,
`Either provide --schema or configure a path in your package.json in a \`prisma.schema\` field or make sure that you are in a folder with a schema.prisma file.`,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have a better wording here let me know

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the full error message, or is there more around this sentence?

@timsuchanek timsuchanek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!

@Jolg42

Jolg42 commented Sep 16, 2020

Copy link
Copy Markdown
Contributor

Nice!

From the logs it looks like we would want to change the introspect logs:
Introspecting based on datasource defined in schema.prisma
to
Introspecting based on datasource defined in ./schema.prisma

Also did you try with an absolute path? Is the output correct then?

@Jolg42

Jolg42 commented Sep 16, 2020

Copy link
Copy Markdown
Contributor

Ok so absolute paths are transformed into relatives indeed.

Something that will be confusing for Windows users though is the concatenation of ./ in front of the relative path.

Comment thread src/packages/sdk/src/cli/getSchema.ts Resolved
Comment thread src/packages/sdk/src/cli/getSchema.ts Resolved

@Jolg42 Jolg42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My brain got confused when I found out the fixtures folder name don’t match the package.json “name”
ie: one folder is pkg-json-invalid-path and pkg name is pkg-json-valid-path
Not all fixtures are affected but it would be nice to fix
maybe you can rename them to match or put a generic name that is less confusing?

@flaviaan

Copy link
Copy Markdown
Contributor Author

all done

@Jolg42 Jolg42 added this to the Release 2.8.0 milestone Sep 16, 2020
@Jolg42
Jolg42 merged commit b972e05 into master Sep 16, 2020
@Jolg42
Jolg42 deleted the feat/log-schema-loaded branch September 16, 2020 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Output path of schema.prisma file in CLI commands that read it

4 participants