Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ui): remove deprecated exports #232

Merged
merged 7 commits into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/neat-waves-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gboost-ui": minor
---

Remove deprecated exports from `gboost-ui`. This release migrates from Amplify UI and Vite to Material UI and Next.js. See discussions: [Frontend Tooling / Framework](https://github.com/awslabs/green-boost/discussions/214) and [Switch UI Component Library](https://github.com/awslabs/green-boost/discussions/213) for more details. For users currently on `gboost-ui`, we understand this is a very large change, but we believe these new technologies will enable Green Boost developers to build faster with React. All UI components have equivalents within Material UI that we recommend you upgrade to. If you cannot upgrade to Material UI, we recommend you extract the last `gboost-ui` source code from [here](https://github.com/awslabs/green-boost/tree/320f3e00d0fde2d86b570408648de260a5a3e2fd) and use it in your application.
24 changes: 0 additions & 24 deletions .eslintrc.cjs

This file was deleted.

3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm lint-staged
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"usernamehw.errorlens"
]
}
24 changes: 4 additions & 20 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"eslint.options": {
"extensions": [".js", ".jsx", ".md", ".mdx", ".ts", ".tsx"]
},
"eslint.validate": [
"markdown",
"mdx",
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"eslint.workingDirectories": [
"./docs",
"./packages/gboost",
"./packages/gboost-infra",
"./packages/gboost-node",
"./packages/gboost-ui"
],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"eslint.useFlatConfig": true,
"files.associations": {
"*.css": "tailwindcss"
},
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.importModuleSpecifierEnding": "js",
"search.exclude": {
"**/node_modules": true,
"**/cdk.out": true,
Expand Down
30 changes: 0 additions & 30 deletions docs/.eslintrc.cjs

This file was deleted.

18 changes: 10 additions & 8 deletions docs/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { removeIgnoredFiles } from "../utils/lintStaged.js"

export default {
"*.ts?(x)": async (files) => {
const filesToLint = await removeIgnoredFiles(files);
// TODO: use setup here: https://nextjs.org/docs/pages/building-your-application/configuring/eslint#lint-staged
return [`next lint`, "tsc --noEmit"];
}
}
"*.ts?(x)": (files) => {
const joinedFiles = files.join(" ");
return [
`eslint --max-warnings=0 --no-warn-ignored ${joinedFiles}`,
`prettier --write ${joinedFiles}`,
`vitest related --run ${joinedFiles}`,
"tsc --noEmit",
];
},
};
32 changes: 14 additions & 18 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,27 @@
"scripts": {
"build": "next build",
"dev": "next dev",
"lint": "next lint",
"format": "prettier --write .",
"lint": "eslint --max-warnings=0 --no-warn-ignored src/**/*.{ts,tsx}",
"start": "next start",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"gboost-ui": "workspace:^",
"lucide-react": "^0.292.0",
"next": "14.0.3",
"nextra": "^2.13.2",
"nextra-theme-docs": "^2.13.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"lucide-react": "^0.411.0",
"next": "14.2.5",
"nextra": "^2.13.4",
"nextra-theme-docs": "^2.13.4",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@tsconfig/next": "^2.0.1",
"@tsconfig/strictest": "^2.0.2",
"@tsconfig/strictest": "^2.0.5",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"autoprefixer": "^10.4.16",
"eslint": "^8.53.0",
"eslint-define-config": "^2.0.0",
"eslint-plugin-mdx": "^2.2.0",
"eslint-plugin-react": "^7.33.2",
"postcss": "^8.4.31",
"tailwindcss": "^3.3.5",
"typescript": "^5.2.2"
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.39",
"tailwindcss": "^3.4.6"
}
}
}
67 changes: 67 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// @ts-check
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";
import eslint from "@eslint/js";
import tsEslint from "typescript-eslint";
import security from "eslint-plugin-security";
import { FlatCompat } from "@eslint/eslintrc";
import globals from "globals";
import * as mdx from "eslint-plugin-mdx";

const baseDirectory = dirname(fileURLToPath(import.meta.url));

const compat = new FlatCompat({
baseDirectory,
resolvePluginsRelativeTo: baseDirectory,
});

export default tsEslint.config(
{
ignores: [
"node_modules/**/*",
"dist/**/*",
"out/**/*",
"cdk.out/**/*",
".next/**/*",
"packages/gboost/templates/**/*",
],
languageOptions: {
globals: {
...globals.node,
},
},
},
eslint.configs.recommended,
{
...security.configs.recommended,
rules: {
...security.configs.recommended.rules,
"security/detect-object-injection": "off", // too many false positives
"security/detect-non-literal-fs-filename": "off", // too many false positives
},
},
...tsEslint.configs.recommended,
...compat.config({
overrides: [
{
files: ["packages/gboost-ui/**/*.{ts,tsx}", "docs/**/*.{ts,tsx}"],
extends: "next/core-web-vitals",
},
],
}),
// mdx for docs
{
...mdx.flat,
// optional, if you want to lint code blocks at the same
processor: mdx.createRemarkProcessor({
lintCodeBlocks: true,
}),
},
{
...mdx.flatCodeBlocks,
rules: {
...mdx.flatCodeBlocks.rules,
// if you want to override some rules for code blocks
},
},
);
58 changes: 25 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,39 @@
"type": "module",
"scripts": {
"build": "pnpm --recursive --filter \"./packages/**\" --parallel build",
"format": "pnpm --recursive --filter \"./packages/**\" --parallel format",
"lint": "pnpm --recursive --filter \"./packages/**\" --parallel lint",
"typecheck": "pnpm --recursive --filter \"./packages/**\" --parallel typecheck",
"test": "pnpm --recursive --filter \"./packages/**\" --parallel test",
"prepare": "husky install",
"prepare": "husky",
"changeset-version": "tsx scripts/changeset-version.ts",
"license-check": "tsx scripts/license-check.ts",
"preinstall": "npx only-allow pnpm"
},
"devDependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"@tsconfig/node18": "^18.2.2",
"@tsconfig/strictest": "^2.0.2",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.7",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^8.57.0",
"@tsconfig/next": "^2.0.1",
"@tsconfig/node18": "^18.2.4",
"@tsconfig/strictest": "^2.0.5",
"@types/license-checker": "^25.0.6",
"@types/node": "^20.9.1",
"husky": "^8.0.3",
"lint-staged": "^15.1.0",
"tsx": "^4.1.3",
"typescript": "^5.2.2"
"@types/node": "^20.14.11",
"eslint": "^8.57.0",
"eslint-config-next": "^14.2.5",
"eslint-plugin-mdx": "^3.1.5",
"eslint-plugin-security": "^3.0.1",
"globals": "^15.8.0",
"husky": "^9.1.1",
"lint-staged": "^15.2.7",
"prettier": "^3.3.3",
"tsx": "^4.16.2",
"typescript": "^5.5.3",
"typescript-eslint": "^7.16.1",
"vitest": "^2.0.3"
},
"license": "Apache-2.0",
"pnpm": {
"auditConfig": {
"ignoreCves": []
},
"overrides": {
"trim@<0.0.3": ">=0.0.3",
"got@<11.8.5": ">=11.8.5",
"fast-xml-parser@<4.2.4": ">=4.2.4",
"semver@<7.2.1": ">=7.2.1",
"@babel/traverse@<7.23.2": ">=7.23.2"
},
"peerDependencyRules": {
"ignoreMissing": [
"@aws-amplify/core",
"@aws-amplify/geo",
"react-native",
"@babel/plugin-syntax-flow",
"@babel/plugin-transform-react-jsx",
"@algolia/client-search"
]
}
}
}
"pnpm": {},
"packageManager": "pnpm@9.5.0+sha256.dbdf5961c32909fb030595a9daa1dae720162e658609a8f92f2fa99835510ca5"
}
10 changes: 0 additions & 10 deletions packages/gboost-common/.eslintrc.cjs

This file was deleted.

11 changes: 5 additions & 6 deletions packages/gboost-common/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { removeIgnoredFiles } from "../../utils/lintStaged.js";

export default {
"*.ts": async (files) => {
const filesToLint = await removeIgnoredFiles(files);
"*.ts": (files) => {
const joinedFiles = files.join(" ");
return [
`eslint --fix --max-warnings=0 ${filesToLint}`,
`vitest related --run ${files}`,
`eslint --max-warnings=0 --no-warn-ignored ${joinedFiles}`,
`prettier --write ${joinedFiles}`,
`vitest related --run ${joinedFiles}`,
"tsc --noEmit",
];
},
Expand Down
23 changes: 6 additions & 17 deletions packages/gboost-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,13 @@
],
"scripts": {
"build": "tsx scripts/build.ts",
"format": "prettier --write .",
"lint": "eslint \"src/**/*.ts\"",
"test": "vitest run",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@tsconfig/node18": "^18.2.2",
"@tsconfig/strictest": "^2.0.2",
"@types/node": "^20.9.1",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-define-config": "^2.0.0",
"eslint-plugin-prettier": "^5.0.1",
"prettier": "^3.1.0",
"tsx": "^4.1.3",
"typescript": "^5.2.2",
"vitest": "^0.34.6"
"@types/node": "^20.14.11"
},
"repository": {
"type": "git",
Expand All @@ -47,10 +36,10 @@
},
"keywords": [
"aws",
"serverless",
"react",
"cdk",
"vite",
"cloud",
"native",
"node",
"nodejs",
"green",
"boost",
"gboost"
Expand Down
Loading
Loading