-
-
Notifications
You must be signed in to change notification settings - Fork 275
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 support for scriptcs, Cake, and FAKE #1035
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// @OctoLinkerResolve(https://www.nuget.org/packages/Cake.DotNetTool.Module) | ||
#module nuget:?package=Cake.DotNetTool.Module&version=0.4.0 | ||
|
||
// @OctoLinkerResolve(https://www.nuget.org/packages/Cake.Coveralls) | ||
#addin "nuget:https://api.nuget.org/v3/index.json?package=Cake.Coveralls&version=0.10.1" | ||
|
||
// @OctoLinkerResolve(https://www.nuget.org/packages/coveralls.io) | ||
#tool "nuget:https://api.nuget.org/v3/index.json?package=coveralls.io&version=1.4.2" | ||
|
||
// @OctoLinkerResolve(https://www.nuget.org/packages/GitVersion.Tool) | ||
#tool "dotnet:https://api.nuget.org/v3/index.json?package=GitVersion.Tool&version=5.1.2" | ||
|
||
// @OctoLinkerResolve(<root>/dotnet/scripting/import.csx) | ||
#load import.csx | ||
|
||
// @OctoLinkerResolve(<root>/dotnet/scripting/import.csx) | ||
#load "./import.csx" | ||
|
||
// @OctoLinkerResolve(<root>/dotnet/scripting/import.cake) | ||
#load "./import.cake" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#r "paket: | ||
source release/dotnetcore | ||
source https://api.nuget.org/v3/index.json | ||
// @OctoLinkerResolve(https://www.nuget.org/packages/FSharp.Core) | ||
nuget FSharp.Core ~> 4.1 | ||
// @OctoLinkerResolve(https://www.nuget.org/packages/System.AppContext) | ||
nuget System.AppContext prerelease | ||
// @OctoLinkerResolve(https://www.nuget.org/packages/Newtonsoft.Json) | ||
nuget Newtonsoft.Json | ||
// @OctoLinkerResolve(https://www.nuget.org/packages/Octokit) | ||
nuget Octokit //" | ||
|
||
// @OctoLinkerResolve(<root>/dotnet/scripting/import.csx) | ||
#load import.csx | ||
|
||
// @OctoLinkerResolve(<root>/dotnet/scripting/import.csx) | ||
#load "./import.csx" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// @OctoLinkerResolve(<root>/dotnet/scripting/import.csx) | ||
#load import.csx | ||
|
||
// @OctoLinkerResolve(<root>/dotnet/scripting/import.csx) | ||
#load "./import.csx" |
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,31 @@ | ||||||||||||||||
import { | ||||||||||||||||
FAKE_NUGET, | ||||||||||||||||
NET_SCRIPT_FILE, | ||||||||||||||||
NET_SCRIPT_NUGET, | ||||||||||||||||
} from '@octolinker/helper-grammar-regex-collection'; | ||||||||||||||||
import nugetResolver from '@octolinker/resolver-nuget'; | ||||||||||||||||
import relativeFile from '@octolinker/resolver-relative-file'; | ||||||||||||||||
|
||||||||||||||||
export default { | ||||||||||||||||
name: 'DotNetScripting', | ||||||||||||||||
|
||||||||||||||||
resolve(path, [target]) { | ||||||||||||||||
// this reference doesn't resolve to anything | ||||||||||||||||
if (target === './.fake/build.fsx/intellisense.fsx') { | ||||||||||||||||
return []; | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to share some insights, you can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @stefanbuck I just tried
The error points back to this line
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ohh sorry for pointing you into the wrong direction. I guess there is some value in having a consistent return type 😉 |
||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
return [relativeFile({ path, target }), nugetResolver({ target })]; | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The signature of the Side note: Meta defaults to an empty object and is used in the context of plugin-npm-manifest. What I want to talk about is the fourth argument OctoLinker/packages/plugin-php/index.js Lines 7 to 13 in 87a137a
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's awesome, I'll have to revisit some of the css & dotnet things I was working on because I'm pretty sure I'll be able to simplify them by checking the regex. |
||||||||||||||||
}, | ||||||||||||||||
|
||||||||||||||||
getPattern() { | ||||||||||||||||
return { | ||||||||||||||||
pathRegexes: [/\.(cs|fs)x$/, /\.cake$/], | ||||||||||||||||
githubClasses: [], | ||||||||||||||||
}; | ||||||||||||||||
}, | ||||||||||||||||
|
||||||||||||||||
getLinkRegexes() { | ||||||||||||||||
return [FAKE_NUGET, NET_SCRIPT_FILE, NET_SCRIPT_NUGET]; | ||||||||||||||||
}, | ||||||||||||||||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "@octolinker/plugin-dotnet-scripting", | ||
"version": "1.0.0", | ||
"description": "", | ||
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-dotnet-scripting", | ||
"license": "MIT", | ||
"main": "./index.js", | ||
"dependencies": { | ||
"@octolinker/helper-grammar-regex-collection": "1.0.0", | ||
"@octolinker/resolver-nuget": "1.0.0", | ||
"@octolinker/resolver-relative-file": "1.0.0" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefanbuck I'm having trouble getting these lines to work as I wanted.
I was trying to make everything after
#module
&#addin
the link so you didn't have to search for the package name in the url, but GitHub's parsing the lines with a full url and everything after//
is in a span so no link gets injected.Is there a way to support making that whole value a link or are we stuck with making just the package name the link?
This is the file I was testing against https://github.com/cake-build/cake/blob/develop/build.cake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds similar to an issue I'm currently facing getting PHP / laravel support in.
Yesterday, I spent two hours try to come up with a solution without luck. It's mainly a lack of support for such markup in https://github.com/padolsey/findAndReplaceDOMText which we use in the
insert-link
package.I've noticed that refined-github is able to wrap the url in your case. If we find a solution we should make sure it doesn't conflict with
refined-github
which is a widely used extension as well.Is this a blocker for you? Maybe best to ignore it for now and investigate into it separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No not a blocker. I can have just the package name be the link until we find a better solution.