From 77577f7961ec6ea2f8a0969c725df314b9470b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Sat, 1 Oct 2022 15:34:55 +0200 Subject: [PATCH] chore(examples): update `with-linaria` (#41085) Lands #39289 with code suggestions to comply with our [example guideliens](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) closes #39289 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) Co-authored-by: Patrik Szewczyk --- examples/cms-sitefinity/next-env.d.ts | 5 +++++ examples/with-linaria/.babelrc | 7 +++++-- examples/with-linaria/package.json | 12 ++++++----- .../with-linaria/pages/{index.js => index.ts} | 4 ++-- examples/with-linaria/tsconfig.json | 20 +++++++++++++++++++ 5 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 examples/cms-sitefinity/next-env.d.ts rename examples/with-linaria/pages/{index.js => index.ts} (87%) create mode 100644 examples/with-linaria/tsconfig.json diff --git a/examples/cms-sitefinity/next-env.d.ts b/examples/cms-sitefinity/next-env.d.ts new file mode 100644 index 0000000000000..4f11a03dc6cc3 --- /dev/null +++ b/examples/cms-sitefinity/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/examples/with-linaria/.babelrc b/examples/with-linaria/.babelrc index 2a7aa6993b2cd..aac54e4fe17ee 100644 --- a/examples/with-linaria/.babelrc +++ b/examples/with-linaria/.babelrc @@ -1,3 +1,6 @@ { - "presets": ["next/babel", "linaria/babel"] -} + "presets": [ + "next/babel", + "@linaria" + ] +} \ No newline at end of file diff --git a/examples/with-linaria/package.json b/examples/with-linaria/package.json index 51843d8c9f253..9b64d59acf754 100644 --- a/examples/with-linaria/package.json +++ b/examples/with-linaria/package.json @@ -6,13 +6,15 @@ "start": "next start" }, "dependencies": { - "linaria": "^2.1.0", + "@linaria/core": "^4.1.2", + "@linaria/react": "^4.1.4", "next": "latest", - "next-linaria": "^0.11.0", - "react": "^17.0.2", - "react-dom": "^17.0.2" + "next-linaria": "^1.0.1-beta", + "react": "^18.2.0", + "react-dom": "^18.2.0" }, "devDependencies": { - "@babel/core": "^7.13.10" + "@linaria/babel-preset": "^4.2.1", + "@linaria/webpack-loader": "^4.1.4" } } diff --git a/examples/with-linaria/pages/index.js b/examples/with-linaria/pages/index.ts similarity index 87% rename from examples/with-linaria/pages/index.js rename to examples/with-linaria/pages/index.ts index 362505ea0ad2d..3351e959a7fbd 100644 --- a/examples/with-linaria/pages/index.js +++ b/examples/with-linaria/pages/index.ts @@ -1,6 +1,6 @@ import Head from 'next/head' -import { styled } from 'linaria/react' -import { css } from 'linaria' +import { styled } from '@linaria/react' +import { css } from '@linaria/core' const Box = styled.div` margin-top: 40px; diff --git a/examples/with-linaria/tsconfig.json b/examples/with-linaria/tsconfig.json new file mode 100644 index 0000000000000..1563f3e878573 --- /dev/null +++ b/examples/with-linaria/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": false, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "incremental": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve" + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] +}