diff --git a/.vscode/settings.json b/.vscode/settings.json index 445f1b128..dd8a7b89a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,6 +7,7 @@ "filesize", "iife", "Initialising", + "javascripts", "logcapture", "Loggable", "sarif", diff --git a/LICENSE b/LICENSE index 9c4b562a2..a73336b9a 100644 --- a/LICENSE +++ b/LICENSE @@ -2,7 +2,7 @@ Iframe Resizer Version 5 This JavaScript library is Copyright © 2013-2024 David J. Bradshaw and is distributed under the GPL V3 for non-commercial use. A commercial license is available upon request. -For more information on commercial licensing contact dave@bradshaw.net +For more information on commercial licensing see https://iframe-resizer.com/pricing/ -- diff --git a/bin/publish.sh b/bin/publish.sh index d25785340..e3575e4e1 100755 --- a/bin/publish.sh +++ b/bin/publish.sh @@ -40,6 +40,8 @@ cd ../react npm publish --tag $1 cd ../vue npm publish --tag $1 +cd ../legacy +npm publish --tag $1 if [ $1 != "latest" ] then @@ -55,7 +57,6 @@ zip iframe-resizer.zip js/** cp -v js/** js-dist git add . - git commit -am "Release v$VERSION" git tag "v$VERSION" git pull diff --git a/build/pkgJson.js b/build/pkgJson.js index 029cf52e1..9bc15c3d6 100644 --- a/build/pkgJson.js +++ b/build/pkgJson.js @@ -1,26 +1,38 @@ +const main = 'index.cjs.js' +const module = 'index.esm.js' + const customConfig = (file) => { const entryPoints = { - main: `index.cjs.js`, - module: `index.esm.js`, + main, + module, browser: `index.umd.js`, } switch (file) { case 'react': return { - main: 'index.cjs.js', - module: 'index.esm.js', + main, + module, types: `iframe-resizer.${file}.d.ts`, peerDependencies: { - react: '^16.8.0 || ^17.0.0 || ^18.0.0', - 'react-dom': '^16.8.0 || ^17.0.0 || ^18.0.0', + react: '^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0', + 'react-dom': '^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0', }, } + case 'legacy': + return { + name: 'iframe-resizer', + description: + "This project has now been split into two separate packages. Please use '@iframe-resizer/parent' and '@iframe-resizer/child'. See https://iframe-resizer.com/upgrade for more details.", + main, + module, + } + case 'vue': return { main: 'index.umd.js', - module: 'index.esm.js', + module, browser: { './sfc': 'iframe-resizer.vue', }, diff --git a/build/plugins.js b/build/plugins.js index cd028cfa4..8639e588b 100644 --- a/build/plugins.js +++ b/build/plugins.js @@ -28,7 +28,15 @@ export const pluginsBase = (stripLog) => (file) => { const fixVersion = (file) => file in { core: 1, child: 1 } ? {} - : { additionalDependencies: { '@iframe-resizer/core': pkg.version } } + : file !== 'legacy' + ? { additionalDependencies: { '@iframe-resizer/core': pkg.version } } + : { + additionalDependencies: { + '@iframe-resizer/child': pkg.version, + '@iframe-resizer/jquery': pkg.version, + '@iframe-resizer/parent': pkg.version, + }, + } const today = new Date().toISOString().split('T').join(' - ') diff --git a/example/child/frame.content.html b/example/child/frame.content.html index cfe805601..91e014c44 100644 --- a/example/child/frame.content.html +++ b/example/child/frame.content.html @@ -9,6 +9,10 @@ type="text/javascript" src="../../js/iframe-resizer.child.js" > + + @@ -40,10 +48,6 @@

Automagically resizing iFrame

https://frame-resizer.com. -