-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(env): support numbers. install multiple packages at once
- Loading branch information
1 parent
bdd16e7
commit db976ba
Showing
14 changed files
with
140 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,37 @@ | ||
// Name: Annoucements | ||
// Description: Browse Annoucements | ||
// Name: Announcements | ||
// Description: Script Kit Announcements | ||
// Keyword: announcements | ||
// Pass: true | ||
// Cache: true | ||
// Enter: Open Announcements | ||
|
||
let noChoices = false | ||
let onNoChoices = async input => { | ||
noChoices = true | ||
setPanel( | ||
md(`# No Examples Found for "${input}" | ||
import { createGuideConfig } from "./main-helper.js" | ||
|
||
- Share one! ❤️ [Share on GitHub Discussions](https://github.com/johnlindquist/kit/discussions/categories/share) | ||
- Request one 💡 [Request on GitHub Discussions](https://github.com/johnlindquist/kit/discussions/categories/ideas) | ||
`) | ||
) | ||
} | ||
|
||
let getHot = async () => { | ||
let hotPath = kitPath("data", "hot.json") | ||
if (await isFile(hotPath)) { | ||
return await readJson(hotPath) | ||
} | ||
|
||
return [] | ||
} | ||
|
||
let loadHotChoices = async () => { | ||
try { | ||
let hot = await getHot() | ||
|
||
return hot | ||
.filter(choice => choice?.category?.name !== "Share") | ||
.map(choice => { | ||
choice.preview = async () => { | ||
if (choice?.body) { | ||
return await highlight(choice?.body) | ||
} | ||
|
||
return "" | ||
} | ||
return choice | ||
}) | ||
} catch (error) { | ||
return [error.message] | ||
} | ||
} | ||
|
||
let choices = await loadHotChoices() | ||
|
||
let url = await arg( | ||
{ | ||
let selectedDoc = await docs( | ||
kitPath("ANNOUNCEMENTS.md"), | ||
createGuideConfig({ | ||
name: "Announcements", | ||
placeholder: `Announcements`, | ||
input: arg?.input, | ||
guidePath: kitPath("ANNOUNCEMENTS.md"), | ||
itemHeight: PROMPT.ITEM.HEIGHT.SM, | ||
input: arg?.input || arg?.input || "", | ||
placeholder: "Browse Announcements", | ||
enter: `Open ANNOUNCEMENTS.md`, | ||
preventCollapse: true, | ||
onNoChoices, | ||
onChoiceFocus: () => { | ||
noChoices = false | ||
onNoChoices: async input => { | ||
setPanel( | ||
md(`# Expected ${input} in the Announcements? | ||
This guide is constantly evolving. If you're missing something, [suggest an edit](https://github.com/johnlindquist/kit-docs/blob/main/ANNOUNCEMENTS.md) to the guide or open an issue on GitHub. | ||
`) | ||
) | ||
}, | ||
shortcuts: [], | ||
enter: "Open in Browser", | ||
}, | ||
choices | ||
}) | ||
) | ||
|
||
if (noChoices) { | ||
browse( | ||
`https://github.com/johnlindquist/kit/discussions/categories/share` | ||
) | ||
// if selected docs is a url, then open it | ||
if (selectedDoc.startsWith("http")) { | ||
open(selectedDoc) | ||
} else { | ||
browse(url) | ||
await run(kitPath("cli", selectedDoc)) | ||
await mainScript("", "Announcements") | ||
} | ||
|
||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Name: Scriptlets | ||
// Description: Docs for Script Kit Scriptlets | ||
// Keyword: scriptlets | ||
// Pass: true | ||
// Enter: Open Scriptlets | ||
|
||
import { createScriptletsConfig } from "./main-helper.js" | ||
|
||
let scriptletsPath = kitPath("SCRIPTLETS.md") | ||
|
||
await docs( | ||
scriptletsPath, | ||
createScriptletsConfig({ | ||
name: "Scriptlets", | ||
guidePath: scriptletsPath, | ||
itemHeight: PROMPT.ITEM.HEIGHT.SM, | ||
input: arg?.input || "", | ||
placeholder: "Browse Scriptlets", | ||
enter: `Create Script`, | ||
preventCollapse: true, | ||
onNoChoices: async input => { | ||
setPanel( | ||
md(`# Expected ${input} in the Tips? | ||
Tips are constantly evolving. If you're missing something, [suggest an edit](https://github.com/johnlindquist/kit-docs/blob/main/TIPS.md) to the tips. | ||
`) | ||
) | ||
}, | ||
}) | ||
) | ||
|
||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters