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

Add an example tasks.json to README? #269

Closed
phryneas opened this issue Apr 23, 2019 · 10 comments
Closed

Add an example tasks.json to README? #269

phryneas opened this issue Apr 23, 2019 · 10 comments

Comments

@phryneas
Copy link
Contributor

phryneas commented Apr 23, 2019

This is just something I was missing and that kept me personally from using fork-ts-checker-webpack-plugin in a few projects: integration with with the "Problems" tab in vscode.

But as I'm starting to dogfood now, too, I did a bit of googling and found https://code.visualstudio.com/docs/editor/tasks#_defining-a-multiline-problem-matcher which describes the process of defining yarn watch as a vscode task with a custom problem matcher.

That left me with the following configuration:

.vscode/tasks.json

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "watch",
      "command": "yarn",
      "args": ["watch"],
      "isBackground": true,
      "problemMatcher": [
        {
          "owner": "ts-loader",
          "fileLocation": "absolute",
          "pattern": [
            {
              "regexp": "^\\[tsl\\] (ERROR|WARNING) in (.*)\\((\\d+,\\d+)\\)$",
              "file": 2,
              "location": 3,
              "severity": 1
            },
            { "regexp": "^\\s+(.+): (.*)$", "code": 1, "message": 2 }
          ],
          "background": {
            "activeOnStart": true,
            "beginsPattern": "Type checking and linting in progress\\.\\.\\.",
            "endsPattern": "^Time: \\d+ms"
          }
        },
        {
          "owner": "fork-ts-checker-webpack-plugin",
          "fileLocation": "absolute",
          "pattern": [
            {
              "regexp": "^(ERROR|WARNING) in (.*)\\((\\d+,\\d+)\\):$",
              "file": 2,
              "location": 3,
              "severity": 1
            },
            { "regexp": "^(.+): (.*)$", "code": 1, "message": 2 }
          ],
          "background": {
            "activeOnStart": true,
            "beginsPattern": "Type checking and linting in progress\\.\\.\\.",
            "endsPattern": "^Time: \\d+ms"
          }
        }
      ]
    }
  ]
}

Which raises the question: do we want to add that to the README? While it might be very useful for many people, the README is also getting very long and this is very tool-specific information.

As an alternative: what do you think about splitting some parts of the README out into additional markdown files and link those from a FAQ section in the README?

CODE_OF_CONDUCT.md and CONTRIBUTING.md are essentially first steps into that direction.

@johnnyreilly
Copy link
Member

Which raises the question: do we want to add that to the README?

I don't use these myself but you're not the first person to raise it. So I think we should add it.

As an alternative: what do you think about splitting some parts of the README out into additional markdown files and link those from a FAQ section in the README?

I don't have strong feelings either way. Totally don't mind. @piotr-oles any views?

@piotr-oles
Copy link
Collaborator

Would be great to split README.md and make it more clear :) Please feel free to improve English as well - I'm not a native speaker :)

@piotr-oles
Copy link
Collaborator

@phryneas
Could you try the new version of the plugin (https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/tree/v5.0.0-alpha.1) and update the tasks.json file? I would be happy to add it to the README.md but I'm not using vscode personally :)

@phryneas
Copy link
Contributor Author

As I said in #404, I'll start dogfooding this soon.
I'll have to update the tasks.json then anyways, and I'll update it here then - thanks for keeping an eye on this :)

@eamodio
Copy link
Contributor

eamodio commented May 25, 2020

Here is a the tasks.json I use for GitLens:

{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "npm",
			"script": "build",
			"group": "build",
			"problemMatcher": ["$ts-checker5-webpack", "$ts-checker5-eslint-webpack"]
		},
		{
			"type": "npm",
			"script": "lint",
			"group": "build",
			"problemMatcher": ["$eslint-stylish"]
		},
		{
			"type": "npm",
			"script": "watch",
			"group": {
				"kind": "build",
				"isDefault": true
			},
			"isBackground": true,
			"problemMatcher": ["$ts-checker5-webpack-watch", "$ts-checker5-eslint-webpack-watch"]
		}
	]
}

Which uses the problem matchers from my TypeScript + Webpack Problem Matchers extension

@eamodio
Copy link
Contributor

eamodio commented May 25, 2020

@phryneas FYI, you can use the npm type tasks even with yarn if you set "npm.packageManager": "yarn" in your vscode settings

@johnnyreilly
Copy link
Member

I have only just realised that gitlens uses ts-loader and fork-ts-checker-webpack-plugin to build itself! I didn't realize you could use webpack to build a vs code extension.... There's so much I don't know!

piotr-oles added a commit that referenced this issue May 27, 2020
piotr-oles added a commit that referenced this issue May 27, 2020
@piotr-oles
Copy link
Collaborator

🎉 This issue has been resolved in version 5.0.0-alpha.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

@piotr-oles
Copy link
Collaborator

🎉 This issue has been resolved in version 5.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@piotr-oles
Copy link
Collaborator

🎉 This issue has been resolved in version 5.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants