octokit / create-octokit-project.js Goto Github PK
View Code? Open in Web Editor NEW"npm init" script to create a new Octokit JS module
License: MIT License
"npm init" script to create a new Octokit JS module
License: MIT License
Compare CONTRIBUTING.md in https://github.com/octokit/plugin-paginate-rest.js/
This issue contains a list of Renovate updates and their statuses.
These updates are awaiting their schedule. Click on a checkbox to get an update now.
Generated tsconfig
should extend configuration from https://github.com/octokit/tsconfig
main
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can resolve this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
The npm token configured in the NPM_TOKEN
environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/
.
If you are using Two-Factor Authentication, make configure the auth-only
level is supported. semantic-release cannot publish with the default auth-and-writes
level.
Please make sure to set the NPM_TOKEN
environment variable in your CI with the exact value of the npm token.
Good luck with your project β¨
Your semantic-release bot π¦π
The generated test.yml
workflow incorrectly uses always
. Instead it should use always()
.
See relevant documentation.
2.3.3
The workflow is not valid. .github/workflows/test.yml (Line: 35, Col: 9): Unrecognized named-value: 'always'. Located at position 1 within expression: always
I come up with the need of updating already existing Octokit projects:
tsconfig.json
to start using @octokit/tsconfig
presetWould have sense to extend this project to support this kind of changes?
P.S: Should we enable Github Discussions' to Octokit repos? Or discussing in issues is fine?
follow up to #184
The create-octokit-project
package is independent of octokit
's codebase, we can migrate it to ESM independently of the JS code repositories.
There is no urgency, we welcome pull requests from the community. If anyone is interested in helping, please comment
src/version.ts
export const VERSION = "0.0.0-development";
The 0.0.0-development
string will be replaced by semantic-release-plugin-update-version-in-files before publishing.
src/index.ts
If answers.exportName
starts with a capital letter then we can expect that the export is class
import { VERSION } from './version'
export class MyExportName {
static VERSION = VERSION
}
Otherwise a function
import { VERSION } from './version'
export function myExportName() {}
myExportName.VERSION = VERSION
OCTOKITBOT_PAT
was used instead of GITHUB_TOKEN
in create-update-prettier-action.js.
2.3.3
No response
As semantic-release supports publishing from all these branches
e.g. src/index.ts is missing semicolons
As Greenkeeper is phasing out and migrating its users to Snyk, we decided to migrate to Dependabot, which has been acquired by GitHub about a year ago and is increasingly becoming a built-in GitHub feature.
There are some trade-offs unfortunately:
package.json
's "dependencies" and "devDependencies". This is causing a lot of noise. Luckily, the new v2 configuration option versioning-strategy: "increase-if-necessary"
makes Depedendabot send pull requests for out-of-range updates onlyI've talked to @feelepxyz who kindly enabled the v2 configuration on @octokit. I will add the following configuration to all Octokit JS-related repositories:
version: 2
updates:
# create PRs for out-of-range updates
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
versioning-strategy: "increase-if-necessary"
Todos:
.github/dependabot.yml
configurationset "maintenance" label
Remove Greenkeeper badge
.github/workflows/update-prettier.yml
files:
-- "greenkeeper/prettier-*"
+- "dependabot/npm_and_yarn/prettier-*"
.github/workflows/test.yml
files:
-- "greenkeeper/**"
Create .github/dependabot.yml
with the configuration above
Per convention, an Octokit plugin should have the package name octokit-plugin-foo-bar
or @octokit/plugin-foo-bar
. The part after plugin-
can be camelCased and be used as the default for the exportName prompt
I just found out by chance that @octokit/auth-oauth-app
was using universal-user-agent
without having it listed as dependency. That caused a problem with loading the package from https://cdn.skypack.dev/@octokit/[email protected].
I did a quick research and found dependency-check
, which can check for that. It can also check if a dependency is listed in package.json
that is not used in the code
It needs to be run against the build version of the package, but making sure that the package builds is a good idea anyway. So I think we should add these to steps to .github/workflows/test.yml
's test
job
run: npm run build
run: npx dependency-check ./pkg/package.json --no-dev --ignore-module @octokit/types --ignore-module @octokit/openapi-types --ignore-module "@types/*"
One thing that's tricky: when we use only types from a package, it's not used in the code, but the package still needs to be a production dependency to make sure all required types are present when installing a package
This my first time using this script and octokit. And it seems my endless trials fails to create the repo.
I get the 404 error after reaching:
? Folder path to initialize the project in,....
response: {
url: 'https://api.github.com/orgs/',
status: 404,
headers: {
'access-control-allow-origin': '*',
connection: 'close',
'content-security-policy': "default-src 'none'",
'content-type': 'application/json; charset=utf-8',
date: 'Tue, 05 Oct 2021 12:40:29 GMT',
'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
server: 'GitHub.com',
...
},
data: {
message: 'Not Found',
documentation_url: 'https://docs.github.com/rest'
}
},
request: {
method: 'GET',
url: 'https://api.github.com/orgs/',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'octokit-core.js/3.5.1 Node.js/16.7.0 (darwin; x64)',
authorization: 'token [REDACTED]'
},
request: { hook: [Function: bound bound register] }
}
}
My initial guess the api url should be something like https://api.github.com/orgs/{org-here}
and it's missing.
The "Merging the Pull Request & releasing a new version" is for maintainers only, we should make that more clear
I just tried to use this library with the command npm init octokit-project
.
However, I run into this problem:
const inquirer = require("inquirer");
^Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/davelosert/.npm/_npx/b52e3113e4f00614/node_modules/inquirer/lib/inquirer.js from /Users/davelosert/.npm/_npx/b52e3113e4f00614/node_modules/create-octokit-project/create-octokit-project.js not supported.
Instead change the require of inquirer.js in /Users/davelosert/.npm/_npx/b52e3113e4f00614/node_modules/create-octokit-project/create-octokit-project.js to a dynamic import() which is available in all CommonJS modules.
at Object. (/Users/davelosert/.npm/_npx/b52e3113e4f00614/node_modules/create-octokit-project/create-octokit-project.js:6:18) {
code: 'ERR_REQUIRE_ESM'
}
Node Verison: v16.14.2
npm Version: 8.5.0
Didn't look into the details yet, but yeah, classical ESM incompatibility issue π¦.
$ npm init octokit-project
(node:90316) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
? Do you want to create a public or private repository? public
? If you have access, do you want to create the repository in the @octokit organization? No
./create-octokit-project.js/node_modules/@octokit/request/dist-node/index.js:88
const error = new requestError.RequestError(toErrorMessage(data), status, {
^
RequestError [HttpError]: Unknown error: {"error":"device_flow_disabled","error_description":"Device Flow must be explicitly enabled for this App","error_uri":"https://docs.github.com"}
at ./create-octokit-project.js/node_modules/@octokit/request/dist-node/index.js:88:21
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async oauthRequest (./create-octokit-project.js/node_modules/@octokit/oauth-methods/dist-node/index.js:26:20)
at async getOAuthAccessToken (./create-octokit-project.js/node_modules/@octokit/auth-oauth-device/dist-node/index.js:16:7)
at async main (file://./create-octokit-project.js/index.js:69:21) {
status: 400,
response: {
url: 'https://github.com/login/device/code',
status: 400,
headers: {
'cache-control': 'no-cache',
connection: 'close',
'content-security-policy': "default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com objects-origin.githubusercontent.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com cdn.optimizely.com logx.optimizely.com/v1/events *.actions.githubusercontent.com wss://*.actions.githubusercontent.com online.visualstudio.com/api/v1/locations github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: github.githubassets.com identicons.github.com github-cloud.s3.amazonaws.com secured-user-images.githubusercontent.com/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; worker-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/",
'content-type': 'application/json; charset=utf-8',
date: 'Tue, 25 Oct 2022 23:11:48 GMT',
'expect-ct': 'max-age=2592000, report-uri="https://api.github.com/_private/browser/errors"',
'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
server: 'GitHub.com',
'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
'transfer-encoding': 'chunked',
vary: 'X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With',
'x-content-type-options': 'nosniff',
'x-frame-options': 'deny',
'x-github-request-id': '845A:7A8C:647360:90121C:63586D34',
'x-xss-protection': '0'
},
data: {
error: 'device_flow_disabled',
error_description: 'Device Flow must be explicitly enabled for this App',
error_uri: 'https://docs.github.com'
}
},
request: {
method: 'POST',
url: 'https://github.com/login/device/code',
headers: {
accept: 'application/json',
'user-agent': 'octokit-auth-oauth-device.js/4.0.3 Node.js/16.15.0 (linux; x64)',
'content-type': 'application/json; charset=utf-8'
},
body: '{"client_id":"797fc7c2acb5f7c1bed3","scope":"public_repo"}'
}
}
npm ERR! code 1
npm ERR! path ./openapi-webhooks
npm ERR! command failed
npm ERR! command sh -c create-octokit-project
npm ERR! A complete log of this run can be found in:
npm ERR! ~/.npm/_logs/2022-10-25T23_11_41_315Z-debug-0.log
See octokit/plugin-paginate-rest.js#124 (comment)
Add
"peerDependencies": {
"@octokit/core": ">=3"
},
to package.json if the project is an Octokit plugin
I think it's going to be the most common use case and if we know that it's a plugin then we can be a little bit more helpful with the setup.
This will also require adding branches
semantic-release configuration
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"main",
"next",
"next-major",
{
"name": "beta",
"prerelease": true
},
{
"name": "alpha",
"prerelease": true
}
],
NPM token generation instructions are no longer valid.
No response
No response
No response
e.g. plugins should have compose*
methods besides the plugin export, compare composePaginateRest
from @octokit/plugin-paginate-rest
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Location: package.json
Error type: The renovate configuration file contains some invalid settings
Message: Invalid configuration option: author, Invalid configuration option: bin, Invalid configuration option: keywords, Invalid configuration option: license, Invalid configuration option: main, Invalid configuration option: name, Invalid configuration option: packageRules[0].@octokit/auth-oauth-device, Invalid configuration option: packageRules[0].@octokit/core, Invalid configuration option: packageRules[0].camelcase, Invalid configuration option: packageRules[0].clipboardy, Invalid configuration option: packageRules[0].execa, Invalid configuration option: packageRules[0].inquirer, Invalid configuration option: packageRules[0].prettier, Invalid configuration option: packageRules[0].spdx-license-list, Invalid configuration option: packageRules[1].semantic-release, Invalid configuration option: release, Invalid configuration option: renovate, Invalid configuration option: scripts, Invalid configuration option: version
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.