From cedfdf04bacd5b17f2ecf00ee33406ebe0236aa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oddbj=C3=B8rn=20=C3=98vernes?= Date: Wed, 11 Dec 2024 13:47:02 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BBadd=20'use=20c?= =?UTF-8?q?lient'=20to=20index=20for=20better=20nextjs=20support=20(#3703)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ā˛•rollup-preserve-directives * 'use client' added to index.ts * bump version for test release * restore version --- packages/eds-core-react/package.json | 1 + packages/eds-core-react/rollup.config.js | 2 ++ packages/eds-core-react/src/index.ts | 1 + pnpm-lock.yaml | 34 +++++++++++++++++------- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/packages/eds-core-react/package.json b/packages/eds-core-react/package.json index 233b8e8a0c..d3d502b5cf 100644 --- a/packages/eds-core-react/package.json +++ b/packages/eds-core-react/package.json @@ -75,6 +75,7 @@ "rollup": "^4.22.5", "rollup-plugin-delete": "^2.1.0", "rollup-plugin-postcss": "^4.0.2", + "rollup-preserve-directives": "^1.1.3", "storybook": "^8.3.4", "styled-components": "6.1.12", "tsc-watch": "^6.2.0", diff --git a/packages/eds-core-react/rollup.config.js b/packages/eds-core-react/rollup.config.js index b0de5ef1c3..d1e1b311c3 100644 --- a/packages/eds-core-react/rollup.config.js +++ b/packages/eds-core-react/rollup.config.js @@ -2,6 +2,7 @@ import resolve from '@rollup/plugin-node-resolve' import postcss from 'rollup-plugin-postcss' import commonjs from '@rollup/plugin-commonjs' +import { preserveDirective } from 'rollup-preserve-directives' import { babel } from '@rollup/plugin-babel' import del from 'rollup-plugin-delete' import pkg from './package.json' @@ -28,6 +29,7 @@ export default [ include: ['./src/**', './../tokens/**'], }, plugins: [ + preserveDirective(), del({ targets: 'dist/*', runOnce: true }), resolve({ extensions }), commonjs(), diff --git a/packages/eds-core-react/src/index.ts b/packages/eds-core-react/src/index.ts index 822895ff08..8146245d02 100644 --- a/packages/eds-core-react/src/index.ts +++ b/packages/eds-core-react/src/index.ts @@ -1,3 +1,4 @@ +'use client' /* eslint-disable import/prefer-default-export */ export * from './components/Button' export * from './components/Typography' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 40c239ecd3..1c5e56a397 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -225,6 +225,9 @@ importers: rollup-plugin-postcss: specifier: ^4.0.2 version: 4.0.2(postcss@8.4.41)(ts-node@10.9.2(@types/node@22.1.0)(typescript@5.5.4)) + rollup-preserve-directives: + specifier: ^1.1.3 + version: 1.1.3(rollup@4.22.5) storybook: specifier: ^8.3.4 version: 8.3.4 @@ -3626,7 +3629,7 @@ packages: resolution: {integrity: sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==} concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} concat-with-sourcemaps@1.1.0: resolution: {integrity: sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==} @@ -3643,7 +3646,7 @@ packages: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} cookie-signature@1.0.6: - resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} + resolution: {integrity: sha1-4wOogrNCzD7oylE6eZmXNNqzriw=} cookie@0.6.0: resolution: {integrity: sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==} @@ -3962,7 +3965,7 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} ee-first@1.1.1: - resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=} ejs@3.1.10: resolution: {integrity: sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==} @@ -4191,6 +4194,7 @@ packages: eslint@8.57.0: resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. hasBin: true espree@9.6.1: @@ -4233,7 +4237,7 @@ packages: engines: {node: '>= 0.6'} event-stream@3.3.4: - resolution: {integrity: sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g==} + resolution: {integrity: sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=} eventemitter3@4.0.7: resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} @@ -4566,7 +4570,7 @@ packages: engines: {node: '>=0.10.0'} icss-replace-symbols@1.1.0: - resolution: {integrity: sha512-chIaY3Vh2mh2Q3RGXttaDIzeiPvaVXJ+C4DAh/w3c37SKZ/U6PGMmuicR2EQQp9bKG8zLMCl7I+PtIoOOPp8Gg==} + resolution: {integrity: sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=} icss-utils@5.1.0: resolution: {integrity: sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==} @@ -5201,7 +5205,7 @@ packages: engines: {node: '>=10'} lodash.camelcase@4.3.0: - resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} + resolution: {integrity: sha1-soqmKIorn8ZRA1x3EfZathkDMaY=} lodash.debounce@4.0.8: resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==} @@ -5285,7 +5289,7 @@ packages: resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} media-typer@0.3.0: - resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} + resolution: {integrity: sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=} engines: {node: '>= 0.6'} memfs@4.11.1: @@ -5598,7 +5602,7 @@ packages: resolution: {integrity: sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==} pause-stream@0.0.11: - resolution: {integrity: sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==} + resolution: {integrity: sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=} picocolors@1.0.1: resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} @@ -6141,6 +6145,11 @@ packages: rollup-pluginutils@2.8.2: resolution: {integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==} + rollup-preserve-directives@1.1.3: + resolution: {integrity: sha512-oXqxd6ZzkoQej8Qt0k+S/yvO2+S4CEVEVv2g85oL15o0cjAKTKEuo2MzyA8FcsBBXbtytBzBMFAbhvQg4YyPUQ==} + peerDependencies: + rollup: ^2.0.0 || ^3.0.0 || ^4.0.0 + rollup@4.22.5: resolution: {integrity: sha512-WoinX7GeQOFMGznEcWA1WrTQCd/tpEbMkc3nuMs9BT0CPjMdSjPMTVClwWd4pgSQwJdP65SK9mTCNvItlr5o7w==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -6304,7 +6313,7 @@ packages: engines: {node: '>=0.6.19'} string-hash@1.1.3: - resolution: {integrity: sha512-kJUvRUFK49aub+a7T1nNE66EJbZBMnBgoC1UbCZ5n6bsZKBRga4KgBRTMn/pFkeCZSYtNeSyMxPDM0AXWELk2A==} + resolution: {integrity: sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs=} string-length@4.0.2: resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} @@ -6753,7 +6762,7 @@ packages: resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} utils-merge@1.0.1: - resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} + resolution: {integrity: sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=} engines: {node: '>= 0.4.0'} uuid@9.0.1: @@ -13896,6 +13905,11 @@ snapshots: dependencies: estree-walker: 0.6.1 + rollup-preserve-directives@1.1.3(rollup@4.22.5): + dependencies: + magic-string: 0.30.11 + rollup: 4.22.5 + rollup@4.22.5: dependencies: '@types/estree': 1.0.6