Skip to content

Commit

Permalink
Add next-drupal package to replace base/drupal
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed May 15, 2024
1 parent 78315a8 commit 294502f
Show file tree
Hide file tree
Showing 235 changed files with 11,175 additions and 10 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"start:prod": "sh ./scripts/build_startbuild.sh",
"prepare": "husky install"
},
"internalPaths": [
"@edw/next-drupal"
],
"workspaces": [
"packages/*"
],
Expand Down
18 changes: 13 additions & 5 deletions packages/eslint-config-custom/perfRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ let packageJson, internalPaths
const packages = [
'@edw/base',
'@edw/drupal',
'@edw/next-drupal',
'tsconfig',
'eslint-config-custom',
]
Expand Down Expand Up @@ -43,11 +44,18 @@ const perfRules = {
react: ['react react-* next'],
},
value: {
'internal-type': internalPaths.reduce((acc, app) => {
acc.push(`${app}/**/@types`)
acc.push(`${app}/**/@types/**`)
return acc
}, []),
'internal-type': [
...internalPaths.reduce((acc, app) => {
acc.push(`${app}/**/@types`)
acc.push(`${app}/**/@types/**`)
return acc
}, []),
...packages.reduce((acc, pkg) => {
acc.push(`${pkg}/**/@types`)
acc.push(`${pkg}/**/@types/**`)
return acc
}, []),
],
react: ['react', 'react-*'],
config: ['**/config', '*/config/**'],
packages: packages.reduce((acc, pkg) => {
Expand Down
3 changes: 3 additions & 0 deletions packages/next-drupal/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['custom/react-library'],
}
1 change: 1 addition & 0 deletions packages/next-drupal/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../macrodef/lib.mk
22 changes: 22 additions & 0 deletions packages/next-drupal/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
collectCoverageFrom: [
'**/*.{js,jsx,ts,tsx}',
'!**/*.d.ts',
'!**/node_modules/**',
],
moduleNameMapper: {
'\\.(css|scss|svg)$': 'identity-obj-proxy',
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
},
setupFiles: ['<rootDir>/.jest/setEnvVars.js'],
setupFilesAfterEnv: ['<rootDir>/.jest/setupTests.js'],
testEnvironment: 'jest-environment-jsdom',
testPathIgnorePatterns: ['<rootDir>/node_modules/', 'fixtures'],
transform: {
'^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { presets: ['next/babel'] }],
},
transformIgnorePatterns: [
'/node_modules/',
'^.+\\.module\\.(css|sass|scss)$',
],
}
65 changes: 65 additions & 0 deletions packages/next-drupal/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"name": "@edw/next-drupal",
"version": "1.0.0",
"description": "Generic Design System Components for Eaudeweb websites",
"author": "Tiberiu Ichim",
"license": "GPL",
"main": "src/index.ts",
"types": "src/index.ts",
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"generate:component": "turbo gen react-component",
"test": "jest",
"test:write": "jest -u",
"test:watch": "jest --watch",
"type-check": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"@ant-design/cssinjs": "^1.20.0",
"@ant-design/icons": "^5.3.6",
"@react-pdf-viewer/core": "^3.12.0",
"@react-pdf-viewer/default-layout": "^3.12.0",
"@tanstack/react-query": "^5.32.0",
"@tanstack/react-query-devtools": "^5.32.0",
"antd": "^5.16.5",
"classnames": "^2.5.1",
"dom-serializer": "^2.0.0",
"friendly-challenge": "^0.9.15",
"html-react-parser": "^5.1.10",
"isomorphic-dompurify": "^2.7.0",
"lodash": "^4.17.21",
"next": "^13.5.6",
"next-auth": "4.24.7",
"next-drupal": "^1.6.0",
"pdfjs-dist": "3.4.120",
"yup": "^1.4.0",
"drupal-jsonapi-params": "^2.3.1",
"jsona": "^1.12.1",
"ts-pattern": "^5.1.1"
},
"devDependencies": {
"@csstools/postcss-global-data": "^2.1.1",
"@testing-library/dom": "^10.0.0",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^15.0.5",
"@turbo/gen": "^1.13.3",
"@types/lodash": "^4.17.1",
"@types/node": "^20.12.7",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"eslint-config-custom": "workspace:*",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
"postcss": "^8.4.38",
"postcss-preset-env": "^9.5.9",
"sass": "^1.75.0",
"typescript": "5.4.5",
"@types/lodash.chunk": "^4.2.9",
"jest-environment-jsdom": "^29.7.0",
"lodash.chunk": "^4.2.0",
"rc-tree-select": "^5.20.0",
"react": "^18.3.1",
"tsconfig": "workspace:*"
}
}
16 changes: 16 additions & 0 deletions packages/next-drupal/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
plugins: {
'@csstools/postcss-global-data': {
files: ['src/styles/custom-media.css'],
},
'postcss-preset-env': {
autoprefixer: {},
features: {
'custom-media-queries': true,
// CSS variables aren't compiled because it's not safe.
'custom-properties': false,
'nesting-rules': true,
},
},
},
}
2 changes: 2 additions & 0 deletions packages/next-drupal/prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const config = require('eslint-config-custom/prettier.config')
module.exports = config
3 changes: 3 additions & 0 deletions packages/next-drupal/src/@types/declaration.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module '*.jpg'
declare module '*.png'
declare module '*.svg'
Loading

0 comments on commit 294502f

Please sign in to comment.