Commit graph

10 commits

Author SHA1 Message Date
Jiachi Liu
f83cc0cbed
Enabel appDir when flag and dir existed at the same time (#41233)
If there's an existing folder named `app/` but `appDir` flag is not
enabled, do not enabled server components
2022-10-07 00:16:42 +02:00
Jiachi Liu
5f2e44d451
Refactor app dir related flags (#41166)
simplify the `appDir` passing down
2022-10-04 22:16:44 +00:00
Tim Neutkens
5b9ad8da90
Move next-server directory files to server directory (#26756)
* Move next-server directory files to server directory

* Update tests

* Update paths in other places
2021-06-30 13:44:40 +02:00
Eric Burel
796c021278
Fix rewrite shape in Storybook (#24827)
This fixes a bug in `@next/plugin-storybook` caused by an update in the rewrite structure, solution was provided by @stefanprobst https://github.com/vercel/next.js/issues/19345#issuecomment-818856655

Secondary question: it would be awesome if someone at Next could help translating `preset.js` into TypeScript, this would catch those bugs immediately. I've tried in https://github.com/vercel/next.js/pull/18367 but failed to build correctly.

## Bug

- [X] Related issues linked using `fixes #number` => parent issue is an umbrella of various small issues: https://github.com/vercel/next.js/issues/19345
- [X] Integration tests added => reproduction is implemented in https://github.com/lbke/next-plugin-storybook-demo until the package is more stable
2021-05-06 17:04:22 +00:00
stefanprobst
3a2cd0e0d2
fix(next-storybook): make rules an array in webpack config (#22125)
the `next-storybook` plugin throws an error since version `10.0.6-canary.9`, specifically since #17306:

```
ERR! WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
ERR!  - configuration.module.rules should be an array
```

this PR makes `module.rules` an array again.

also see https://github.com/vercel/next.js/pull/17306#issuecomment-774996237
2021-05-05 02:45:38 +00:00
Jaon
e1fe28c849
Fix and add test filterModuleRules for next-plugin-storybook (#17306)
I tried the preset provided at `packages/next-plugin-storybook` but it was raising error due to an [unsafe negation](https://eslint.org/docs/rules/no-unsafe-negation) in the `preset.js` file.

I added a test to show the error:
```
● next-plugin-storybook filterModuleRules › should filter module rules correctly

    TypeError: rule.test.test is not a function

      48 |       if (!rule.test instanceof RegExp) return true
      49 |       // use Next.js' built-in CSS
    > 50 |       if (rule.test.test('hello.css')) {
         |                     ^
      51 |         return false
      52 |       }
      53 |       // use next-babel-loader instead of storybook's babel-loader

      at filter (../packages/next-plugin-storybook/preset.js:50:21)
          at Array.filter (<anonymous>)
      at Object.filterModuleRules (../packages/next-plugin-storybook/preset.js:46:28)
      at Object.<anonymous> (unit/webpack-config-overrides.test.js:12:36)
```
2021-01-26 19:28:41 +00:00
François Billioud
9efe8eb019
Fix "rule.test.test is not a function" in @next/plugin-storybook (#21032)
Rookie mistake 😉
2021-01-14 03:14:57 +00:00
Eric Burel
b87b2d46ea
add rewrites in storybook preset (#18364) 2020-11-03 09:50:59 -05:00
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
JJ Kasper
7be3b10148
Add experimental Storybook preset (#12934) 2020-05-15 22:00:23 -04:00