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

VSC Extension JSON schema #9386

Merged
merged 2 commits into from
Dec 5, 2023
Merged

VSC Extension JSON schema #9386

merged 2 commits into from
Dec 5, 2023

Conversation

mischnic
Copy link
Member

@mischnic mischnic commented Nov 15, 2023

Add autocomplete/popup descriptions/always-on schema validation for .parcelrc and package.json#targets

parcel-lsp-jsonschema.mov

Plus descriptions

Bildschirm­foto 2023-11-15 um 21 15 20

Two aspects that are suboptimal are (could be solved in the future with a custom LSP for the JSON as well):

  • No autocompletion for package names (which should in theory also be restricted to the parcel-{type}-* pattern)
  • You get two errors for invalid parcelrc/targets: one from Parcel and then a warning from the JSON schema.
Bildschirm­foto 2023-11-15 um 21 23 04

Copy link
Contributor

@celinanperalta celinanperalta left a comment

Choose a reason for hiding this comment

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

lgtm! nice addition

@mischnic mischnic merged commit 3045177 into v2 Dec 5, 2023
7 of 15 checks passed
@mischnic mischnic deleted the vscode-extension-config-json-schema branch December 5, 2023 20:23
"type": "object",
"properties": {
"context": {
"description": "The context property defines what type of environment to build for. This tells Parcel what environment-specific APIs are available, e.g. the DOM, Node filesystem APIs.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Some of this JSON duplicates what https://github.com/parcel-bundler/parcel/blob/9d6da2c/packages/core/core/src/TargetDescriptor.schema.js does, but descriptions seem novel.

I think if you add descriptions into TargetDescriptor.schema.js, you can just generate this file. (my script for generating json from TargetDescriptor.schema.js https://github.com/lukaw3d/parcel-bundler-json-schemas/blob/main/main.js)

@@ -0,0 +1,94 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

4 participants