uivisor 0.1.1 → 0.1.3

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
@@ -2,69 +2,25 @@
2
2
 
3
3
  <img src="./uivisor.jpg" alt="uivisor" width="100%" />
4
4
 
5
- <h3>Point at any element in your running app, tweak it by hand, and copy a precise,<br/>breakpoint-aware prompt for your AI agent — without ever touching your code.</h3>
6
-
7
5
  <p>
8
- <img alt="dev only" src="https://img.shields.io/badge/dev--only-never%20ships%20to%20prod-22c55e?style=flat-square" />
6
+ <img alt="npm" src="https://img.shields.io/npm/v/uivisor?style=flat-square&color=cb3837&label=npm" />
7
+ <img alt="dev only" src="https://img.shields.io/badge/только%20dev-в%20прод%20не%20попадает-22c55e?style=flat-square" />
9
8
  <img alt="stack" src="https://img.shields.io/badge/React%20·%20Next.js%20·%20Vite-4f46e5?style=flat-square" />
10
- <img alt="prompt only" src="https://img.shields.io/badge/prompt--only-no%20code%20mutation-06b6d4?style=flat-square" />
11
9
  <img alt="license" src="https://img.shields.io/badge/license-MIT-3f3f46?style=flat-square" />
12
10
  </p>
13
11
 
14
12
  </div>
15
13
 
16
- ---
17
-
18
- ## The problem
19
-
20
- You spot a small UI nit in your running app — this padding's too tight, that heading wants a heavier
21
- weight, those cards need more radius at `lg`. Two bad options:
22
-
23
- 1. **Dig into the code** yourself for a one-line change, or
24
- 2. **Burn agent tokens** describing it in prose — *"on the pricing page, the middle card's button…"* — and hope the agent finds the right element.
25
-
26
- **uivisor** is a third option. Turn it on, **click the element, nudge it with your mouse**, and it hands you a
27
- copy-paste instruction that pins the **exact file & line**, the **styling mechanism**, the **breakpoint**, and
28
- **what to change** — so your agent makes the edit in one shot. uivisor itself **never writes to your source**;
29
- your tweaks are throwaway inline overrides in the browser.
14
+ Dev-only инструмент для React / Next.js / Vite. Кликни элемент в работающем приложении, поправь его мышкой — панель показывает текущие стили, твои правки подсвечены зелёным. Нажми **Copy prompt for agent** — получишь промпт с `file:line:col`, механизмом стилей и брейкпоинтом, готовый для Claude Code / Cursor.
30
15
 
31
- ## What you get
32
-
33
- Click a button, bump its padding and color, hit **Copy prompt for agent**, and you get:
34
-
35
- ```md
36
- # uivisor — apply these UI tweaks (2 changes across 1 element)
37
-
38
- ## 1. <button> "Get started" — src/components/PricingCard.tsx:26:7
39
- - Identify by: component <PricingCard>, data-testid="buy-pro", selector `button[data-testid="buy-pro"]`
40
- - Styling: tailwind (current classes: `mt-6 w-full rounded-md px-4 py-2 bg-indigo-600 text-white`)
41
- - At lg breakpoint (≥1024px):
42
- - padding: 16px → 24px → `lg:p-6`
43
- - background-color: rgb(79,70,229) → #16a34a → `lg:bg-[#16a34a]`
44
-
45
- ### Rules
46
- - Edit the EXISTING className/styles. Do NOT add inline styles or duplicate the component.
47
- - Scope each change to its breakpoint with a responsive variant (e.g. `lg:`).
48
- - Confirm the element by its source location, text and data-testid before editing.
49
- ```
50
-
51
- Paste that into Claude Code / Cursor / whatever — done. No more *"page 55, that thing"*.
16
+ В исходники не пишет. Правки — временные inline-оверрайды в браузере, пропадают при reload.
52
17
 
53
18
  ---
54
19
 
55
- ## Quick start
56
-
57
- > uivisor runs **only in dev** (`apply: 'serve'` / gated to `next dev`). It is **physically absent from your
58
- > production build.**
59
-
60
- It isn't on npm yet, so for a real project link it locally (rebuild + restart picks up changes — no reinstall):
20
+ ## Установка
61
21
 
62
22
  ```bash
63
- # in the uivisor folder
64
- npm install && npm run build
65
-
66
- # in YOUR project
67
- npm i -D file:/absolute/path/to/uivisor
23
+ npm i -D uivisor
68
24
  ```
69
25
 
70
26
  ### Vite + React
@@ -76,29 +32,29 @@ import uivisor from 'uivisor/vite'
76
32
  import react from '@vitejs/plugin-react'
77
33
 
78
34
  export default defineConfig({
79
- plugins: [uivisor(), react()], // ⚠️ uivisor() BEFORE react()
35
+ plugins: [uivisor(), react()], // uivisor() до react()
80
36
  })
81
37
  ```
82
38
 
39
+ Запусти dev-сервер и нажми **`Alt`+`U`**.
40
+
83
41
  ### Next.js (App Router, Next 13–16)
84
42
 
85
- **1. Wrap your config.** Works with `next.config.ts` / `.mjs` (ESM) or `.js` (CJS):
43
+ **1. Оберни конфиг:**
86
44
 
87
45
  ```ts
88
46
  // next.config.ts
89
47
  import { withUivisor } from 'uivisor/next'
90
-
91
- const nextConfig = { reactStrictMode: true }
92
-
93
- export default withUivisor(nextConfig)
48
+ export default withUivisor({ reactStrictMode: true })
94
49
  ```
50
+
95
51
  ```js
96
52
  // next.config.js (CommonJS)
97
53
  const { withUivisor } = require('uivisor/next')
98
54
  module.exports = withUivisor({ reactStrictMode: true })
99
55
  ```
100
56
 
101
- **2. Mount the overlay** once in your root layout (works under both bundlers):
57
+ **2. Добавь оверлей в корневой layout:**
102
58
 
103
59
  ```tsx
104
60
  // app/layout.tsx
@@ -109,90 +65,85 @@ export default function RootLayout({ children }) {
109
65
  }
110
66
  ```
111
67
 
112
- **3. Run it.** Then press **`Alt`+`U`** (or click **◎**).
68
+ **3. Запусти `next dev` и нажми `Alt`+`U`.**
113
69
 
114
- | Command | Overlay | Exact `file:line` |
70
+ Работает под обоими бандлерами:
71
+
72
+ | Команда | Оверлей | Точный `file:line` |
115
73
  |---|---|---|
116
- | `next dev --webpack` | ✅ | ✅ (recommended) |
117
- | `next dev` (**Turbopack**, default in Next 15/16) | ✅ | ⚠️ off — falls back to component + selector + text |
74
+ | `next dev` (Turbopack, по умолчанию в Next 15/16) | ✅ | ✅ |
75
+ | `next dev --webpack` | ✅ | |
118
76
 
119
- > **Turbopack ignores `webpack()` config**, so `data-uiv-src` source attributes aren't injected under plain
120
- > `next dev`. uivisor detects this and prints a clear console hint. For exact `file:line`, either run
121
- > `next dev --webpack` (add a `"dev:uivisor": "next dev --webpack"` script), or opt into the **experimental**
122
- > Turbopack loader: `withUivisor(config, { turbopack: true })`. Everything is **dev-only** — nothing reaches
123
- > production builds.
77
+ > Чтобы отключить source-mapping под Turbopack: `withUivisor(config, { turbopack: false })` оверлей продолжит работать, `file:line` доступен через `next dev --webpack`.
78
+ >
79
+ > Под Turbopack ставь uivisor **из npm** (`npm i -D uivisor`). Локальный `file:`-линк (`file:../uivisor`) Turbopack не резолвит для сабпасов вроде `uivisor/next/overlay` будет `Module not found`. С webpack `file:`-линк работает.
124
80
 
125
- #### Keeping it updated while we iterate
81
+ ---
126
82
 
127
- Linked with `file:` → after any change to uivisor, just `npm run build` in the uivisor folder and **restart your
128
- dev server**. No reinstall. (For Next, clear `.next/` if HMR doesn't pick it up.)
83
+ ## Работа с панелью
129
84
 
130
- ---
85
+ **`Alt`+`U`** — включить/выключить · **`Esc`** — снять выделение · **◎** — кнопка справа снизу.
131
86
 
132
- ## Using the panel
133
-
134
- 1. **`Alt`+`U`** toggles uivisor · **Esc** deselects.
135
- 2. **Click any element.** A Figma-like inspector fills with its spacing / border / typography / fill —
136
- only the controls that are relevant (Typography shows on text elements, Gap on flex/grid containers).
137
- 3. **Tweak:**
138
- - **Combined-by-default** — Padding / Margin / Radius show one "all sides" input; click **▦** to split into
139
- individual sides/corners.
140
- - **Drag-to-scrub** drag the icon on the left of any number field (cursor → ↔) to change it live.
141
- - **Units** line-height & letter-spacing have a px / % / em / × selector and always show the current number.
142
- 4. **Screen / breakpoint** — click `md` / `lg` / … and the app loads in a **virtual screen at that width**
143
- (real CSS media queries reflow); drag the frame edge to fine-tune. Only your project's **real breakpoints**
144
- are shown. Edits are scoped to the chosen breakpoint (`lg:p-6`). `Live` = your real window.
145
- 5. **Apply changes to** — pick the edit target:
146
- - **All N like this** — when the element is a repeated sibling (same component/source, e.g. 3 cards), the
147
- change previews on *all* of them and the prompt tells the agent to edit the shared component/source.
148
- - **Only this one** · an existing **`.class`** · or **a new class you name** (agent creates it, leaves the rest).
149
- 6. **Copy prompt for agent** (or **Copy JSON** for the machine-readable spec).
150
-
151
- Nothing is written to disk — tweaks live in the browser and vanish on reload.
87
+ 1. **Кликни любой элемент.** Панель подтягивает его текущие стили: значения из браузера горят белым, правки в uivisor — зелёным.
88
+ 2. **Правь:**
89
+ - Padding / Margin / Radius — одно поле на все стороны; кнопка **▦** раскрывает по отдельности.
90
+ - Иконка слева от числа (↔) тяни, значение меняется вживую.
91
+ - Line-height и letter-spacing переключатель единиц px / % / em.
92
+ 3. **Screen / breakpoint** — клик на `md` / `lg` / … загружает приложение в виртуальный экран этой ширины (реальные медиа-запросы перестраиваются). В баре — только брейкпоинты твоего проекта. `Live` — реальное окно.
93
+ 4. **Apply changes to** — куда применить правку:
94
+ - **All N like this** — если компонент повторяется N раз, превью и промпт применяются ко всем; агент правит общий компонент, а не `nth-child`.
95
+ - **Only this one** / существующий `.class` / новый класс с именем.
96
+ 5. **Copy prompt for agent** промпт в буфер. **Copy JSON** машиночитаемый спек.
152
97
 
153
98
  ---
154
99
 
155
- ## For your AI agent
100
+ ## Промпт для агента
101
+
102
+ ```md
103
+ # uivisor — apply these UI tweaks (2 changes across 1 element)
104
+
105
+ ## 1. <button> "Get started" — src/components/PricingCard.tsx:26:7
106
+ - Identify by: component <PricingCard>, data-testid="buy-pro"
107
+ - Styling: tailwind (current classes: `mt-6 w-full rounded-md px-4 py-2 bg-indigo-600 text-white`)
108
+ - At lg breakpoint (≥1024px):
109
+ - padding: 16px → 24px → `lg:p-6`
110
+ - background-color: #4f46e5 → #16a34a → `lg:bg-[#16a34a]`
111
+
112
+ ### Rules
113
+ - Edit the EXISTING className/styles. Do NOT add inline styles or duplicate the component.
114
+ - Scope each change to its breakpoint with a responsive variant (e.g. `lg:`).
115
+ ```
156
116
 
157
- uivisor's output is a **self-contained instruction**, designed to be acted on without extra context. When you
158
- receive a uivisor prompt:
117
+ Инструкции агенту:
159
118
 
160
- - **Go to the `file:line:col`** it names that's the authoritative anchor (injected in dev, React-19 safe).
161
- - **Edit the existing styling mechanism** it identifies (`tailwind` / `css-modules` / `styled-components` /
162
- `inline` / `plain-css`) not inline styles, and don't duplicate the component.
163
- - **Respect the breakpoint scope**emit the responsive variant (`lg:…`), don't make it global.
164
- - **Respect the target** — `All N like this` means edit the shared component/class so every instance updates;
165
- `new class` means create it and leave existing classes untouched; a positional `nth-of-type` selector is a
166
- last-resort locator, never the thing to hard-code against.
119
+ - Иди по `file:line:col`главный якорь.
120
+ - Правь существующий механизм стилей (`tailwind` / `css-modules` / `styled-components` / `inline`) — не добавляй inline и не дублируй компонент.
121
+ - Отдавай responsive-вариант под нужный брейкпоинт.
122
+ - `All N like this`правь общий компонент/класс, не `nth-child`.
167
123
 
168
124
  ---
169
125
 
170
- ## How it works
126
+ ## Как это устроено
171
127
 
172
- - **Source mapping** — a tiny dev-only Babel pass tags host JSX with `data-uiv-src="file:line:col"`
173
- (Vite plugin runs it `enforce: 'pre'`; Next runs it as a webpack pre-loader, keeping SWC).
174
- - **Identity, layered** file:line component name (from the file) `data-testid` / id / stable selector / text.
175
- - **Mechanism + tokens** detects how the element is styled and reverse-maps px to Tailwind tokens
176
- (`24px p-6`, `leading-normal`, `tracking-tight`), with arbitrary-value fallback.
177
- - **Breakpoints** — detected from the `@media` rules in your CSS, so the bar shows *your* breakpoints.
178
- - **Responsive preview** — the app is loaded in a resizable iframe so real media queries reflow; the inspector
179
- operates inside it.
128
+ - **Source mapping** — dev-only Babel/loader вешает `data-uiv-src="file:line:col"` на host-JSX. Vite — плагином `enforce: 'pre'`, Next — webpack pre-loader и `turbopack.rules` (SWC сохраняется).
129
+ - **Идентичность** file:line имя компонента `data-testid` / id / селектор / текст.
130
+ - **Токены**маппит px в Tailwind-токены (`24px p-6`, `leading-normal`); arbitrary-значения как фолбэк.
131
+ - **Брейкпоинты**детектятся из `@media`-правил твоего CSS.
132
+ - **Responsive-превью** приложение в ресайзимом iframe, медиа-запросы работают по-настоящему.
180
133
 
181
- ## Limitations
134
+ ## Ограничения
182
135
 
183
- - **Dev builds only** production strips source info and mangles classes.
184
- - **React-first**the DOM/CSS/breakpoint core is framework-agnostic; only source mapping is React-specific today.
185
- - **Tailwind-tuned tokens** non-Tailwind stacks get raw px + selector guidance (the prompt says which
186
- CSS-module / styled rule to edit).
136
+ - Только dev-сборкипрод вырезает source-инфо.
137
+ - Source mapping React. DOM/CSS/брейкпоинты фреймворк-агностично.
138
+ - Tailwind — px→токены. Другие стеки сырые px + указание на CSS-правило.
187
139
 
188
- ## Develop
140
+ ## Разработка
189
141
 
190
142
  ```bash
191
143
  npm install
192
- npm run build # tsup → dist/{vite,babel,overlay,next}
193
- npm test # vitest (pure logic + babel transform)
194
- npm run demo # Vite + React playground on :5180
195
- # demo-next/ # Next.js (app router) playground on :5181
144
+ npm run build # tsup → dist/{vite,babel,overlay,next}
145
+ npm test # vitest
146
+ npm run demo # Vite + React на :5180
196
147
  ```
197
148
 
198
149
  <div align="center"><sub>MIT · dev-only · prompt-only</sub></div>
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
8
  var __export = (target, all) => {
12
9
  for (var name in all)
13
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -30,349 +27,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
27
  ));
31
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
29
 
33
- // node_modules/next/package.json
34
- var require_package = __commonJS({
35
- "node_modules/next/package.json"(exports2, module2) {
36
- module2.exports = {
37
- name: "next",
38
- version: "14.2.15",
39
- description: "The React Framework",
40
- main: "./dist/server/next.js",
41
- license: "MIT",
42
- repository: "vercel/next.js",
43
- bugs: "https://github.com/vercel/next.js/issues",
44
- homepage: "https://nextjs.org",
45
- types: "index.d.ts",
46
- files: [
47
- "dist",
48
- "app.js",
49
- "app.d.ts",
50
- "babel.js",
51
- "babel.d.ts",
52
- "client.js",
53
- "client.d.ts",
54
- "compat",
55
- "cache.js",
56
- "cache.d.ts",
57
- "config.js",
58
- "config.d.ts",
59
- "constants.js",
60
- "constants.d.ts",
61
- "document.js",
62
- "document.d.ts",
63
- "dynamic.js",
64
- "dynamic.d.ts",
65
- "error.js",
66
- "error.d.ts",
67
- "future",
68
- "legacy",
69
- "script.js",
70
- "script.d.ts",
71
- "server.js",
72
- "server.d.ts",
73
- "head.js",
74
- "head.d.ts",
75
- "image.js",
76
- "image.d.ts",
77
- "link.js",
78
- "link.d.ts",
79
- "router.js",
80
- "router.d.ts",
81
- "jest.js",
82
- "jest.d.ts",
83
- "amp.js",
84
- "amp.d.ts",
85
- "og.js",
86
- "og.d.ts",
87
- "index.d.ts",
88
- "types/index.d.ts",
89
- "types/global.d.ts",
90
- "types/compiled.d.ts",
91
- "image-types/global.d.ts",
92
- "navigation-types/navigation.d.ts",
93
- "navigation-types/compat/navigation.d.ts",
94
- "font",
95
- "navigation.js",
96
- "navigation.d.ts",
97
- "headers.js",
98
- "headers.d.ts",
99
- "navigation-types",
100
- "web-vitals.js",
101
- "web-vitals.d.ts",
102
- "experimental/testmode/playwright.js",
103
- "experimental/testmode/playwright.d.ts",
104
- "experimental/testmode/playwright/msw.js",
105
- "experimental/testmode/playwright/msw.d.ts",
106
- "experimental/testmode/proxy.js",
107
- "experimental/testmode/proxy.d.ts"
108
- ],
109
- bin: {
110
- next: "./dist/bin/next"
111
- },
112
- scripts: {
113
- dev: "taskr",
114
- release: "taskr release",
115
- build: "pnpm release",
116
- prepublishOnly: "cd ../../ && turbo run build",
117
- types: "tsc --declaration --emitDeclarationOnly --stripInternal --declarationDir dist",
118
- typescript: "tsec --noEmit",
119
- "ncc-compiled": "ncc cache clean && taskr ncc"
120
- },
121
- taskr: {
122
- requires: [
123
- "./taskfile-webpack.js",
124
- "./taskfile-ncc.js",
125
- "./taskfile-swc.js",
126
- "./taskfile-watch.js"
127
- ]
128
- },
129
- dependencies: {
130
- "@next/env": "14.2.15",
131
- "@swc/helpers": "0.5.5",
132
- busboy: "1.6.0",
133
- "caniuse-lite": "^1.0.30001579",
134
- "graceful-fs": "^4.2.11",
135
- postcss: "8.4.31",
136
- "styled-jsx": "5.1.1"
137
- },
138
- peerDependencies: {
139
- "@opentelemetry/api": "^1.1.0",
140
- "@playwright/test": "^1.41.2",
141
- react: "^18.2.0",
142
- "react-dom": "^18.2.0",
143
- sass: "^1.3.0"
144
- },
145
- peerDependenciesMeta: {
146
- sass: {
147
- optional: true
148
- },
149
- "@opentelemetry/api": {
150
- optional: true
151
- },
152
- "@playwright/test": {
153
- optional: true
154
- }
155
- },
156
- devDependencies: {
157
- "@ampproject/toolbox-optimizer": "2.8.3",
158
- "@babel/code-frame": "7.22.5",
159
- "@babel/core": "7.22.5",
160
- "@babel/eslint-parser": "7.22.5",
161
- "@babel/generator": "7.22.5",
162
- "@babel/plugin-proposal-class-properties": "7.18.6",
163
- "@babel/plugin-proposal-export-namespace-from": "7.18.9",
164
- "@babel/plugin-proposal-numeric-separator": "7.18.6",
165
- "@babel/plugin-proposal-object-rest-spread": "7.20.7",
166
- "@babel/plugin-syntax-bigint": "7.8.3",
167
- "@babel/plugin-syntax-dynamic-import": "7.8.3",
168
- "@babel/plugin-syntax-import-assertions": "7.22.5",
169
- "@babel/plugin-syntax-jsx": "7.22.5",
170
- "@babel/plugin-transform-modules-commonjs": "7.22.5",
171
- "@babel/plugin-transform-runtime": "7.22.5",
172
- "@babel/preset-env": "7.22.5",
173
- "@babel/preset-react": "7.22.5",
174
- "@babel/preset-typescript": "7.22.5",
175
- "@babel/runtime": "7.22.5",
176
- "@babel/traverse": "7.22.5",
177
- "@babel/types": "7.22.5",
178
- "@capsizecss/metrics": "2.2.0",
179
- "@edge-runtime/cookies": "5.0.0",
180
- "@edge-runtime/ponyfill": "3.0.0",
181
- "@edge-runtime/primitives": "5.0.0",
182
- "@hapi/accept": "5.0.2",
183
- "@jest/transform": "29.5.0",
184
- "@jest/types": "29.5.0",
185
- "@mswjs/interceptors": "0.23.0",
186
- "@napi-rs/triples": "1.2.0",
187
- "@next/polyfill-module": "14.2.15",
188
- "@next/polyfill-nomodule": "14.2.15",
189
- "@next/react-refresh-utils": "14.2.15",
190
- "@next/swc": "14.2.15",
191
- "@opentelemetry/api": "1.6.0",
192
- "@playwright/test": "1.41.2",
193
- "@taskr/clear": "1.1.0",
194
- "@taskr/esnext": "1.1.0",
195
- "@types/amphtml-validator": "1.0.0",
196
- "@types/babel__code-frame": "7.0.2",
197
- "@types/babel__core": "7.1.12",
198
- "@types/babel__generator": "7.6.2",
199
- "@types/babel__template": "7.4.0",
200
- "@types/babel__traverse": "7.11.0",
201
- "@types/bytes": "3.1.1",
202
- "@types/ci-info": "2.0.0",
203
- "@types/compression": "0.0.36",
204
- "@types/content-disposition": "0.5.4",
205
- "@types/content-type": "1.1.3",
206
- "@types/cookie": "0.3.3",
207
- "@types/cross-spawn": "6.0.0",
208
- "@types/debug": "4.1.5",
209
- "@types/express-serve-static-core": "4.17.33",
210
- "@types/fresh": "0.5.0",
211
- "@types/glob": "7.1.1",
212
- "@types/graceful-fs": "4.1.9",
213
- "@types/jsonwebtoken": "9.0.0",
214
- "@types/lodash": "4.14.198",
215
- "@types/lodash.curry": "4.1.6",
216
- "@types/lru-cache": "5.1.0",
217
- "@types/path-to-regexp": "1.7.0",
218
- "@types/picomatch": "2.3.3",
219
- "@types/platform": "1.3.4",
220
- "@types/react": "18.2.37",
221
- "@types/react-dom": "18.2.15",
222
- "@types/react-is": "17.0.3",
223
- "@types/semver": "7.3.1",
224
- "@types/send": "0.14.4",
225
- "@types/shell-quote": "1.7.1",
226
- "@types/tar": "6.1.5",
227
- "@types/text-table": "0.2.1",
228
- "@types/ua-parser-js": "0.7.36",
229
- "@types/uuid": "8.3.1",
230
- "@types/webpack-sources1": "npm:@types/webpack-sources@0.1.5",
231
- "@types/ws": "8.2.0",
232
- "@vercel/ncc": "0.34.0",
233
- "@vercel/nft": "0.26.4",
234
- "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240417.2",
235
- acorn: "8.11.3",
236
- "amphtml-validator": "1.0.35",
237
- anser: "1.4.9",
238
- arg: "4.1.0",
239
- assert: "2.0.0",
240
- "async-retry": "1.2.3",
241
- "async-sema": "3.0.0",
242
- "babel-plugin-transform-define": "2.0.0",
243
- "babel-plugin-transform-react-remove-prop-types": "0.4.24",
244
- "browserify-zlib": "0.2.0",
245
- browserslist: "4.22.2",
246
- buffer: "5.6.0",
247
- bytes: "3.1.1",
248
- "ci-info": "watson/ci-info#f43f6a1cefff47fb361c88cf4b943fdbcaafe540",
249
- "cli-select": "1.1.2",
250
- "client-only": "0.0.1",
251
- commander: "12.0.0",
252
- "comment-json": "3.0.3",
253
- compression: "1.7.4",
254
- conf: "5.0.0",
255
- "constants-browserify": "1.0.0",
256
- "content-disposition": "0.5.3",
257
- "content-type": "1.0.4",
258
- cookie: "0.4.1",
259
- "cross-spawn": "7.0.3",
260
- "crypto-browserify": "3.12.0",
261
- "css.escape": "1.5.1",
262
- "cssnano-preset-default": "5.2.14",
263
- "data-uri-to-buffer": "3.0.1",
264
- debug: "4.1.1",
265
- devalue: "2.0.1",
266
- "domain-browser": "4.19.0",
267
- "edge-runtime": "3.0.0",
268
- events: "3.3.0",
269
- "find-up": "4.1.0",
270
- fresh: "0.5.2",
271
- "get-orientation": "1.1.2",
272
- glob: "7.1.7",
273
- "gzip-size": "5.1.1",
274
- "http-proxy": "1.18.1",
275
- "http-proxy-agent": "5.0.0",
276
- "https-browserify": "1.0.0",
277
- "https-proxy-agent": "5.0.1",
278
- "icss-utils": "5.1.0",
279
- "ignore-loader": "0.1.2",
280
- "image-size": "1.0.0",
281
- "is-docker": "2.0.0",
282
- "is-wsl": "2.2.0",
283
- "jest-worker": "27.5.1",
284
- json5: "2.2.3",
285
- jsonwebtoken: "9.0.0",
286
- "loader-runner": "4.3.0",
287
- "loader-utils2": "npm:loader-utils@2.0.0",
288
- "loader-utils3": "npm:loader-utils@3.1.3",
289
- "lodash.curry": "4.1.1",
290
- "lru-cache": "5.1.1",
291
- "mini-css-extract-plugin": "2.4.4",
292
- msw: "1.3.0",
293
- nanoid: "3.1.32",
294
- "native-url": "0.3.4",
295
- "neo-async": "2.6.1",
296
- "node-html-parser": "5.3.3",
297
- ora: "4.0.4",
298
- "os-browserify": "0.3.0",
299
- "p-limit": "3.1.0",
300
- "path-browserify": "1.0.1",
301
- "path-to-regexp": "6.1.0",
302
- picomatch: "4.0.1",
303
- platform: "1.3.6",
304
- "postcss-flexbugs-fixes": "5.0.2",
305
- "postcss-modules-extract-imports": "3.0.0",
306
- "postcss-modules-local-by-default": "4.0.4",
307
- "postcss-modules-scope": "3.0.0",
308
- "postcss-modules-values": "4.0.0",
309
- "postcss-preset-env": "7.4.3",
310
- "postcss-safe-parser": "6.0.0",
311
- "postcss-scss": "4.0.3",
312
- "postcss-value-parser": "4.2.0",
313
- process: "0.11.10",
314
- punycode: "2.1.1",
315
- "querystring-es3": "0.2.1",
316
- "raw-body": "2.4.1",
317
- "react-is": "18.2.0",
318
- "react-refresh": "0.12.0",
319
- "regenerator-runtime": "0.13.4",
320
- "sass-loader": "12.4.0",
321
- "schema-utils2": "npm:schema-utils@2.7.1",
322
- "schema-utils3": "npm:schema-utils@3.0.0",
323
- semver: "7.3.2",
324
- send: "0.17.1",
325
- "server-only": "0.0.1",
326
- setimmediate: "1.0.5",
327
- "shell-quote": "1.7.3",
328
- "source-map": "0.6.1",
329
- "source-map08": "npm:source-map@0.8.0-beta.0",
330
- "stacktrace-parser": "0.1.10",
331
- "stream-browserify": "3.0.0",
332
- "stream-http": "3.1.1",
333
- "strict-event-emitter": "0.5.0",
334
- "string-hash": "1.1.3",
335
- string_decoder: "1.3.0",
336
- "strip-ansi": "6.0.0",
337
- superstruct: "1.0.3",
338
- tar: "6.1.15",
339
- taskr: "1.1.0",
340
- terser: "5.27.0",
341
- "terser-webpack-plugin": "5.3.9",
342
- "text-table": "0.2.0",
343
- "timers-browserify": "2.0.12",
344
- "tty-browserify": "0.0.1",
345
- "ua-parser-js": "1.0.35",
346
- unistore: "3.4.1",
347
- util: "0.12.4",
348
- uuid: "8.3.2",
349
- "vm-browserify": "1.1.2",
350
- watchpack: "2.4.0",
351
- "web-vitals": "3.0.0",
352
- webpack: "5.90.0",
353
- "webpack-sources1": "npm:webpack-sources@1.4.3",
354
- "webpack-sources3": "npm:webpack-sources@3.2.3",
355
- ws: "8.2.3",
356
- zod: "3.22.3"
357
- },
358
- engines: {
359
- node: ">=18.17.0"
360
- },
361
- optionalDependencies: {
362
- "@next/swc-darwin-arm64": "14.2.15",
363
- "@next/swc-darwin-x64": "14.2.15",
364
- "@next/swc-linux-arm64-gnu": "14.2.15",
365
- "@next/swc-linux-arm64-musl": "14.2.15",
366
- "@next/swc-linux-x64-gnu": "14.2.15",
367
- "@next/swc-linux-x64-musl": "14.2.15",
368
- "@next/swc-win32-arm64-msvc": "14.2.15",
369
- "@next/swc-win32-ia32-msvc": "14.2.15",
370
- "@next/swc-win32-x64-msvc": "14.2.15"
371
- }
372
- };
373
- }
374
- });
375
-
376
30
  // src/next/index.ts
377
31
  var next_exports = {};
378
32
  __export(next_exports, {
@@ -381,11 +35,13 @@ __export(next_exports, {
381
35
  });
382
36
  module.exports = __toCommonJS(next_exports);
383
37
  var path = __toESM(require("path"), 1);
38
+ var import_node_module = require("module");
384
39
  var isProd = () => process.env.NODE_ENV === "production";
385
40
  var isTurbopack = () => !!process.env.TURBOPACK || !!process.env.TURBOPACK_DEV;
386
41
  function nextMajor() {
387
42
  try {
388
- return parseInt(require_package().version, 10) || 0;
43
+ const req = (0, import_node_module.createRequire)(path.join(process.cwd(), "package.json"));
44
+ return parseInt(req("next/package.json").version, 10) || 0;
389
45
  } catch {
390
46
  return 0;
391
47
  }
@@ -3,7 +3,7 @@ interface WebpackContext {
3
3
  isServer: boolean;
4
4
  }
5
5
  type NextConfig = {
6
- webpack?: (config: any, ctx: WebpackContext) => any;
6
+ webpack?: ((config: any, ctx: WebpackContext) => any) | null;
7
7
  turbopack?: any;
8
8
  [key: string]: unknown;
9
9
  };
@@ -3,7 +3,7 @@ interface WebpackContext {
3
3
  isServer: boolean;
4
4
  }
5
5
  type NextConfig = {
6
- webpack?: (config: any, ctx: WebpackContext) => any;
6
+ webpack?: ((config: any, ctx: WebpackContext) => any) | null;
7
7
  turbopack?: any;
8
8
  [key: string]: unknown;
9
9
  };