@teo-garcia/prettier-config-shared 0.2.9 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitattributes ADDED
@@ -0,0 +1 @@
1
+ * text=auto eol=lf
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report broken behavior, incorrect setup, or a regression
4
+ title: '[Bug]: '
5
+ labels: bug
6
+ ---
7
+
8
+ ## Summary
9
+
10
+ <!-- Clear and concise description of the problem -->
11
+
12
+ ## Steps To Reproduce
13
+
14
+ 1.
15
+ 2.
16
+ 3.
17
+
18
+ ## Expected Behavior
19
+
20
+ <!-- What should happen -->
21
+
22
+ ## Actual Behavior
23
+
24
+ <!-- What actually happens -->
25
+
26
+ ## Environment
27
+
28
+ - Repo:
29
+ - Commit / version:
30
+ - Runtime:
31
+ - OS:
32
+
33
+ ## Additional Context
34
+
35
+ <!-- Logs, screenshots, or notes -->
@@ -0,0 +1 @@
1
+ blank_issues_enabled: true
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: Improvement
3
+ about: Suggest an improvement to the template, docs, tooling, or workflow
4
+ title: '[Proposal]: '
5
+ labels: enhancement
6
+ ---
7
+
8
+ ## Summary
9
+
10
+ <!-- Clear and concise description of the improvement -->
11
+
12
+ ## Problem
13
+
14
+ <!-- What is missing, awkward, or inconsistent today -->
15
+
16
+ ## Proposed Change
17
+
18
+ <!-- Describe the proposed solution -->
19
+
20
+ ## Alternatives Considered
21
+
22
+ <!-- Optional: other options you considered -->
23
+
24
+ ## Additional Context
25
+
26
+ <!-- Anything else reviewers should know -->
@@ -0,0 +1,20 @@
1
+ ## Summary
2
+
3
+ <!-- Describe the change and its intent -->
4
+
5
+ ## Testing
6
+
7
+ <!-- List the checks you ran locally -->
8
+
9
+ - [ ] Relevant checks pass locally
10
+ - [ ] Docs/config updated if needed
11
+
12
+ ## Checklist
13
+
14
+ - [ ] Scope is focused and intentional
15
+ - [ ] Breaking changes are documented
16
+ - [ ] Screenshots or logs attached when useful
17
+
18
+ ## Related Issues
19
+
20
+ Closes #
@@ -6,21 +6,25 @@ on:
6
6
  pull_request:
7
7
  branches: [main]
8
8
 
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11
+ cancel-in-progress: true
12
+
9
13
  jobs:
10
14
  check:
11
15
  runs-on: ubuntu-latest
12
16
  steps:
13
17
  - name: Checkout code
14
- uses: actions/checkout@v4
18
+ uses: actions/checkout@v6
15
19
 
16
20
  - name: Setup pnpm
17
- uses: pnpm/action-setup@v4
21
+ uses: pnpm/action-setup@v6
18
22
 
19
23
  - name: Setup Node.js
20
- uses: actions/setup-node@v4
24
+ uses: actions/setup-node@v6
21
25
  with:
22
- node-version: '24'
23
- cache: 'pnpm'
26
+ node-version: "24"
27
+ cache: "pnpm"
24
28
 
25
29
  - name: Install dependencies
26
30
  run: pnpm install --frozen-lockfile
@@ -3,7 +3,11 @@ name: Publish to npm
3
3
  on:
4
4
  push:
5
5
  tags:
6
- - 'v*'
6
+ - "v*"
7
+
8
+ concurrency:
9
+ group: ${{ github.workflow }}-${{ github.ref }}
10
+ cancel-in-progress: true
7
11
 
8
12
  jobs:
9
13
  publish:
@@ -16,28 +20,24 @@ jobs:
16
20
  uses: actions/checkout@v6
17
21
 
18
22
  - name: Setup pnpm
19
- uses: pnpm/action-setup@v4
23
+ uses: pnpm/action-setup@v6
20
24
 
21
25
  - name: Setup Node.js
22
26
  uses: actions/setup-node@v6
23
27
  with:
24
- node-version: '24'
25
- registry-url: 'https://registry.npmjs.org'
26
-
27
- - name: Setup npm for Trusted Publishing
28
- run: npm install -g npm@latest && npm --version
28
+ node-version: "24"
29
+ registry-url: "https://registry.npmjs.org"
29
30
 
30
31
  - name: Install dependencies
31
- run: pnpm install --no-frozen-lockfile
32
+ run: pnpm install --frozen-lockfile
32
33
 
33
- - name: Security audit
34
- run: pnpm audit --audit-level=high
35
- continue-on-error: true
34
+ - name: Check package
35
+ run: pnpm check
36
36
 
37
37
  - name: Publish to npm via OIDC
38
38
  run: npm publish --provenance --access public
39
39
 
40
40
  - name: Create GitHub Release
41
- uses: softprops/action-gh-release@v2
41
+ uses: softprops/action-gh-release@v3
42
42
  with:
43
43
  generate_release_notes: true
@@ -0,0 +1,2 @@
1
+ PNPM_VERSION=$(node -p 'require("./package.json").packageManager?.split("@")[1] ?? "latest"')
2
+ exec npx -y "pnpm@${PNPM_VERSION}" lint-staged
@@ -0,0 +1,2 @@
1
+ PNPM_VERSION=$(node -p 'require("./package.json").packageManager?.split("@")[1] ?? "latest"')
2
+ exec npx -y "pnpm@${PNPM_VERSION}" format:check
@@ -0,0 +1,3 @@
1
+ export default {
2
+ '**/*.{js,mjs,cjs,ts,tsx,json,md,yml,yaml}': ['prettier --write'],
3
+ }
package/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 teo-garcia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+
24
+
package/README.md CHANGED
@@ -8,13 +8,14 @@
8
8
  [![npm](https://img.shields.io/npm/v/@teo-garcia/prettier-config-shared?color=blue)](https://www.npmjs.com/package/@teo-garcia/prettier-config-shared)
9
9
  [![Prettier](https://img.shields.io/badge/Prettier-3-F7B93E?logo=prettier&logoColor=black)](https://prettier.io)
10
10
 
11
- Part of the [@teo-garcia/templates](https://github.com/teo-garcia/templates) ecosystem
11
+ Part of the [@teo-garcia/templates](https://github.com/teo-garcia/templates)
12
+ ecosystem
12
13
 
13
14
  </div>
14
15
 
15
16
  ---
16
17
 
17
- ## Features
18
+ ## Settings
18
19
 
19
20
  | Setting | Value |
20
21
  | ------------------- | -------- |
@@ -25,64 +26,27 @@ Part of the [@teo-garcia/templates](https://github.com/teo-garcia/templates) eco
25
26
  | **JSX Quotes** | Single |
26
27
  | **Print Width** | 80 |
27
28
 
28
- **File-specific rules:**
29
+ File-specific overrides: Markdown always wraps prose, YAML uses no single quotes
30
+ with 2-space indent, and JSON has no trailing commas.
29
31
 
30
- - Markdown: Always wrap prose
31
- - Prisma: Proper `.prisma` file formatting
32
- - YAML: No single quotes, 2-space indent
33
- - JSON: No trailing commas
32
+ ---
34
33
 
35
34
  ## Requirements
36
35
 
37
- - Node.js 20+
36
+ - Node.js 24+
38
37
  - Prettier 3+
39
38
 
40
- ## Quick Start
41
-
42
- ```bash
43
- # Install the package
44
- pnpm add -D @teo-garcia/prettier-config-shared prettier
45
- ```
46
-
47
- ### Package.json (Recommended)
48
-
49
- ```json
50
- {
51
- "prettier": "@teo-garcia/prettier-config-shared"
52
- }
53
- ```
54
-
55
- ### Configuration File
56
-
57
- ```javascript
58
- // prettier.config.js
59
- import sharedConfig from '@teo-garcia/prettier-config-shared'
60
-
61
- export default sharedConfig
62
- ```
63
-
64
- ## Extending
65
-
66
- Override settings as needed:
67
-
68
- ```javascript
69
- // prettier.config.js
70
- import sharedConfig from '@teo-garcia/prettier-config-shared'
71
-
72
- export default {
73
- ...sharedConfig,
74
- printWidth: 100,
75
- semi: true,
76
- }
77
- ```
39
+ ---
78
40
 
79
41
  ## Related Packages
80
42
 
81
- | Package | Description |
82
- | -------------------------------------------------------------------------------------- | ------------------- |
83
- | [@teo-garcia/eslint-config-shared](https://github.com/teo-garcia/eslint-config-shared) | ESLint rules |
84
- | [@teo-garcia/tsconfig-shared](https://github.com/teo-garcia/tsconfig-shared) | TypeScript settings |
85
- | [@teo-garcia/vitest-config-shared](https://github.com/teo-garcia/vitest-config-shared) | Test configuration |
43
+ | Package | Description |
44
+ | ---------------------------------- | ------------------- |
45
+ | `@teo-garcia/eslint-config-shared` | ESLint rules |
46
+ | `@teo-garcia/tsconfig-shared` | TypeScript settings |
47
+ | `@teo-garcia/vitest-config-shared` | Test configuration |
48
+
49
+ ---
86
50
 
87
51
  ## License
88
52
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teo-garcia/prettier-config-shared",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "Shared Prettier configuration for fullstack web templates",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -22,7 +22,8 @@
22
22
  "type": "git",
23
23
  "url": "git+https://github.com/teo-garcia/prettier-config-shared.git"
24
24
  },
25
- "packageManager": "pnpm@10.2.0",
25
+ "prettier": "@teo-garcia/prettier-config-shared",
26
+ "packageManager": "pnpm@10.33.2",
26
27
  "engines": {
27
28
  "node": ">=24"
28
29
  },
@@ -30,11 +31,16 @@
30
31
  "prettier": "^3.0.0"
31
32
  },
32
33
  "scripts": {
33
- "check": "pnpm format:check",
34
+ "check": "pnpm format:check && pnpm smoke:consumer",
34
35
  "format": "prettier --write .",
35
- "format:check": "prettier --check ."
36
+ "format:check": "prettier --check .",
37
+ "prepare": "husky",
38
+ "smoke:consumer": "node scripts/consumer-smoke.mjs"
36
39
  },
37
40
  "devDependencies": {
41
+ "@teo-garcia/prettier-config-shared": "^0.2.9",
42
+ "husky": "^9.1.7",
43
+ "lint-staged": "^16.2.3",
38
44
  "prettier": "^3.8.1"
39
45
  }
40
46
  }
package/renovate.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": ["config:recommended"],
4
+ "dependencyDashboard": true,
5
+ "labels": ["dependencies"],
6
+ "platformAutomerge": true,
7
+ "packageRules": [
8
+ {
9
+ "groupName": "teo-garcia shared configs",
10
+ "schedule": ["on the first day of the month"],
11
+ "automerge": false,
12
+ "reviewers": ["teo-garcia"],
13
+ "matchPackageNames": ["/^@teo-garcia//"]
14
+ },
15
+ {
16
+ "groupName": "all dependencies",
17
+ "matchUpdateTypes": ["minor", "patch"],
18
+ "excludePackagePatterns": ["^@teo-garcia/"],
19
+ "schedule": ["on the first day of the month"],
20
+ "minimumReleaseAge": "3 days",
21
+ "automerge": true,
22
+ "automergeType": "pr"
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1,78 @@
1
+ import { execFileSync } from 'node:child_process'
2
+ import {
3
+ mkdtempSync,
4
+ mkdirSync,
5
+ readFileSync,
6
+ readdirSync,
7
+ writeFileSync,
8
+ } from 'node:fs'
9
+ import { tmpdir } from 'node:os'
10
+ import path from 'node:path'
11
+ import { fileURLToPath } from 'node:url'
12
+
13
+ const packageRoot = path.resolve(
14
+ path.dirname(fileURLToPath(import.meta.url)),
15
+ '..'
16
+ )
17
+ const packageJson = JSON.parse(
18
+ readFileSync(path.join(packageRoot, 'package.json'), 'utf8')
19
+ )
20
+ const tempRoot = mkdtempSync(path.join(tmpdir(), 'teo-prettier-consumer-'))
21
+ const tarballDir = path.join(tempRoot, 'tarballs')
22
+ const consumerDir = path.join(tempRoot, 'consumer')
23
+
24
+ mkdirSync(tarballDir)
25
+ mkdirSync(consumerDir)
26
+
27
+ execFileSync('pnpm', ['pack', '--pack-destination', tarballDir], {
28
+ cwd: packageRoot,
29
+ stdio: 'inherit',
30
+ })
31
+
32
+ const tarballName = readdirSync(tarballDir).find((file) =>
33
+ file.endsWith('.tgz')
34
+ )
35
+
36
+ if (!tarballName) {
37
+ throw new Error('pnpm pack did not create a tarball')
38
+ }
39
+
40
+ writeFileSync(
41
+ path.join(consumerDir, 'package.json'),
42
+ `${JSON.stringify(
43
+ {
44
+ private: true,
45
+ type: 'module',
46
+ prettier: packageJson.name,
47
+ dependencies: {
48
+ [packageJson.name]: `file:${path.join(tarballDir, tarballName)}`,
49
+ ...packageJson.peerDependencies,
50
+ },
51
+ },
52
+ null,
53
+ 2
54
+ )}\n`
55
+ )
56
+
57
+ writeFileSync(
58
+ path.join(consumerDir, 'sample.js'),
59
+ 'const value = { ok: true }\nconsole.log(value)\n'
60
+ )
61
+
62
+ execFileSync('pnpm', ['install', '--ignore-scripts'], {
63
+ cwd: consumerDir,
64
+ stdio: 'inherit',
65
+ })
66
+
67
+ const config = (await import(packageJson.name)).default
68
+
69
+ if (config.semi !== false || config.singleQuote !== true) {
70
+ throw new Error('unexpected prettier config export')
71
+ }
72
+
73
+ execFileSync('pnpm', ['exec', 'prettier', '--check', 'sample.js'], {
74
+ cwd: consumerDir,
75
+ stdio: 'inherit',
76
+ })
77
+
78
+ console.log('prettier packed consumer smoke ok')