diff --git a/package.json b/package.json index 7ca3c389b..254400e8d 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "start": "yarn workspace embla-carousel-docs run start", "start:vanilla": "npm-run-all --parallel watch:package-vanilla watch:playground-vanilla", "start:react": "npm-run-all --parallel watch:package-vanilla watch:package-react watch:playground-react", - "build": "npm-run-all build:packages yarn build:package-readmes format", + "build": "npm-run-all build:packages build:package-readmes format", "build:packages": "yarn workspaces foreach -vt --exclude \"{embla-carousel-monorepo,embla-carousel-playground-vanilla,embla-carousel-playground-react}\" run build", "build:package-readmes": "npx ts-node --project scripts/tsconfig.node.json scripts/create-readmes/index.ts --templatePath=scripts/create-readmes/readme-template.md", "build:docs": "yarn workspace embla-carousel-docs run predeploy", diff --git a/packages/embla-carousel-auto-height/README.md b/packages/embla-carousel-auto-height/README.md index cd02c358f..57a480c86 100644 --- a/packages/embla-carousel-auto-height/README.md +++ b/packages/embla-carousel-auto-height/README.md @@ -7,7 +7,7 @@
-
+
diff --git a/packages/embla-carousel-autoplay/README.md b/packages/embla-carousel-autoplay/README.md
index 59651609c..39de2c4fd 100644
--- a/packages/embla-carousel-autoplay/README.md
+++ b/packages/embla-carousel-autoplay/README.md
@@ -7,7 +7,7 @@
-
+
diff --git a/packages/embla-carousel-class-names/README.md b/packages/embla-carousel-class-names/README.md
index c0f7faa1b..c1f3bdd8f 100644
--- a/packages/embla-carousel-class-names/README.md
+++ b/packages/embla-carousel-class-names/README.md
@@ -7,7 +7,7 @@
-
+
diff --git a/packages/embla-carousel-docs/README.md b/packages/embla-carousel-docs/README.md
index db32203a7..1254ecc4b 100644
--- a/packages/embla-carousel-docs/README.md
+++ b/packages/embla-carousel-docs/README.md
@@ -7,7 +7,7 @@
-
+
diff --git a/packages/embla-carousel-react/README.md b/packages/embla-carousel-react/README.md
index 8f796d4df..c8a0c557c 100644
--- a/packages/embla-carousel-react/README.md
+++ b/packages/embla-carousel-react/README.md
@@ -7,7 +7,7 @@
-
+
diff --git a/packages/embla-carousel-reactive-utils/README.md b/packages/embla-carousel-reactive-utils/README.md
index 1aba3367e..b47568185 100644
--- a/packages/embla-carousel-reactive-utils/README.md
+++ b/packages/embla-carousel-reactive-utils/README.md
@@ -7,7 +7,7 @@
-
+
diff --git a/packages/embla-carousel-svelte/README.md b/packages/embla-carousel-svelte/README.md
index f6a4b26c5..3ba334d1f 100644
--- a/packages/embla-carousel-svelte/README.md
+++ b/packages/embla-carousel-svelte/README.md
@@ -7,7 +7,7 @@
-
+
diff --git a/packages/embla-carousel-vue/README.md b/packages/embla-carousel-vue/README.md
index 70537310d..c0c923a4d 100644
--- a/packages/embla-carousel-vue/README.md
+++ b/packages/embla-carousel-vue/README.md
@@ -7,7 +7,7 @@
-
+
diff --git a/scripts/create-readmes/create-readme.ts b/scripts/create-readmes/create-readme.ts
index 11b9f236c..04c07ca10 100644
--- a/scripts/create-readmes/create-readme.ts
+++ b/scripts/create-readmes/create-readme.ts
@@ -2,6 +2,7 @@ import fs from 'fs'
import path from 'path'
import { CONSOLE_FONT_COLORS, kebabCaseToPascalCase } from '../utils'
+const PACKAGE_NAME_PASCAL_REGEX = /__REPLACE_PACKAGE_PASCAL_NAME__/g
const PACKAGE_NAME_REGEX = /__REPLACE_PACKAGE_NAME__/g
const PACKAGE_AUTHOR_REGEX = /__REPLACE_PACKAGE_AUTHOR__/g
@@ -15,10 +16,11 @@ export const createReadme = (template: string, workspace: string): void => {
const { name, author } = JSON.parse(workspacePackageJson)
const packageName = name.replace('-monorepo', '')
- const namePascalCase = kebabCaseToPascalCase(packageName, ' ')
+ const packageNamePascal = kebabCaseToPascalCase(packageName, ' ')
const readme = template
- .replace(PACKAGE_NAME_REGEX, namePascalCase)
+ .replace(PACKAGE_NAME_REGEX, packageName)
+ .replace(PACKAGE_NAME_PASCAL_REGEX, packageNamePascal)
.replace(PACKAGE_AUTHOR_REGEX, author)
fs.writeFile(readmePath, readme, (error) => {
diff --git a/scripts/create-readmes/readme-template.md b/scripts/create-readmes/readme-template.md
index 89095763c..ab905fec3 100644
--- a/scripts/create-readmes/readme-template.md
+++ b/scripts/create-readmes/readme-template.md
@@ -7,7 +7,7 @@
-
__REPLACE_PACKAGE_NAME__
+ __REPLACE_PACKAGE_PASCAL_NAME__