Skip to content

Commit 312b91e

Browse files
authored
feat(SDK): Create DotCMSLayoutBody React Component to render page content (dotCMS#31306)
This pull request includes several changes to the `core-web/libs/sdk/react` package to improve configuration and module exports. The most important changes include modifications to the ESLint configuration, updates to the `package.json` file, and adjustments to the project's entry points and exports. Configuration improvements: * [`core-web/libs/sdk/react/.eslintrc.js`](diffhunk://#diff-1bc6d4551c440cba97e1cd7fdef8397aa288ce0553a099306f9affe6b6e95397R1-R34): Added a new ESLint configuration file with specific rules for different file types and disabled the `@typescript-eslint/no-explicit-any` rule for test files. * [`core-web/libs/sdk/react/.eslintrc.json`](diffhunk://#diff-c1253471d19eba15e7d897c041d10975d49a77bacb2727b17a46024c6798d754R16-R28): Updated the existing ESLint configuration to include rules for test files, matching the new `.eslintrc.js` file. Module and export updates: * [`core-web/libs/sdk/react/package.json`](diffhunk://#diff-0e57f36b05f8bf64758e7a7c7f599a2b2ce1e20a9bff3de098a5675fd3ccb4d2R11-R35): Added `main`, `module`, and `types` fields, defined `typesVersions`, and specified exports for the package, including a new `next` entry point. * [`core-web/libs/sdk/react/project.json`](diffhunk://#diff-7d9813e75d2eb001605855207c4c396bea3ecec81bde3e537f8fedb0d11b9382R23-R28): Added an additional entry point for `next.ts` and specified the output format as `esm`. * [`core-web/libs/sdk/react/src/index.ts`](diffhunk://#diff-4767f5022b15f9cb3231be4ec4fd472295f2bee4d08face5bcf964efa44be862L1-R1): Changed exports to use a single deprecated API file instead of individual component exports. ### Video https://github.com/user-attachments/assets/20a9905f-3cf9-486a-ae38-026950c34729
1 parent 98fbf6e commit 312b91e

File tree

79 files changed

+2450
-17
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2450
-17
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module.exports = {
2+
extends: ['plugin:@nrwl/nx/react', '../../../.eslintrc.base.json'],
3+
ignorePatterns: ['!**/*'],
4+
parserOptions: {
5+
sourceType: 'module'
6+
},
7+
overrides: [
8+
{
9+
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
10+
rules: {}
11+
},
12+
{
13+
files: ['*.ts', '*.tsx'],
14+
rules: {}
15+
},
16+
{
17+
files: ['*.js', '*.jsx'],
18+
rules: {}
19+
},
20+
{
21+
files: [
22+
'**/*.spec.ts',
23+
'**/*.spec.tsx',
24+
'**/*.test.ts',
25+
'**/*.test.tsx',
26+
'**/*.spec.js',
27+
'**/*.test.js'
28+
],
29+
rules: {
30+
'@typescript-eslint/no-explicit-any': 'off'
31+
}
32+
}
33+
]
34+
};

core-web/libs/sdk/react/.eslintrc.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313
{
1414
"files": ["*.js", "*.jsx"],
1515
"rules": {}
16+
},
17+
{
18+
"files": [
19+
"**/*.spec.ts",
20+
"**/*.spec.tsx",
21+
"**/*.test.ts",
22+
"**/*.test.tsx",
23+
"**/*.spec.js",
24+
"**/*.test.js"
25+
],
26+
"rules": {
27+
"@typescript-eslint/no-explicit-any": "off"
28+
}
1629
}
1730
]
1831
}

core-web/libs/sdk/react/README.md

Lines changed: 24 additions & 3 deletions

core-web/libs/sdk/react/package.json

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,36 @@
44
"peerDependencies": {
55
"react": ">=18",
66
"react-dom": ">=18",
7-
"@dotcms/client": "latest",
7+
"@dotcms/client": "next",
8+
"@dotcms/uve": "next",
89
"@tinymce/tinymce-react": "^5.1.1"
910
},
1011
"description": "Official React Components library to render a dotCMS page.",
12+
"main": "./index.js",
13+
"module": "./index.js",
14+
"types": "./index.d.ts",
15+
"typesVersions": {
16+
"*": {
17+
"*": ["./dist/index.d.ts"],
18+
"next": ["./dist/next.d.ts"]
19+
}
20+
},
1121
"repository": {
1222
"type": "git",
1323
"url": "git+https://github.com/dotCMS/core.git#main"
1424
},
25+
"exports": {
26+
".": {
27+
"types": "./dist/index.d.ts",
28+
"import": "./dist/index.js",
29+
"require": "./dist/index.cjs"
30+
},
31+
"./next": {
32+
"types": "./dist/next.d.ts",
33+
"import": "./dist/next.js",
34+
"require": "./dist/next.cjs"
35+
}
36+
},
1537
"keywords": [
1638
"dotCMS",
1739
"CMS",

core-web/libs/sdk/react/project.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
"tsConfig": "libs/sdk/react/tsconfig.lib.json",
2121
"project": "libs/sdk/react/package.json",
2222
"entryFile": "libs/sdk/react/src/index.ts",
23+
"additionalEntryPoints": ["libs/sdk/react/src/next.ts"],
2324
"external": ["react/jsx-runtime"],
2425
"rollupConfig": "@nrwl/react/plugins/bundle-rollup",
2526
"compiler": "babel",
2627
"extractCss": false,
28+
"format": ["esm"],
2729
"assets": [
2830
{
2931
"glob": "libs/sdk/react/README.md",
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
export * from './lib/components/DotcmsLayout/DotcmsLayout';
2-
export * from './lib/components/DotEditableText/DotEditableText';
3-
export * from './lib/components/PageProvider/PageProvider';
4-
export * from './lib/components/Row/Row';
5-
export * from './lib/hooks/useDotcmsPageContext';
6-
export * from './lib/components/BlockEditorRenderer/BlockEditorRenderer';
7-
export * from './lib/models/content-node.interface';
1+
export * from './lib/deprecated/deprecated_api';

0 commit comments

Comments
 (0)