Skip to content

Commit

Permalink
Implement #663.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjerleke committed Dec 26, 2023
1 parent d7539b6 commit 76d0493
Show file tree
Hide file tree
Showing 20 changed files with 241 additions and 219 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ packages/embla-carousel*/embla-carousel*
packages/embla-carousel*/components
packages/embla-carousel*/esm
packages/embla-carousel*/cjs
public


# yarn
.yarn/*
Expand Down
11 changes: 9 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
packages/embla-carousel*/index.d.ts
packages/embla-carousel*/embla-carousel*
packages/embla-carousel*/components
packages/embla-carousel*/esm
packages/embla-carousel*/cjs

packages/embla-carousel*/cjs/index.d.ts
packages/embla-carousel*/cjs/embla-carousel*
packages/embla-carousel*/cjs/components

packages/embla-carousel*/esm/index.d.ts
packages/embla-carousel*/esm/embla-carousel*
packages/embla-carousel*/esm/components

public
static
docs
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@
"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 build:package-readmes build:package-nodenext 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:package-nodenext": "npx ts-node --project scripts/tsconfig.node.json scripts/create-nodenext-support/index.ts",
"build:docs": "yarn workspace embla-carousel-docs run predeploy",
"eslint:report": "yarn workspaces foreach -v --exclude \"{embla-carousel-monorepo,embla-carousel-playground-vanilla,embla-carousel-playground-react}\" run eslint:report",
"prettier:report": "prettier \"**/*.{js,jsx,tsx,ts,scss,json}\" --check",
Expand Down
24 changes: 15 additions & 9 deletions packages/embla-carousel-auto-height/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import packageJson from './package.json'
import {
PACKAGE_FORMATS,
FOLDERS,
CONFIG_BABEL,
CONFIG_TYPESCRIPT,
CONFIG_GLOBALS,
Expand All @@ -9,31 +9,32 @@ import {
resolve,
terser,
createBuildPath,
kebabToPascalCase
kebabToPascalCase,
createNodeNextSupport
} from '../../rollup.config'

export default [
{
input: 'src/index.ts',
output: [
{
file: createBuildPath(packageJson, PACKAGE_FORMATS.CJS),
format: PACKAGE_FORMATS.CJS,
file: createBuildPath(packageJson, FOLDERS.CJS),
format: FOLDERS.CJS,
globals: CONFIG_GLOBALS,
strict: true,
sourcemap: true,
exports: 'auto'
},
{
file: createBuildPath(packageJson, PACKAGE_FORMATS.ESM),
format: PACKAGE_FORMATS.ESM,
file: createBuildPath(packageJson, FOLDERS.ESM),
format: FOLDERS.ESM,
globals: CONFIG_GLOBALS,
strict: true,
sourcemap: true
},
{
file: createBuildPath(packageJson, PACKAGE_FORMATS.UMD),
format: PACKAGE_FORMATS.UMD,
file: createBuildPath(packageJson, FOLDERS.UMD),
format: FOLDERS.UMD,
globals: CONFIG_GLOBALS,
strict: true,
sourcemap: false,
Expand All @@ -42,6 +43,11 @@ export default [
}
],
external: Object.keys(CONFIG_GLOBALS),
plugins: [resolve(), typescript(CONFIG_TYPESCRIPT), babel(CONFIG_BABEL)]
plugins: [
resolve(),
typescript(CONFIG_TYPESCRIPT),
babel(CONFIG_BABEL),
createNodeNextSupport()
]
}
]
1 change: 0 additions & 1 deletion packages/embla-carousel-auto-height/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export { AutoHeightType, AutoHeightOptionsType } from './components/AutoHeight'

export { default } from './components/AutoHeight'
24 changes: 15 additions & 9 deletions packages/embla-carousel-autoplay/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import packageJson from './package.json'
import {
PACKAGE_FORMATS,
FOLDERS,
CONFIG_BABEL,
CONFIG_TYPESCRIPT,
CONFIG_GLOBALS,
Expand All @@ -9,31 +9,32 @@ import {
resolve,
terser,
createBuildPath,
kebabToPascalCase
kebabToPascalCase,
createNodeNextSupport
} from '../../rollup.config'

export default [
{
input: 'src/index.ts',
output: [
{
file: createBuildPath(packageJson, PACKAGE_FORMATS.CJS),
format: PACKAGE_FORMATS.CJS,
file: createBuildPath(packageJson, FOLDERS.CJS),
format: FOLDERS.CJS,
globals: CONFIG_GLOBALS,
strict: true,
sourcemap: true,
exports: 'auto'
},
{
file: createBuildPath(packageJson, PACKAGE_FORMATS.ESM),
format: PACKAGE_FORMATS.ESM,
file: createBuildPath(packageJson, FOLDERS.ESM),
format: FOLDERS.ESM,
globals: CONFIG_GLOBALS,
strict: true,
sourcemap: true
},
{
file: createBuildPath(packageJson, PACKAGE_FORMATS.UMD),
format: PACKAGE_FORMATS.UMD,
file: createBuildPath(packageJson, FOLDERS.UMD),
format: FOLDERS.UMD,
globals: CONFIG_GLOBALS,
strict: true,
sourcemap: false,
Expand All @@ -42,6 +43,11 @@ export default [
}
],
external: Object.keys(CONFIG_GLOBALS),
plugins: [resolve(), typescript(CONFIG_TYPESCRIPT), babel(CONFIG_BABEL)]
plugins: [
resolve(),
typescript(CONFIG_TYPESCRIPT),
babel(CONFIG_BABEL),
createNodeNextSupport()
]
}
]
1 change: 0 additions & 1 deletion packages/embla-carousel-autoplay/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export { AutoplayType, AutoplayOptionsType } from './components/Autoplay'

export { default } from './components/Autoplay'
24 changes: 15 additions & 9 deletions packages/embla-carousel-class-names/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import packageJson from './package.json'
import {
PACKAGE_FORMATS,
FOLDERS,
CONFIG_BABEL,
CONFIG_TYPESCRIPT,
CONFIG_GLOBALS,
Expand All @@ -9,31 +9,32 @@ import {
resolve,
terser,
createBuildPath,
kebabToPascalCase
kebabToPascalCase,
createNodeNextSupport
} from '../../rollup.config'

export default [
{
input: 'src/index.ts',
output: [
{
file: createBuildPath(packageJson, PACKAGE_FORMATS.CJS),
format: PACKAGE_FORMATS.CJS,
file: createBuildPath(packageJson, FOLDERS.CJS),
format: FOLDERS.CJS,
globals: CONFIG_GLOBALS,
strict: true,
sourcemap: true,
exports: 'auto'
},
{
file: createBuildPath(packageJson, PACKAGE_FORMATS.ESM),
format: PACKAGE_FORMATS.ESM,
file: createBuildPath(packageJson, FOLDERS.ESM),
format: FOLDERS.ESM,
globals: CONFIG_GLOBALS,
strict: true,
sourcemap: true
},
{
file: createBuildPath(packageJson, PACKAGE_FORMATS.UMD),
format: PACKAGE_FORMATS.UMD,
file: createBuildPath(packageJson, FOLDERS.UMD),
format: FOLDERS.UMD,
globals: CONFIG_GLOBALS,
strict: true,
sourcemap: false,
Expand All @@ -42,6 +43,11 @@ export default [
}
],
external: Object.keys(CONFIG_GLOBALS),
plugins: [resolve(), typescript(CONFIG_TYPESCRIPT), babel(CONFIG_BABEL)]
plugins: [
resolve(),
typescript(CONFIG_TYPESCRIPT),
babel(CONFIG_BABEL),
createNodeNextSupport()
]
}
]
1 change: 0 additions & 1 deletion packages/embla-carousel-class-names/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export { ClassNamesType, ClassNamesOptionsType } from './components/ClassNames'

export { default } from './components/ClassNames'
24 changes: 15 additions & 9 deletions packages/embla-carousel-react/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import packageJson from './package.json'
import {
PACKAGE_FORMATS,
FOLDERS,
CONFIG_BABEL,
CONFIG_TYPESCRIPT,
CONFIG_GLOBALS,
Expand All @@ -11,7 +11,8 @@ import {
resolve,
terser,
createBuildPath,
kebabToPascalCase
kebabToPascalCase,
createNodeNextSupport
} from '../../rollup.config'

const CONFIG_GLOBALS_MODULE = {
Expand All @@ -28,17 +29,17 @@ export default [
input: 'src/index.ts',
output: [
{
file: createBuildPath(packageJson, PACKAGE_FORMATS.CJS),
format: PACKAGE_FORMATS.CJS,
file: createBuildPath(packageJson, FOLDERS.CJS),
format: FOLDERS.CJS,
globals: CONFIG_GLOBALS_MODULE,
strict: true,
sourcemap: true,
exports: 'auto',
plugins: resolve(CONFIG_EXTERNAL_MODULES)
},
{
file: createBuildPath(packageJson, PACKAGE_FORMATS.ESM),
format: PACKAGE_FORMATS.ESM,
file: createBuildPath(packageJson, FOLDERS.ESM),
format: FOLDERS.ESM,
globals: CONFIG_GLOBALS_MODULE,
strict: true,
sourcemap: true,
Expand All @@ -53,8 +54,8 @@ export default [
input: 'src/index.ts',
output: [
{
file: createBuildPath(packageJson, PACKAGE_FORMATS.UMD),
format: PACKAGE_FORMATS.UMD,
file: createBuildPath(packageJson, FOLDERS.UMD),
format: FOLDERS.UMD,
globals: CONFIG_GLOBALS_UMD,
strict: true,
sourcemap: false,
Expand All @@ -63,7 +64,12 @@ export default [
}
],
onwarn: CONFIG_EXTERNAL_MODULE_SUPPRESS,
plugins: [resolve(), typescript(CONFIG_TYPESCRIPT), babel(CONFIG_BABEL)],
plugins: [
resolve(),
typescript(CONFIG_TYPESCRIPT),
babel(CONFIG_BABEL),
createNodeNextSupport()
],
external: Object.keys(CONFIG_GLOBALS_UMD)
}
]
7 changes: 0 additions & 7 deletions packages/embla-carousel-react/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
export {
EmblaOptionsType,
EmblaEventType,
EmblaPluginType,
EmblaCarouselType
} from 'embla-carousel/index'
export { UseEmblaCarouselType } from './components/useEmblaCarousel'

export { default } from './components/useEmblaCarousel'
24 changes: 15 additions & 9 deletions packages/embla-carousel-reactive-utils/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import packageJson from './package.json'
import {
PACKAGE_FORMATS,
FOLDERS,
CONFIG_BABEL,
CONFIG_TYPESCRIPT,
CONFIG_GLOBALS,
Expand All @@ -9,31 +9,32 @@ import {
resolve,
terser,
createBuildPath,
kebabToPascalCase
kebabToPascalCase,
createNodeNextSupport
} from '../../rollup.config'

export default [
{
input: 'src/index.ts',
output: [
{
file: createBuildPath(packageJson, PACKAGE_FORMATS.CJS),
format: PACKAGE_FORMATS.CJS,
file: createBuildPath(packageJson, FOLDERS.CJS),
format: FOLDERS.CJS,
globals: CONFIG_GLOBALS,
strict: true,
sourcemap: true,
exports: 'auto'
},
{
file: createBuildPath(packageJson, PACKAGE_FORMATS.ESM),
format: PACKAGE_FORMATS.ESM,
file: createBuildPath(packageJson, FOLDERS.ESM),
format: FOLDERS.ESM,
globals: CONFIG_GLOBALS,
strict: true,
sourcemap: true
},
{
file: createBuildPath(packageJson, PACKAGE_FORMATS.UMD),
format: PACKAGE_FORMATS.UMD,
file: createBuildPath(packageJson, FOLDERS.UMD),
format: FOLDERS.UMD,
globals: CONFIG_GLOBALS,
strict: true,
sourcemap: false,
Expand All @@ -42,6 +43,11 @@ export default [
}
],
external: Object.keys(CONFIG_GLOBALS),
plugins: [resolve(), typescript(CONFIG_TYPESCRIPT), babel(CONFIG_BABEL)]
plugins: [
resolve(),
typescript(CONFIG_TYPESCRIPT),
babel(CONFIG_BABEL),
createNodeNextSupport()
]
}
]
Loading

0 comments on commit 76d0493

Please sign in to comment.