Skip to content

Commit

Permalink
feat(sdk-analytics) fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
oidacra committed Dec 13, 2024
1 parent 5aa3d30 commit 51522a0
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 9 deletions.
13 changes: 10 additions & 3 deletions core-web/libs/sdk/analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@dotcms/analytics",
"version": "0.0.1-alpha.54",
"type": "module",
"description": "Official JavaScript library for Content Analytics with DotCMS.",
"repository": {
"type": "git",
Expand All @@ -21,11 +22,17 @@
"homepage": "https://github.com/dotCMS/core/tree/main/core-web/libs/sdk/analytics/README.md",
"dependencies": {
"analytics": "^0.8.14",
"react": "^18.2.0"
"vite": "~5.0.0"
},
"peerDependencies": {
"vite": "^5.0.0"
"react": "^18.2.0"
},
"main": "./index.cjs.js",
"module": "./index.esm.js"
"module": "./index.esm.js",
"exports": {
"./react": {
"import": "./lib/react/index.js",
"types": "./lib/react/index.d.ts"
}
}
}
20 changes: 17 additions & 3 deletions core-web/libs/sdk/analytics/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,25 @@
"options": {
"outputPath": "dist/libs/sdk/analytics",
"main": "libs/sdk/analytics/src/index.ts",
"tsConfig": "libs/sdk/analytics/tsconfig.lib.json",
"project": "libs/sdk/analytics/package.json",
"rollupConfig": "@nx/react/plugins/bundle-rollup",
"additionalEntryPoints": ["libs/sdk/analytics/src/lib/react/index.ts"],
"tsConfig": "libs/sdk/analytics/tsconfig.lib.json",
"format": ["esm"],
"external": ["react"],
"preserveModules": true,
"preserveModulesRoot": "libs/sdk/analytics/src",
"rollupConfig": "libs/sdk/analytics/rollup.config.js",
"compiler": "swc",
"format": ["esm", "cjs"]
"assets": [
{
"glob": "README.md",
"input": "libs/sdk/analytics",
"output": "."
}
],
"sourceMap": true,
"skipTypeCheck": false,
"deleteOutputPath": true
}
},
"build:standalone": {
Expand Down
12 changes: 12 additions & 0 deletions core-web/libs/sdk/analytics/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default {
input: {
'index.esm': 'libs/sdk/analytics/src/index.ts',
'react/index': 'libs/sdk/analytics/src/lib/react/index.ts'
},
output: {
dir: 'dist/libs/sdk/analytics',
format: 'esm',
preserveModules: true,
preserveModulesRoot: 'libs/sdk/analytics/src'
}
};
3 changes: 1 addition & 2 deletions core-web/libs/sdk/analytics/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './lib/react/components/DotContentAnalyticsProvider';
export * from './lib/react/hook/useContentAnalytics';
export * from './lib/react';
1 change: 1 addition & 0 deletions core-web/libs/sdk/analytics/src/lib/react/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './public-api';
3 changes: 3 additions & 0 deletions core-web/libs/sdk/analytics/src/lib/react/public-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { DotContentAnalyticsProvider } from './components/DotContentAnalyticsProvider';

export { useContentAnalytics } from './hook/useContentAnalytics';
2 changes: 1 addition & 1 deletion core-web/libs/sdk/analytics/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"module": "ES2015",
"target": "es2015",
"declaration": true,
"outDir": "../../../dist/out-tsc",
"outDir": "../../../dist/libs/sdk/analytics",
"types": ["node", "jest"],
"moduleResolution": "node",
"esModuleInterop": true,
Expand Down

0 comments on commit 51522a0

Please sign in to comment.