From 44d4ba41a45ecf7746f535f3ee34588fb066f8b9 Mon Sep 17 00:00:00 2001 From: Nicolas Merget <104347736+nmerget@users.noreply.github.com> Date: Wed, 25 Jan 2023 11:18:22 +0100 Subject: [PATCH] fix: issues with react-components and unused next output (#255) --- output/react/package.json | 3 +-- .../components/scripts/post-build/index.js | 2 -- .../components/scripts/post-build/next.js | 19 ------------------- showcases/next-showcase/package.json | 2 +- 4 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 packages/components/scripts/post-build/next.js diff --git a/output/react/package.json b/output/react/package.json index 00ab15717c9..4bc99674d01 100644 --- a/output/react/package.json +++ b/output/react/package.json @@ -10,8 +10,7 @@ "sideEffects": false, "scripts": { "tsc": "tsc -p . --sourceMap false", - "copy:sass": "cpr src dist -o -f \"(.ts|.tsx)$\"", - "build": "npm-run-all tsc copy:sass", + "build": "npm-run-all tsc", "mv:dist": "cpr dist ../../build-outputs/react/dist -o", "mv:package.json": "cpr package.json ../../build-outputs/react/package.json -o", "mv:readme": "cpr README.md ../../build-outputs/react/README.md -o", diff --git a/packages/components/scripts/post-build/index.js b/packages/components/scripts/post-build/index.js index 1cca59f22c2..a1965845498 100644 --- a/packages/components/scripts/post-build/index.js +++ b/packages/components/scripts/post-build/index.js @@ -1,7 +1,6 @@ const Vue = require('./vue'); const WebComponents = require('./wc'); const Angular = require('./angular'); -const Next = require('./next'); const React = require('./react'); const PowerApps = require('./power-apps'); const Svelte = require('./svelte'); @@ -11,7 +10,6 @@ const CopyFiles = require('./copy-files'); Vue(); Svelte(); Angular(); -Next(); React(); WebComponents(); diff --git a/packages/components/scripts/post-build/next.js b/packages/components/scripts/post-build/next.js deleted file mode 100644 index c35d018b681..00000000000 --- a/packages/components/scripts/post-build/next.js +++ /dev/null @@ -1,19 +0,0 @@ -const Fse = require('fs-extra'); -const Components = require('./components'); - -module.exports = () => { - for (const component of Components) { - try { - const files = [`${component.name}.tsx`, 'model.ts', 'index.ts']; - - for (const file of files) { - Fse.copySync( - `../../output/react/src/components/${component.name}/${file}`, - `../../output/next/src/components/${component.name}/${file}` - ); - } - } catch (error) { - console.error('Error occurred:', error); - } - } -}; diff --git a/showcases/next-showcase/package.json b/showcases/next-showcase/package.json index b5caad97bd4..58ebb17f156 100644 --- a/showcases/next-showcase/package.json +++ b/showcases/next-showcase/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "copy:components": "cpr ../../packages/components/output/next/src/components ./components -o", + "copy:components": "cpr ../../packages/components/output/react/src/components ./components -o", "prebuild": "npm run copy:components", "predev": "npm run copy:components", "prestart": "npm run copy:components",