Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export async function main() {

await command("git add CODE_OF_CONDUCT.md");
await command(
"git commit -m 'docs(CODE_OF_CONDUCT): Contributor Covenant'"
"git commit -m 'docs(CODE_OF_CONDUCT): Contributor Covenant'",
);

await command("git add CONTRIBUTING.md");
Expand All @@ -160,7 +160,7 @@ export async function main() {
});

await command(
`git remote add origin git@github.com:${answers.repository}.git`
`git remote add origin git@github.com:${answers.repository}.git`,
);
await command(`git push -u origin HEAD`);
await command(`git checkout -b initial-version`);
Expand Down Expand Up @@ -224,11 +224,11 @@ export async function main() {

await writePrettyFile(
".gitignore",
["coverage/", "node_modules/", "pkg/"].join("\n")
["coverage/", "node_modules/", "pkg/"].join("\n"),
);
await command(`git add .gitignore`);
await command(
`git commit -m 'build(gitignore): coverage, node_modules, pkg'`
`git commit -m 'build(gitignore): coverage, node_modules, pkg'`,
);

writePrettyFile(
Expand All @@ -242,11 +242,11 @@ export async function main() {
emitDeclarationOnly: true,
sourceMap: true,
},
})
}),
);
await command(`git add tsconfig.json`);
await command(
`git commit -m 'build(typescript): configuration for esbuild'`
`git commit -m 'build(typescript): configuration for esbuild'`,
);

console.log("create smoke test");
Expand Down Expand Up @@ -275,7 +275,7 @@ export async function main() {
}).not.toThrow();
});
});
`
`,
);
} else {
await writePrettyFile(
Expand All @@ -292,7 +292,7 @@ export async function main() {
expect(${answers.exportName}.VERSION).toEqual("0.0.0-development");
});
});
`
`,
);
}

Expand All @@ -302,7 +302,7 @@ export async function main() {
console.log("create src");
await writePrettyFile(
"src/version.ts",
'export const VERSION = "0.0.0-development"'
'export const VERSION = "0.0.0-development"',
);

if (answers.isPlugin) {
Expand All @@ -320,7 +320,7 @@ export async function main() {
*/
export function ${answers.exportName}(octokit: Octokit, options: Options) {}
${answers.exportName}.VERSION = VERSION;
`
`,
);
} else if (answers.isAuthenticationStrategy) {
await writePrettyFile(
Expand All @@ -345,7 +345,7 @@ export async function main() {
});
};

`
`,
);
await writePrettyFile(
"src/types.ts",
Expand All @@ -355,7 +355,7 @@ export async function main() {
AuthOptions: any;
Authentication: any;
};
`
`,
);
await writePrettyFile(
"src/auth.ts",
Expand All @@ -365,7 +365,7 @@ export async function main() {
export async function auth(options: AuthOptions): Promise<Authentication> {
// TODO: add implementation
}
`
`,
);
await writePrettyFile(
"src/hook.ts",
Expand All @@ -392,7 +392,7 @@ export async function main() {
// probably something like setting the authorization header
return request(route, parameters);
}
`
`,
);
} else {
const isClass = /^[A-Z]/.test(answers.exportName);
Expand All @@ -406,7 +406,7 @@ export async function main() {
export class ${answers.exportName} {
static VERSION = VERSION
}
`
`,
);
} else {
await writePrettyFile(
Expand All @@ -416,7 +416,7 @@ export async function main() {

export function ${answers.exportName}() {}
${answers.exportName}.VERSION = VERSION
`
`,
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/create-branch-protection.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export async function createBranchProtection(octokit, { owner, repo }) {
contexts: ["WIP", "test"],
},
restrictions: null,
}
},
);
}
4 changes: 2 additions & 2 deletions lib/create-coc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ const __dirname = fileURLToPath(new URL(".", import.meta.url));

const cocText = readFileSync(
pathJoin(__dirname, "..", "vendor", "code-of-conduct.en.md"),
"utf8"
"utf8",
);

async function createCoc(email) {
const contributorCovenantText = cocText.replace(
"[INSERT EMAIL ADDRESS]",
email
email,
);
await writePrettyFile("CODE_OF_CONDUCT.md", contributorCovenantText);
}
2 changes: 1 addition & 1 deletion lib/create-contributing.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ on GitHub, generates changelogs from the commit messages and puts them into the
Before the publish it runs the \`npm run build\` script which creates a \`pkg/\` folder with distributions for browsers, node and Typescript definitions. The contents of the \`pkg/\` folder are published to the npm registry.

If the pull request looks good but does not follow the commit conventions, use the <kbd>Squash & merge</kbd> button.
`
`,
);
}
2 changes: 1 addition & 1 deletion lib/create-esbuild-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,6 @@ async function main() {
);
}
main();
`
`,
);
}
12 changes: 6 additions & 6 deletions lib/create-issue-templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async function createIssueTemplates(isOctokitOrg) {
**What the problem might be**

<!-- If you have an idea where the bug might lie, please share here. Otherwise remove the whole section -->
`
`,
);
await writePrettyFile(
".github/ISSUE_TEMPLATE/02_feature_request.md",
Expand All @@ -48,7 +48,7 @@ async function createIssueTemplates(isOctokitOrg) {
**Alternatives you tried**

<!-- Describe the workarounds you tried so far and how they worked for you -->
`
`,
);

await writePrettyFile(
Expand All @@ -57,7 +57,7 @@ async function createIssueTemplates(isOctokitOrg) {
contact_links:
- name: 🆘 I need Help
url: https://github.com/octokit/octokit.js/discussions
about: Got a question? An idea? Feedback? Start here.`
about: Got a question? An idea? Feedback? Start here.`,
);
return;
}
Expand All @@ -69,7 +69,7 @@ name: "🆘 Help"
about: "How does this even work 🤷‍♂️"
labels: support
---
`
`,
);

await writePrettyFile(
Expand All @@ -93,7 +93,7 @@ labels: bug
**What the problem might be**

<!-- If you have an idea where the bug might lie, please share here. Otherwise remove the whole section -->
`
`,
);
await writePrettyFile(
".github/ISSUE_TEMPLATE/03_feature_request.md",
Expand All @@ -116,6 +116,6 @@ labels: feature
**Alternatives you tried**

<!-- Describe the workarounds you tried so far and how they worked for you -->
`
`,
);
}
2 changes: 1 addition & 1 deletion lib/create-pull-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export { createPullRequest };

async function createPullRequest(
octokit,
{ owner, repo, ownerId, repositoryId }
{ owner, repo, ownerId, repositoryId },
) {
let body = `- [ ] Implement features. Create separate \`feat: ...\` commits for each feature of the initial version
- [ ] 100% test coverage
Expand Down
2 changes: 1 addition & 1 deletion lib/create-release-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ jobs:
env:
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: \${{ secrets.${npmTokenSecretName} }}
`
`,
);
}
2 changes: 1 addition & 1 deletion lib/create-repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export { createRepository };

async function createRepository(
octokit,
{ isUserRepo, owner, repo, description }
{ isUserRepo, owner, repo, description },
) {
const createRepoOptions = {
name: repo,
Expand Down
2 changes: 1 addition & 1 deletion lib/create-test-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ jobs:
- run: npm ci
- run: npm run lint
if: \${{ always() }}
`
`,
);
}
2 changes: 1 addition & 1 deletion lib/create-update-prettier-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ jobs:
body: "An update to prettier required updates to your code."
branch: \${{ github.ref }}
commit-message: "style: prettier"
`
`,
);
}
2 changes: 1 addition & 1 deletion lib/write-pretty-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ async function writePrettyFile(path, content) {
path,
prettier.format(content, {
parser,
})
}),
);
}
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"clipboardy": "^3.0.0",
"execa": "^7.1.1",
"inquirer": "^9.2.7",
"prettier": "^2.7.1",
"prettier": "^3.0.0",
"spdx-license-list": "^6.3.0"
},
"devDependencies": {
Expand Down