From 29d676385abf370314ba7014caa59fcd6099eba8 Mon Sep 17 00:00:00 2001 From: Barbara Honhoff Date: Wed, 12 Apr 2023 13:25:23 +0200 Subject: [PATCH] Make gts work with workspaces I noticed that gts fix and gts link wasn't working in the npm workspaces. This is related to the issues: gts monorepo does not work with npm ? google/gts#752 gts does not work in a yarn workspaces monorepo google/gts#490 The last issue is with yarn but has more discussion. One solution was using nohoist. This is not a default option with npm. So I tried with the following package https://github.com/zgriesinger/noist. But this did not fix the errors. The last solution mentioned was only linting from the root level; this works. I have also subscribed to the issue [feature] support npm workspaces. There may be a better solution in the future. --- apps/dataset-browser/package.json | 2 -- package-lock.json | 60 ------------------------------- package.json | 3 +- packages/ui/.eslintrc.js | 8 +++++ 4 files changed, 10 insertions(+), 63 deletions(-) diff --git a/apps/dataset-browser/package.json b/apps/dataset-browser/package.json index 46d3be5..de86669 100644 --- a/apps/dataset-browser/package.json +++ b/apps/dataset-browser/package.json @@ -10,8 +10,6 @@ "build": "next build", "compile": "tsc", "dev": "next dev", - "fix": "gts fix", - "lint": "gts lint", "start": "next start", "test": "jest --passWithNoTests --testPathIgnorePatterns '/src/.*/*.integration.test.ts'", "test:ci": "npm test -- --ci", diff --git a/package-lock.json b/package-lock.json index de92e96..f974e31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11462,66 +11462,6 @@ "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } - }, - "packages/ui/node_modules/@next/swc-android-arm-eabi": { - "version": "13.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.2.4.tgz", - "integrity": "sha512-DWlalTSkLjDU11MY11jg17O1gGQzpRccM9Oes2yTqj2DpHndajrXHGxj9HGtJ+idq2k7ImUdJVWS2h2l/EDJOw==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - "packages/ui/node_modules/@next/swc-android-arm64": { - "version": "13.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-13.2.4.tgz", - "integrity": "sha512-sRavmUImUCf332Gy+PjIfLkMhiRX1Ez4SI+3vFDRs1N5eXp+uNzjFUK/oLMMOzk6KFSkbiK/3Wt8+dHQR/flNg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - "packages/ui/node_modules/@next/swc-freebsd-x64": { - "version": "13.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.2.4.tgz", - "integrity": "sha512-kkbzKVZGPaXRBPisoAQkh3xh22r+TD+5HwoC5bOkALraJ0dsOQgSMAvzMXKsN3tMzJUPS0tjtRf1cTzrQ0I5vQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10" - } - }, - "packages/ui/node_modules/@next/swc-linux-arm-gnueabihf": { - "version": "13.2.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.2.4.tgz", - "integrity": "sha512-7qA1++UY0fjprqtjBZaOA6cas/7GekpjVsZn/0uHvquuITFCdKGFCsKNBx3S0Rpxmx6WYo0GcmhNRM9ru08BGg==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } } }, "dependencies": { diff --git a/package.json b/package.json index 21a0632..d579b5a 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "scripts": { "build": "turbo run build", "dev": "turbo run dev", - "lint": "turbo run lint", + "fix": "gts fix", + "lint": "gts lint", "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "devDependencies": { diff --git a/packages/ui/.eslintrc.js b/packages/ui/.eslintrc.js index 03ee743..98dc7b2 100644 --- a/packages/ui/.eslintrc.js +++ b/packages/ui/.eslintrc.js @@ -1,4 +1,12 @@ module.exports = { root: true, extends: ['custom'], + rules: { + 'node/no-unpublished-require': [ + 'error', + { + allowModules: ['tailwind-config'], + }, + ], + }, };