You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/FAQs.md
+87Lines changed: 87 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,93 @@ After you set up a repository, you can substitute in any tools you'd like.
13
13
14
14
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.
15
15
16
+
## Can I create a GitHub action?
17
+
18
+
Yes! If you want to read the [GitHub Actions documentation](https://docs.github.com/en/actions/creating-actions) in detail.
19
+
Here we'll outline the steps required to migrate a CTA app to a GitHub Action:
20
+
21
+
1. GitHub Actions store built output on a GitHub branch rather than in a published package on npm.
22
+
As a consequence we should:
23
+
24
+
- delete `.github/workflows/release.yml` and `.github/workflows/post-release.yml`.
25
+
- update `.github/workflows/build.yml` to ensure `dist` is up to date:
- Our build now emits to the `dist` directory; so we'll want to avoid linting that directory by adding the following to `.eslintignore` and our `.prettierignore`:
86
+
87
+
```diff
88
+
+dist
89
+
```
90
+
91
+
- Rather than having to remember to compile each time, we'll update our precommit hook in `.husky/precommit` to build for us on each commit:
92
+
93
+
```diff
94
+
+pnpm run build
95
+
+git add dist
96
+
npx lint-staged
97
+
```
98
+
99
+
2. Create an [`action.yml` metadata file](https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action#creating-an-action-metadata-file).
100
+
101
+
It's worth reading the [GitHub Actions documentation](https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action#writing-the-action-code).
102
+
16
103
## How can I add dual CommonJS / ECMAScript Modules emit?
17
104
18
105
First, I'd suggest reading [TypeScript Handbook > Modules - Introduction](https://www.typescriptlang.org/docs/handbook/modules/introduction.html) to understand how CommonJS (CJS) and ECMAScript (ESM) came to be.
0 commit comments