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
2 changes: 1 addition & 1 deletion .github/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Each should be shown in VS Code, and can be run manually on the command-line:

- `pnpm lint` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files
- `pnpm lint:knip` ([knip](https://github.com/webpro/knip)): Detects unused files, dependencies, and code exports
- `pnpm lint:packages` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the `pnpm-lock.yml` file
- `pnpm lint:packages` ([pnpm dedupe --check](https://pnpm.io/cli/dedupe)): Checks for unnecessarily duplicated packages in the `pnpm-lock.yaml` file
- `pnpm lint:spelling` ([cspell](https://cspell.org)): Spell checks across all source files

Read the individual documentation for each linter to understand how it can be configured and used best.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/Blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ Enables [typescript-eslint's stylistic configs](https://typescript-eslint.io/lin

### Lint YML

[`eslint-plugin-yml`](https://ota-meshi.github.io/eslint-plugin-yml): Adds linting for `yaml` and `.yml` files, such as sorting keys.
[`eslint-plugin-yml`](https://ota-meshi.github.io/eslint-plugin-yml): Adds linting for `yaml` and `.yaml` files, such as sorting keys.

### OctoGuide Strict

Expand Down
2 changes: 1 addition & 1 deletion docs/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Each defaults to a value based on the running system, including an repository if
| `--bin` | `string` | Value to set in `package.json`'s `"bin"` property, per [FAQs > How can I use `bin`?](./FAQs.md#how-can-i-use-bin) | _(none)_ |
| `--email` | `string` | Email address to be listed as the point of contact in docs and packages (e.g. `[email protected]`) | Yours from `gh`, `git config`, or `npm whoami` |
| `--emoji` | `string` | decorative emoji to use in descriptions and docs | The last emoji from `description`, or `"💖"` |
| `--funding` | `string` | GitHub organization or username to mention in `funding.yml` | The same as `owner` |
| `--funding` | `string` | GitHub organization or username to mention in `funding.yaml` | The same as `owner` |
| `--keywords` | `string[]` | Any number of keywords to include in `package.json` | _(none)_ |
| `--owner` | `string` | Organization or user owning the repository | Yours from `gh` or `git config` |
| `--pnpm` | `string` | pnpm version for `package.json`'s `packageManager` field | Existing value in `package.json` if it exists |
Expand Down
2 changes: 1 addition & 1 deletion docs/Configuration Files.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ These options are generally only programmatically used internally, but can still
| `node` | Node.js engine version(s) to pin and require a minimum of | Values from `.nvmrc` and `package.json`'s `"engines"` |
| `packageData` | additional properties to include in `package.json` | Existing values in `package.json` |
| `rulesetId` | GitHub branch ruleset ID for main branch protections | Existing ruleset on the `main` branch from the GitHub API |
| `workflowsVersions` | existing versions of GitHub Actions workflows used | Existing action versions in `.github/workflows/*.yml` |
| `workflowsVersions` | existing versions of GitHub Actions workflows used | Existing action versions in `.github/workflows/*.yaml` |

For example, changing `node` versions to values different from what would be inferred:

Expand Down
12 changes: 6 additions & 6 deletions docs/FAQs.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It'll walk you through the common activities you'll need to contribute to a repo
Yes!
After you set up a repository, you can substitute in any tools you'd like.

If you think the tool would be broadly useful to most consumers of this template, feel free to [file a feature request](https://github.com/JoshuaKGoldberg/create-typescript-app/issues/new?assignees=&labels=type%3A+feature&projects=&template=03-feature.yml&title=%F0%9F%9A%80+Feature%3A+%3Cshort+description+of+the+feature%3E) to add it in.
If you think the tool would be broadly useful to most consumers of this template, feel free to [file a feature request](https://github.com/JoshuaKGoldberg/create-typescript-app/issues/new?assignees=&labels=type%3A+feature&projects=&template=03-feature.yaml&title=%F0%9F%9A%80+Feature%3A+%3Cshort+description+of+the+feature%3E) to add it in.

## Can I create a GitHub action?

Expand All @@ -20,13 +20,13 @@ Here we'll outline the steps required to migrate a CTA app to a GitHub Action:

1. GitHub Actions store built output on a GitHub branch rather than in a published package on npm.
As a consequence we should:
- delete `.github/workflows/release.yml` and `.github/workflows/post-release.yml`.
- update `.github/workflows/build.yml` to ensure `dist` is up to date:
- delete `.github/workflows/release.yaml` and `.github/workflows/post-release.yaml`.
- update `.github/workflows/build.yaml` to ensure `dist` is up to date:

<details>
<summary><code>.github/workflows/build.yml</code></summary>
<summary><code>.github/workflows/build.yaml</code></summary>

```yml
```yaml
jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -95,7 +95,7 @@ Delete `tsdown.config.ts` then execute the following commands:
npx lint-staged
```

2. Create an [`action.yml` metadata file](https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action#creating-an-action-metadata-file).
2. Create an [`action.yaml` metadata file](https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action#creating-an-action-metadata-file).

It's worth reading the [GitHub Actions documentation](https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action#writing-the-action-code).

Expand Down
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default defineConfig(
extends: [yml.configs["flat/standard"], yml.configs["flat/prettier"]],
files: ["**/*.{yml,yaml}"],
rules: {
"yml/file-extension": ["error", { extension: "yml" }],
"yml/file-extension": "error",
"yml/sort-keys": [
"error",
{ order: { type: "asc" }, pathPattern: "^.*$" },
Expand Down
2 changes: 1 addition & 1 deletion src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const base = createBase({
funding: z
.string()
.optional()
.describe("GitHub organization or username to mention in `funding.yml`"),
.describe("GitHub organization or username to mention in `funding.yaml`"),
guide: z
.object({
href: z.string(),
Expand Down
6 changes: 3 additions & 3 deletions src/blocks/blockAllContributors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe("blockAllContributors", () => {
}",
".github": {
"workflows": {
"contributors.yml": "jobs:
"contributors.yaml": "jobs:
contributors:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -214,7 +214,7 @@ describe("blockAllContributors", () => {
}",
".github": {
"workflows": {
"contributors.yml": "jobs:
"contributors.yaml": "jobs:
contributors:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -359,7 +359,7 @@ describe("blockAllContributors", () => {
}",
".github": {
"workflows": {
"contributors.yml": "jobs:
"contributors.yaml": "jobs:
contributors:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/blockAllContributors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const blockAllContributors = base.createBlock({
),
".github": {
workflows: {
"contributors.yml": createSoloWorkflowFile({
"contributors.yaml": createSoloWorkflowFile({
name: "Contributors",
on: {
push: {
Expand Down
6 changes: 3 additions & 3 deletions src/blocks/blockCTATransitions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe("blockCTATransitions", () => {
".github": {
"actions": {
"transition": {
"action.yml": "description: Runs create-typescript-app in transition mode
"action.yaml": "description: Runs create-typescript-app in transition mode

inputs:
token:
Expand Down Expand Up @@ -63,7 +63,7 @@ describe("blockCTATransitions", () => {
Cheers!
— _The Friendly Bingo Bot_ 💝

> ℹ️ These automatic commits keep your repository up-to-date with new versions of [create-typescript-app](https://github.com/JoshuaKGoldberg/create-typescript-app). If you want to opt out, delete your \`.github/workflows/cta-transitions.yml\` file.
> ℹ️ These automatic commits keep your repository up-to-date with new versions of [create-typescript-app](https://github.com/JoshuaKGoldberg/create-typescript-app). If you want to opt out, delete your \`.github/workflows/cta-transitions.yaml\` file.
- id: package-change
uses: JoshuaKGoldberg/[email protected]
with:
Expand All @@ -82,7 +82,7 @@ describe("blockCTATransitions", () => {
},
},
"workflows": {
"cta.yml": "jobs:
"cta.yaml": "jobs:
transition:
name: Transition
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions src/blocks/blockCTATransitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const blockCTATransitions = base.createBlock({
".github": {
actions: {
transition: {
"action.yml": formatYaml({
"action.yaml": formatYaml({
description: "Runs create-typescript-app in transition mode",
inputs: {
token: {
Expand Down Expand Up @@ -78,7 +78,7 @@ export const blockCTATransitions = base.createBlock({
"Cheers!",
" — _The Friendly Bingo Bot_ 💝",
"",
"> ℹ️ These automatic commits keep your repository up-to-date with new versions of [create-typescript-app](https://github.com/JoshuaKGoldberg/create-typescript-app). If you want to opt out, delete your `.github/workflows/cta-transitions.yml` file.",
"> ℹ️ These automatic commits keep your repository up-to-date with new versions of [create-typescript-app](https://github.com/JoshuaKGoldberg/create-typescript-app). If you want to opt out, delete your `.github/workflows/cta-transitions.yaml` file.",
].join("\n"),
},
},
Expand Down Expand Up @@ -117,7 +117,7 @@ export const blockCTATransitions = base.createBlock({
},
},
workflows: {
"cta.yml": createSoloWorkflowFile({
"cta.yaml": createSoloWorkflowFile({
jobName: "Transition",
name: "CTA",
on: {
Expand Down
26 changes: 13 additions & 13 deletions src/blocks/blockCodecov.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ describe("blockCodecov", () => {
{
"addons": {
"files": [
".github/codecov.yml",
"codecov.yml",
".github/codecov.yaml",
"codecov.yaml",
],
},
"block": [Function],
Expand Down Expand Up @@ -166,7 +166,7 @@ describe("blockCodecov", () => {
});

describe("intake", () => {
it("returns undefined when ci.yml does not exist", () => {
it("returns undefined when ci.yaml does not exist", () => {
const actual = testIntake(blockCodecov, {
files: {
".github": {
Expand All @@ -178,12 +178,12 @@ describe("blockCodecov", () => {
expect(actual).toBeUndefined();
});

it("returns undefined when ci.yml contains invalid yml", () => {
it("returns undefined when ci.yaml contains invalid YAML", () => {
const actual = testIntake(blockCodecov, {
files: {
".github": {
workflows: {
"ci.yml": ["invalid yml!"],
"ci.yaml": ["invalid YAML!"],
},
},
},
Expand All @@ -192,12 +192,12 @@ describe("blockCodecov", () => {
expect(actual).toBeUndefined();
});

it("returns undefined when ci.yml does not contain a test job", () => {
it("returns undefined when ci.yaml does not contain a test job", () => {
const actual = testIntake(blockCodecov, {
files: {
".github": {
workflows: {
"ci.yml": [
"ci.yaml": [
jsYaml.dump({
jobs: {
other: {
Expand All @@ -215,12 +215,12 @@ describe("blockCodecov", () => {
expect(actual).toBeUndefined();
});

it("returns undefined when ci.yml contains a test job with only non-string uses", () => {
it("returns undefined when ci.yaml contains a test job with only non-string uses", () => {
const actual = testIntake(blockCodecov, {
files: {
".github": {
workflows: {
"ci.yml": [
"ci.yaml": [
jsYaml.dump({
jobs: {
test: {
Expand All @@ -242,12 +242,12 @@ describe("blockCodecov", () => {
expect(actual).toBeUndefined();
});

it("returns undefined env when ci.yml contains a test job with no env in its codecov step", () => {
it("returns undefined env when ci.yaml contains a test job with no env in its codecov step", () => {
const actual = testIntake(blockCodecov, {
files: {
".github": {
workflows: {
"ci.yml": [
"ci.yaml": [
jsYaml.dump({
jobs: {
test: {
Expand All @@ -269,15 +269,15 @@ describe("blockCodecov", () => {
expect(actual).toEqual({ env: undefined });
});

it("returns env when ci.yml contains a test job with env in its codecov step", () => {
it("returns env when ci.yaml contains a test job with env in its codecov step", () => {
const env = {
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}",
};
const actual = testIntake(blockCodecov, {
files: {
".github": {
workflows: {
"ci.yml": [
"ci.yaml": [
jsYaml.dump({
jobs: {
test: {
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/blockCodecov.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const blockCodecov = base.createBlock({
intake({ files }) {
const steps = intakeFileYamlSteps(
files,
[".github", "workflows", "ci.yml"],
[".github", "workflows", "ci.yaml"],
["jobs", "test", "steps"],
);
if (!steps) {
Expand Down Expand Up @@ -78,7 +78,7 @@ export const blockCodecov = base.createBlock({
transition() {
return {
addons: [
blockRemoveFiles({ files: [".github/codecov.yml", "codecov.yml"] }),
blockRemoveFiles({ files: [".github/codecov.yaml", "codecov.yaml"] }),
],
};
},
Expand Down
7 changes: 1 addition & 6 deletions src/blocks/blockESLintYML.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ describe("blockESLintYML", () => {
"**/*.{yml,yaml}",
],
"rules": {
"yml/file-extension": [
"error",
{
"extension": "yml",
},
],
"yml/file-extension": "error",
"yml/sort-keys": [
"error",
{
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/blockESLintYML.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const blockESLintYML = base.createBlock({
],
files: ["**/*.{yml,yaml}"],
rules: {
"yml/file-extension": ["error", { extension: "yml" }],
"yml/file-extension": "error",
"yml/sort-keys": [
"error",
{
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/blockFunding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const blockFunding = base.createBlock({
return {
files: {
".github": {
"FUNDING.yml":
"FUNDING.yaml":
options.funding && formatYaml({ github: options.funding }),
},
},
Expand Down
Loading