Skip to content

Commit 941bdf0

Browse files
authored
Merge pull request #2 from ascorbic/tooling
chore: setup more tooling
2 parents 9a87857 + 6bb064a commit 941bdf0

File tree

9 files changed

+129
-155
lines changed

9 files changed

+129
-155
lines changed

.github/workflows/semantic-prs.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "Lint PR"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
permissions:
11+
pull-requests: write
12+
13+
jobs:
14+
main:
15+
name: Validate PR title
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: amannn/action-semantic-pull-request@v5
19+
with:
20+
types: |
21+
fix
22+
feat
23+
chore
24+
docs
25+
ci
26+
test
27+
revert
28+
id: lint_pr_title
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- uses: marocchino/sticky-pull-request-comment@v2
33+
# When the previous steps fails, the workflow would stop. By adding this
34+
# condition you can continue the execution with the populated error message.
35+
if: always() && (steps.lint_pr_title.outputs.error_message != null)
36+
with:
37+
header: pr-title-lint-error
38+
message: |
39+
Hey there and thank you for opening this pull request! 👋🏼
40+
41+
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
42+
Without this title format, a release will not be triggered
43+
44+
Details:
45+
46+
```
47+
${{ steps.lint_pr_title.outputs.error_message }}
48+
```
49+
50+
# Delete a previous comment when the issue has been resolved
51+
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
52+
uses: marocchino/sticky-pull-request-comment@v2
53+
with:
54+
header: pr-title-lint-error
55+
delete: true

.github/workflows/test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Test
2+
on:
3+
pull_request:
4+
push:
5+
branches: [main]
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
- uses: pnpm/action-setup@v2
13+
with:
14+
version: 8
15+
- name: Setup Node
16+
uses: actions/setup-node@v4
17+
with:
18+
cache: "pnpm"
19+
check-latest: true
20+
registry-url: "https://registry.npmjs.org"
21+
- name: Install dependencies
22+
run: |
23+
corepack enable
24+
pnpm install
25+
- name: Build
26+
run: pnpm build
27+
- name: Test
28+
run: pnpm test

.gitignore

Lines changed: 3 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
node_modules
12
# Logs
23
logs
34
*.log
@@ -10,67 +11,6 @@ lerna-debug.log*
1011
# Diagnostic reports (https://nodejs.org/api/report.html)
1112
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
1213

13-
# Runtime data
14-
pids
15-
*.pid
16-
*.seed
17-
*.pid.lock
18-
19-
# Directory for instrumented libs generated by jscoverage/JSCover
20-
lib-cov
21-
22-
# Coverage directory used by tools like istanbul
23-
coverage
24-
*.lcov
25-
26-
# nyc test coverage
27-
.nyc_output
28-
29-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30-
.grunt
31-
32-
# Bower dependency directory (https://bower.io/)
33-
bower_components
34-
35-
# node-waf configuration
36-
.lock-wscript
37-
38-
# Compiled binary addons (https://nodejs.org/api/addons.html)
39-
build/Release
40-
41-
# Dependency directories
42-
node_modules/
43-
jspm_packages/
44-
45-
# Snowpack dependency directory (https://snowpack.dev/)
46-
web_modules/
47-
48-
# TypeScript cache
49-
*.tsbuildinfo
50-
51-
# Optional npm cache directory
52-
.npm
53-
54-
# Optional eslint cache
55-
.eslintcache
56-
57-
# Optional stylelint cache
58-
.stylelintcache
59-
60-
# Microbundle cache
61-
.rpt2_cache/
62-
.rts2_cache_cjs/
63-
.rts2_cache_es/
64-
.rts2_cache_umd/
65-
66-
# Optional REPL history
67-
.node_repl_history
68-
69-
# Output of 'npm pack'
70-
*.tgz
71-
72-
# Yarn Integrity file
73-
.yarn-integrity
7414

7515
# dotenv environment variable files
7616
.env
@@ -81,53 +21,10 @@ web_modules/
8121

8222
# parcel-bundler cache (https://parceljs.org/)
8323
.cache
84-
.parcel-cache
8524

86-
# Next.js build output
87-
.next
88-
out
89-
90-
# Nuxt.js build / generate output
91-
.nuxt
9225
dist
9326

94-
# Gatsby files
95-
.cache/
96-
# Comment in the public line in if your project uses Gatsby and not Next.js
97-
# https://nextjs.org/blog/next-9-1#public-directory-support
98-
# public
99-
100-
# vuepress build output
101-
.vuepress/dist
102-
103-
# vuepress v2.x temp and cache directory
104-
.temp
105-
.cache
106-
107-
# Docusaurus cache and generated files
108-
.docusaurus
109-
110-
# Serverless directories
111-
.serverless/
112-
113-
# FuseBox cache
114-
.fusebox/
115-
116-
# DynamoDB Local files
117-
.dynamodb/
118-
119-
# TernJS port file
120-
.tern-port
121-
122-
# Stores VSCode versions used for testing VSCode extensions
123-
.vscode-test
124-
125-
# yarn v2
126-
.yarn/cache
127-
.yarn/unplugged
128-
.yarn/build-state.yml
129-
.yarn/install-state.gz
130-
.pnp.*
131-
13227
# Local Netlify folder
13328
.netlify
29+
30+
*.tgz

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1",
7+
"test": "pnpm run --filter @ascorbic/* test",
88
"build": "pnpm run --filter @ascorbic/* build"
99
},
1010
"keywords": [],
@@ -15,5 +15,5 @@
1515
"@types/node": "^20.14.11",
1616
"prettier": "^3.3.3"
1717
},
18-
"packageManager": "pnpm@8.15.8+sha256.691fe176eea9a8a80df20e4976f3dfb44a04841ceb885638fe2a26174f81e65e"
18+
"packageManager": "pnpm@9.1.4"
1919
}

packages/feed/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
},
1010
"scripts": {
1111
"build": "tsup src/index.ts --format esm --dts --clean",
12+
"dev": "tsup src/index.ts --format esm --dts --watch",
1213
"prepublishOnly": "node --run build",
13-
"check": "publint && attw --pack"
14+
"check": "publint && attw $(pnpm pack) --ignore-rules=cjs-resolves-to-esm",
15+
"test": "node --test"
1416
},
1517
"devDependencies": {
1618
"@arethetypeswrong/cli": "^0.15.3",

packages/feed/src/feed-loader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Loader } from "astro/loaders";
22
import FeedParser from "feedparser";
3-
import { webToNodeStream } from "./streams.js";
43
import { ItemSchema, type Item } from "./schema.js";
4+
import { webToNodeStream } from "./streams.js";
55

66
export interface FeedLoaderOptions {
77
/** URL of the feed */

packages/feed/tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"include": [
4+
"src"
5+
]
6+
}

renovate.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"github>unjs/renovate-config",
5+
":widenPeerDependencies"
6+
],
7+
"packageRules": []
8+
}

tsconfig.json

Lines changed: 23 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,27 @@
11
{
22
"compilerOptions": {
3-
/* Basic Options */
4-
"target": "ESNext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
5-
"module": "NodeNext", /* Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
6-
// "lib": [], /* Specify library files to be included in the compilation: */
7-
// "allowJs": true, /* Allow javascript files to be compiled. */
8-
// "checkJs": true, /* Report errors in .js files. */
9-
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
10-
"declaration": true, /* Generates corresponding '.d.ts' file. */
11-
// "sourceMap": true, /* Generates corresponding '.map' file. */
12-
// "outFile": "./", /* Concatenate and emit output to single file. */
13-
// "outDir": "./", /* Redirect output structure to the directory. */
14-
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
15-
// "removeComments": true, /* Do not emit comments to output. */
16-
"noEmit": true, /* Do not emit outputs. */
17-
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
18-
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
19-
"isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
20-
/* Strict Type-Checking Options */
21-
"strict": true, /* Enable all strict type-checking options. */
22-
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
23-
// "strictNullChecks": true, /* Enable strict null checks. */
24-
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
25-
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
26-
/* Additional Checks */
27-
// "noUnusedLocals": true, /* Report errors on unused locals. */
28-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
29-
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
30-
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
31-
/* Module Resolution Options */
32-
"moduleResolution": "NodeNext", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
33-
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
34-
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
35-
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
36-
// "typeRoots": [], /* List of folders to include type definitions from. */
37-
// "types": [], /* Type declaration files to be included in compilation. */
38-
"allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
39-
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
40-
/* Source Map Options */
41-
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
42-
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
43-
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
44-
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
45-
/* Experimental Options */
46-
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
47-
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
3+
/* Base Options: */
4+
"esModuleInterop": true,
5+
"skipLibCheck": true,
6+
"target": "es2022",
7+
"allowJs": true,
8+
"resolveJsonModule": true,
9+
"moduleDetection": "force",
10+
"isolatedModules": true,
11+
"verbatimModuleSyntax": true,
12+
/* Strictness */
13+
"strict": true,
14+
"noUncheckedIndexedAccess": true,
15+
"noImplicitOverride": true,
16+
/* AND if you're building for a library: */
17+
"declaration": true,
18+
"declarationMap": true,
19+
/* If NOT transpiling with TypeScript: */
20+
"module": "preserve",
21+
"noEmit": true,
22+
/* If your code doesn't run in the DOM: */
23+
"lib": [
24+
"es2022"
25+
]
4826
}
4927
}

0 commit comments

Comments
 (0)