@mittwald/flow-react-components 1.2.0-next.53 → 1.2.0-next.54
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/MIGRATION.md
CHANGED
|
@@ -1170,6 +1170,21 @@ import { Field } from "@mittwald/flow-react-components/react-hook-form";
|
|
|
1170
1170
|
import { Link } from "@mittwald/flow-react-components/nextjs";
|
|
1171
1171
|
```
|
|
1172
1172
|
|
|
1173
|
+
### Stylesheets stay stylesheet imports
|
|
1174
|
+
|
|
1175
|
+
A CSS export is a file, not a JS module, so it never moves onto the package
|
|
1176
|
+
root. A bundler query addressing it (`?url`, `?inline`, `?raw`) is part of how
|
|
1177
|
+
the file is requested, not part of the subpath — both of these stay exactly as
|
|
1178
|
+
they are:
|
|
1179
|
+
|
|
1180
|
+
```javascript
|
|
1181
|
+
import "@mittwald/flow-react-components/all.css";
|
|
1182
|
+
import flowStyles from "@mittwald/flow-react-components/all.css?url";
|
|
1183
|
+
```
|
|
1184
|
+
|
|
1185
|
+
Only a stale `global.css` or `globals.css` is rewritten to `all.css`, query
|
|
1186
|
+
included.
|
|
1187
|
+
|
|
1173
1188
|
### `tsconfig.json`
|
|
1174
1189
|
|
|
1175
1190
|
Set `"module": "esnext"` in your `tsconfig.json`, if you have trouble with
|
|
@@ -1194,8 +1209,13 @@ and the first stable release of Flow is `1.0.0`.
|
|
|
1194
1209
|
**Apply:** Rewrite every subdirectory import from
|
|
1195
1210
|
`@mittwald/flow-react-components` to the package root, except `react-hook-form`
|
|
1196
1211
|
and `nextjs`, which move to `@mittwald/flow-react-components/react-hook-form`
|
|
1197
|
-
and `@mittwald/flow-react-components/nextjs`.
|
|
1198
|
-
|
|
1212
|
+
and `@mittwald/flow-react-components/nextjs`. Asset imports are not part of
|
|
1213
|
+
this: a CSS specifier stays a CSS specifier — `all.css` and `all-layered.css`
|
|
1214
|
+
unchanged, a stale `global.css` or `globals.css` rewritten to `all.css` — and
|
|
1215
|
+
keeps any bundler query it carries (`?url`, `?inline`, `?raw`). It never becomes
|
|
1216
|
+
a named import from the package root, which has no JS binding behind a
|
|
1217
|
+
stylesheet. If you hit missing module errors, set `"module": "esnext"` in
|
|
1218
|
+
`tsconfig.json`.
|
|
1199
1219
|
|
|
1200
1220
|
```shell
|
|
1201
1221
|
npx @mittwald/flow-codemods@latest imports-to-package-root src
|
|
@@ -1225,9 +1245,10 @@ names a module. It cannot reach a `.css` or `.scss` file, so an `@import` of the
|
|
|
1225
1245
|
old path there needs a manual search.
|
|
1226
1246
|
|
|
1227
1247
|
**Apply:** Replace the import `@mittwald/flow-react-components/styles` with
|
|
1228
|
-
`@mittwald/flow-react-components/all.css
|
|
1229
|
-
|
|
1230
|
-
|
|
1248
|
+
`@mittwald/flow-react-components/all.css`, keeping any bundler query the
|
|
1249
|
+
specifier carries (`.../styles?url` becomes `.../all.css?url`). A codemod does
|
|
1250
|
+
this for JavaScript and TypeScript files. An `@import` of the old path inside a
|
|
1251
|
+
`.css` or `.scss` file is not covered — search for it by hand.
|
|
1231
1252
|
|
|
1232
1253
|
```shell
|
|
1233
1254
|
npx @mittwald/flow-codemods@latest renamed-css-export src
|