@jk2908/cxx 0.2.1 → 0.2.2

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.
Files changed (2) hide show
  1. package/README.md +23 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -81,6 +81,29 @@ The transform always emits minified CSS and CSS Modules class mappings.
81
81
 
82
82
  `typeSuffix` controls the generated exported type name suffix. It defaults to `'Classes'`. Set it to `false` to omit the suffix.
83
83
 
84
+ ## Next
85
+
86
+ ```ts
87
+ import path from 'node:path'
88
+ import { fileURLToPath } from 'node:url'
89
+
90
+ import { withCxx } from '@jk2908/cxx/next'
91
+
92
+ const rootDir = path.dirname(fileURLToPath(import.meta.url))
93
+ const turbopackRoot = path.resolve(rootDir, '../..')
94
+
95
+ /** @type {import('next').NextConfig} */
96
+ const nextConfig = {
97
+ turbopack: {
98
+ root: turbopackRoot,
99
+ },
100
+ }
101
+
102
+ export default withCxx(nextConfig, { typeSuffix: 'Classes' })
103
+ ```
104
+
105
+ Use the Next integration when you want `cxx` transforms and generated class-key types inside a Next app. In a monorepo, set `turbopack.root` so the loader resolves the right workspace root.
106
+
84
107
  See [CHANGELOG.md](./CHANGELOG.md) for release notes.
85
108
 
86
109
  ## License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jk2908/cxx",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "author": "Jerome Kenway",
6
6
  "repository": {