Skip to content

Commit dbe5ec3

Browse files
feat: convert to monorepo with konami-emoji-blast (#206)
## PR Checklist - [x] Addresses an existing open issue: fixes #172 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/emoji-blast/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/emoji-blast/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Things that need to work for this PR: - [x] Core `emoji-blast` and `konami-emoji-blast` libraries - [x] Integrations: Astro, React, TypeDoc - [x] Knip - [x] Linting - [x] Testing - [x] TypeScript project references: used instead of tsup for `lib/` outputs and type checking - [x] Webpack builds: for `dist/`, since the existing projects generally used it Things I'm leaving as followups: - https://github.com/cgradeff/emojisplosion-site - Release management: I'm thinking Changesets - Investigating switching from Webpack to something newer/faster - Test coverage
1 parent d224170 commit dbe5ec3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+4044
-2793
lines changed

.eslintrc.cjs

+17-11
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@ module.exports = {
77
extends: [
88
"eslint:recommended",
99
"plugin:eslint-comments/recommended",
10-
"plugin:n/recommended",
1110
"plugin:perfectionist/recommended-natural",
1211
"plugin:regexp/recommended",
1312
"plugin:vitest/recommended",
1413
],
1514
ignorePatterns: [
1615
"!.*",
1716
"coverage",
18-
"dist",
19-
"lib",
17+
"**/dist",
18+
"**/lib",
2019
"node_modules",
2120
"pnpm-lock.yaml",
2221
],
@@ -32,7 +31,7 @@ module.exports = {
3231
"plugin:@typescript-eslint/strict",
3332
"plugin:@typescript-eslint/stylistic",
3433
],
35-
files: ["**/*.ts"],
34+
files: ["**/*.{ts,tsx}"],
3635
parser: "@typescript-eslint/parser",
3736
rules: {
3837
// These off-by-default rules work well for this repo and we like them on.
@@ -49,19 +48,20 @@ module.exports = {
4948
"jsdoc/require-param": "off",
5049
"jsdoc/require-property": "off",
5150
"jsdoc/require-returns": "off",
52-
"n/no-missing-import": "off",
5351
},
5452
},
5553
{
56-
excludedFiles: ["**/*.md/*.ts"],
54+
excludedFiles: ["**/*.md/*.{ts,tsx}"],
5755
extends: [
5856
"plugin:@typescript-eslint/strict-type-checked",
5957
"plugin:@typescript-eslint/stylistic-type-checked",
6058
],
61-
files: ["**/*.ts"],
59+
files: ["**/*.{ts,tsx}"],
6260
parser: "@typescript-eslint/parser",
6361
parserOptions: {
64-
project: "./tsconfig.eslint.json",
62+
// Blocked from EXPERIMENTAL_useProjectService on:
63+
// https://github.com/typescript-eslint/typescript-eslint/issues/8206
64+
project: ["./**/tsconfig.eslint.json", "./**/tsconfig.json"],
6565
},
6666
rules: {
6767
// These off-by-default rules work well for this repo and we like them on.
@@ -77,7 +77,7 @@ module.exports = {
7777
},
7878
},
7979
{
80-
excludedFiles: ["package.json"],
80+
excludedFiles: ["**/package.json"],
8181
extends: ["plugin:jsonc/recommended-with-json"],
8282
files: ["*.json", "*.jsonc"],
8383
parser: "jsonc-eslint-parser",
@@ -97,9 +97,16 @@ module.exports = {
9797
files: ["package.json"],
9898
parser: "jsonc-eslint-parser",
9999
plugins: ["package-json"],
100+
rules: {
101+
// https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/250
102+
"package-json/valid-package-def": "off",
103+
104+
// https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/252
105+
"package-json/valid-repository-directory": "off",
106+
},
100107
},
101108
{
102-
files: "**/*.test.ts",
109+
files: "**/*.test.{ts,tsx}",
103110
rules: {
104111
// These on-by-default rules aren't useful in test files.
105112
"@typescript-eslint/no-unsafe-assignment": "off",
@@ -111,7 +118,6 @@ module.exports = {
111118
files: ["**/*.{yml,yaml}"],
112119
parser: "yaml-eslint-parser",
113120
rules: {
114-
"yml/file-extension": ["error", { extension: "yml" }],
115121
"yml/sort-keys": [
116122
"error",
117123
{

.github/DEVELOPMENT.md

+11-23
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,33 @@ pnpm install
1313
1414
## Building
1515

16-
Run tsup locally to build source files from `src/` into output files in `lib/`:
16+
Run [TypeScript](https://typescriptlang.org) to build each project's files from its `src/` directory into output files in its `lib/` directory:
1717

1818
```shell
1919
pnpm build
2020
```
2121

22-
Add `--watch` to run the builder in a watch mode that continuously cleans and recreates `lib/` as you save files:
22+
Add `--watch` to run the builder in a watch mode that continuously rebuilds as you save files:
2323

2424
```shell
2525
pnpm build --watch
2626
```
2727

28-
### Building Demos
29-
30-
A set of `.html` files exists under `demo/` with a different way of showing off `emoji-blast` features.
31-
Each corresponds to a Webpack ["entry point"](https://webpack.js.org/concepts/entry-points) under under the same name.
28+
You should also see suggestions from TypeScript in your editor.
3229

33-
Run [**webpack**](https://webpack.js.org) locally to build source files from `src/` into output files in `dist/`:
30+
### Individual Packages
3431

35-
```shell
36-
pnpm build:dist
37-
```
32+
Note that some individual packages also have their own `build` command.
33+
Each package `build` runs [webpack](https://webpack.js.org) to build source files from `src/` into output files in `dist/`.
3834

39-
Add `--watch` to run the builder in a watch mode:
35+
You can run them all from the root with:
4036

4137
```shell
42-
pnpm build:dist --watch
38+
pnpm build:all
4339
```
4440

41+
See each package's `.github/DEVELOPMENT.md` for per-package building instructions.
42+
4543
## Formatting
4644

4745
[Prettier](https://prettier.io) is used to format code.
@@ -67,7 +65,7 @@ Each should be shown in VS Code, and can be run manually on the command-line:
6765
## Testing
6866

6967
[Vitest](https://vitest.dev) is used for tests.
70-
You can run it locally on the command-line:
68+
You can run it on the command-line:
7169

7270
```shell
7371
pnpm run test
@@ -83,13 +81,3 @@ pnpm run test --coverage
8381

8482
This repository includes a [VS Code launch configuration](https://code.visualstudio.com/docs/editor/debugging) for debugging unit tests.
8583
To launch it, open a test file, then run _Debug Current Test File_ from the VS Code Debug panel (or press F5).
86-
87-
## Type Checking
88-
89-
Run [TypeScript](https://typescriptlang.org) locally to type check files in `src/`:
90-
91-
```shell
92-
pnpm tsc --watch
93-
```
94-
95-
You should also see suggestions from TypeScript in your editor.

.github/workflows/build.yml .github/workflows/build-all.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ jobs:
55
- uses: actions/checkout@v4
66
- uses: ./.github/actions/prepare
77
- run: pnpm build
8-
- run: node ./lib/index.js
8+
- run: pnpm build:all
9+
- run: for file in ./packages/*/lib/index.js; do node $file; done
910

10-
name: Build
11+
name: Build All
1112

1213
on:
1314
pull_request: ~

.github/workflows/build-dist.yml

-15
This file was deleted.

.github/workflows/lint.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ jobs:
44
steps:
55
- uses: actions/checkout@v4
66
- uses: ./.github/actions/prepare
7+
- run: pnpm build
78
- run: pnpm lint
89

910
name: Lint

.github/workflows/post-release.yml

-27
This file was deleted.

.github/workflows/release.yml

-29
This file was deleted.

.github/workflows/test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ jobs:
44
steps:
55
- uses: actions/checkout@v4
66
- uses: ./.github/actions/prepare
7+
- run: pnpm build
78
- run: pnpm run test --coverage
89
- name: Codecov
910
uses: codecov/codecov-action@v3

.github/workflows/tsc.yml

-15
This file was deleted.

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ coverage/
22
dist/
33
lib/
44
node_modules/
5+
tsconfig.tsbuildinfo

.release-it.json

-18
This file was deleted.

0 commit comments

Comments
 (0)