@fullsnacklab/oxfmt-config 0.0.0-stage → 0.1.0

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/README.md CHANGED
@@ -1,3 +1,115 @@
1
- # Temporary Holding Version
1
+ # @fullsnacklab/oxfmt-config
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Shared Oxfmt config: width 80, single quotes, and the existing agent-directory
4
+ ignores. `base.json` owns these values; the root export is built JavaScript with
5
+ type declarations. Indentation comes from the consumer's EditorConfig unless
6
+ explicitly overridden in Oxfmt.
7
+
8
+ ## Install
9
+
10
+ ```sh
11
+ bun add --dev @fullsnacklab/oxfmt-config oxfmt@~0.65.0
12
+ ```
13
+
14
+ Create `oxfmt.config.ts` at your project root:
15
+
16
+ ```ts
17
+ import shared from '@fullsnacklab/oxfmt-config';
18
+ import { defineConfig } from 'oxfmt';
19
+
20
+ export default defineConfig({
21
+ ...shared,
22
+ });
23
+ ```
24
+
25
+ Add scripts to your `package.json`:
26
+
27
+ ```json
28
+ {
29
+ "scripts": {
30
+ "format": "oxfmt",
31
+ "format:check": "oxfmt --check"
32
+ }
33
+ }
34
+ ```
35
+
36
+ Use `bun run format` to write changes and `bun run format:check` for read-only
37
+ checks. The local wrapper keeps relative file patterns anchored in your project.
38
+
39
+ ## Editor settings
40
+
41
+ Copy [`examples/.editorconfig`](examples/.editorconfig) to your project root:
42
+
43
+ ```sh
44
+ cp node_modules/@fullsnacklab/oxfmt-config/examples/.editorconfig .editorconfig
45
+ ```
46
+
47
+ Merge it with an existing EditorConfig rather than replacing project-specific
48
+ sections. The example chooses:
49
+
50
+ - **4 spaces for code; 2 for JSON/JSONC, YAML, and TOML.** TS/JS config files use code indentation.
51
+ - LF, UTF-8, final newlines, and trimmed trailing whitespace.
52
+ - Preserved trailing whitespace in Markdown/MDX, where spaces can encode line breaks.
53
+
54
+ Oxfmt uses supported EditorConfig settings as fallbacks; explicit Oxfmt options
55
+ win. Quotes and print width belong in Oxfmt, not nonstandard EditorConfig keys.
56
+ The Markdown exception controls editor trimming, not Oxfmt's Markdown rendering.
57
+
58
+ ## Project overrides
59
+
60
+ Keep exceptions in your wrapper:
61
+
62
+ ```ts
63
+ import shared from '@fullsnacklab/oxfmt-config';
64
+ import { defineConfig } from 'oxfmt';
65
+
66
+ export default defineConfig({
67
+ ...shared,
68
+ printWidth: 100,
69
+ ignorePatterns: [...(shared.ignorePatterns ?? []), 'dist/**'],
70
+ });
71
+ ```
72
+
73
+ Setting `ignorePatterns` directly replaces the shared list; appending retains it.
74
+ The base ignores `.pi`, `.agents`, `.opencode`, `.claude`, `.omp`, and `.codex`
75
+ patterns. Override the list deliberately if you want those files formatted.
76
+
77
+ ## Raw JSON
78
+
79
+ `@fullsnacklab/oxfmt-config/base.json` exposes the same source data:
80
+
81
+ ```ts
82
+ import base from '@fullsnacklab/oxfmt-config/base.json' with { type: 'json' };
83
+
84
+ export default { ...base };
85
+ ```
86
+
87
+ Oxfmt does not provide package-name JSON `extends`; use the local wrapper rather
88
+ than adding an unsupported inheritance property.
89
+
90
+ ## Releases
91
+
92
+ After the initial publish, configure npm trusted publishing for:
93
+
94
+ - Owner: `full-snack-lab`
95
+ - Repository: `oxfmt-config`
96
+ - Workflow filename: `release.yml`
97
+ - Environment: leave blank
98
+ - Allow direct `npm publish`
99
+
100
+ Commit a new package version and run **Actions → Release → Run workflow** on that
101
+ commit's branch. The workflow uses Bun to install/build/pack and npm solely for
102
+ OIDC publishing. It needs no stored npm token. Already-published versions cannot
103
+ be republished. The workflow must be pushed to GitHub before it is available.
104
+
105
+ ## Maintaining
106
+
107
+ ```sh
108
+ bun install --frozen-lockfile
109
+ bun run build
110
+ bun pm pack --dry-run --ignore-scripts
111
+ ```
112
+
113
+ Bunup emits ESM and isolated declarations into `dist/`. The explicit public type
114
+ avoids the inferred-declaration compiler path. The package includes built files,
115
+ `base.json`, and the EditorConfig example. No build is required in consuming projects.
package/base.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "ignorePatterns": [
3
+ "**/.pi/*",
4
+ "**/.agents/*",
5
+ "**/.opencode/*",
6
+ "**/.claude/*",
7
+ "**/.omp/*",
8
+ "**/.codex/*"
9
+ ],
10
+ "printWidth": 80,
11
+ "singleQuote": true
12
+ }
@@ -0,0 +1,3 @@
1
+ import { OxfmtConfig } from "oxfmt";
2
+ declare const config: OxfmtConfig;
3
+ export { config as default };
@@ -0,0 +1,20 @@
1
+ // base.json
2
+ var base_default = {
3
+ ignorePatterns: [
4
+ "**/.pi/*",
5
+ "**/.agents/*",
6
+ "**/.opencode/*",
7
+ "**/.claude/*",
8
+ "**/.omp/*",
9
+ "**/.codex/*"
10
+ ],
11
+ printWidth: 80,
12
+ singleQuote: true
13
+ };
14
+
15
+ // oxfmt.config.ts
16
+ var config = base_default;
17
+ var oxfmt_config_default = config;
18
+ export {
19
+ oxfmt_config_default as default
20
+ };
@@ -0,0 +1,18 @@
1
+ # Copy to the consumer root. Oxfmt reads these as fallback formatting settings.
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ end_of_line = lf
7
+ indent_style = space
8
+ indent_size = 4
9
+ insert_final_newline = true
10
+ trim_trailing_whitespace = true
11
+
12
+ # Structured configuration uses two spaces; TS/JS config files remain code.
13
+ [*.{json,jsonc,yaml,yml,toml}]
14
+ indent_size = 2
15
+
16
+ # Preserve Markdown's intentional two-space hard line breaks.
17
+ [*.{md,mdx}]
18
+ trim_trailing_whitespace = false
package/package.json CHANGED
@@ -1,6 +1,36 @@
1
1
  {
2
- "name": "@fullsnacklab/oxfmt-config",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
2
+ "name": "@fullsnacklab/oxfmt-config",
3
+ "description": "Oxfmt configuration",
4
+ "version": "0.1.0",
5
+ "devDependencies": {
6
+ "@changesets/cli": "^2.27.1",
7
+ "bunup": "0.16.32"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/full-snack-lab/oxfmt-config.git"
12
+ },
13
+ "author": {
14
+ "name": "Jordan Sweeting",
15
+ "email": "jordan@fullsnacklab.com",
16
+ "url": "https://fullsnacklab.com"
17
+ },
18
+ "license": "MIT",
19
+ "type": "module",
20
+ "files": ["dist", "base.json", "examples/.editorconfig"],
21
+ "scripts": {
22
+ "build": "bunup",
23
+ "format": "oxfmt",
24
+ "format:check": "oxfmt --check"
25
+ },
26
+ "peerDependencies": {
27
+ "oxfmt": "0.65.0"
28
+ },
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/oxfmt.config.d.ts",
32
+ "import": "./dist/oxfmt.config.js"
33
+ },
34
+ "./base.json": "./base.json"
35
+ }
6
36
  }