The difference between local and play environment is strictNullChecks
. It's set to false by default locally, but is enabled on the playground by default.
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
// Menu: Create gist from clipboard | |
// Description: Creates a new GitHub Gist with the contents of your current clipboard | |
// Author: Gregor Martynus | |
// Twitter: @gr2m | |
// https://github.com/gr2m/scriptkit-octokit/ | |
const { Octokit } = await npm("scriptkit-octokit"); | |
const octokit = new Octokit({ | |
auth: { | |
scopes: ["gist"], |
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
// Menu: Set GitHub Status with Octokit | |
// Description: Sets the status text on your GitHub Profile | |
const { Octokit } = await npm("scriptkit-octokit"); | |
const octokit = new Octokit({ | |
auth: { | |
scopes: ["user"], | |
env: "GITHUB_TOKEN_SET_USER_PROFILE", | |
}, | |
}); |
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
//Shortcut: command shift - | |
// Menu: Set GitHub Status | |
// Description: Sets the status text on your GitHub Profile | |
const message = await arg("What would you like to say?"); | |
const token = await env("GITHUB_STATUS_TOKEN", { | |
secret: true, | |
ignoreBlur: true, | |
hint: md( | |
`Create a token [on GitHub](https://github.com/settings/tokens/new?scopes=user&description=kit%20script)` |
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
// Menu: Copy GitHub user name | |
// Description: Copies a GitHub user's first name, fallback to @login | |
// Author: Gregor Martynus | |
// Twitter: @gr2m | |
const { Octokit } = await npm("octokit"); | |
const { createOAuthDeviceAuth } = await npm("@octokit/auth-oauth-device"); | |
// set GitHub Token unless it's already set |
Setup
git clone https://gist.github.com/08a749b9eb98ba73e83184894d78675c.git probot-1371
cd probot-1371
npm install
Then run
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
name: End-to-end tests | |
on: [push] | |
jobs: | |
cypress-run: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 12 |
All libraries are written in Typescript, so a build step is necessary which makes it easier to seperate the source code structure from the distribution code structure. I rely heavily on pika.dev for creating browser bundles and distributing them via their CDN. Example: https://github.com/octokit/request.js/#usage.
I use @pika/pack
to create a ./pkg
folder with multiple distributions right before publishing to npm. Example: https://unpkg.com/browse/@octokit/[email protected]/
Currently, the dist-web/
folder is the ECMAScript Module export, it's referenced using the "module"
key in its package.json. The dist-node/
folder is referenced using the "main"
key in its package.json.
Besides the differentiation of common
NewerOlder