unframer 2.18.4 → 2.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const version = "2.18.4";
1
+ export declare const version = "2.19.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/esm/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const version = '2.18.4';
1
+ export const version = '2.19.0';
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unframer",
3
- "version": "2.18.4",
3
+ "version": "2.19.0",
4
4
  "description": "Import Framer components directly in your React app, type safe and customizable",
5
5
  "sideEffects": false,
6
6
  "repository": "https://github.com/remorses/unframer",
@@ -67,9 +67,9 @@
67
67
  "@babel/types": "^7.26.7",
68
68
  "@types/babel__core": "^7.20.5",
69
69
  "@types/babel__traverse": "^7.20.6",
70
- "@types/bun": "^1.2.1",
71
- "@types/node": "^22.12.0",
72
- "@types/react": "^19.0.8",
70
+ "@types/bun": "^1.1.6",
71
+ "@types/node": "^22.13.0",
72
+ "@types/react": "^18.3.12",
73
73
  "@xmorse/deployment-utils": "^0.2.19",
74
74
  "concurrently": "^9.1.2",
75
75
  "openai": "^4.80.1",
package/src/exporter.ts CHANGED
@@ -656,12 +656,12 @@ export async function checkUnframerVersion({ cwd }: { cwd: string }) {
656
656
  const installedVersion = await resolvePackage({ cwd, pkg: 'unframer' })
657
657
  if (installedVersion !== currentVersion) {
658
658
  spinner.error(
659
- `Unframer version mismatch. Please run: npm update unframer@latest`,
659
+ `IMPORTANT: Unframer version mismatch. Please run: npm update unframer@latest`,
660
660
  )
661
661
  }
662
662
  } catch (e) {
663
663
  spinner.error(
664
- 'Unframer is not installed in your project. Please run: npm install unframer',
664
+ 'IMPORTANT: Unframer is not installed in your project. Please run: npm install unframer',
665
665
  )
666
666
  }
667
667
  }
@@ -904,27 +904,35 @@ export async function extractPropControlsUnsafe(
904
904
  const code = `import("${fileUrl}").then(x => { console.log("${delimiter}"); console.log(${propCode}) })`
905
905
 
906
906
  const TIMEOUT = 5 * 1000
907
- const UNFRAMER_MAP_PACKAGES = JSON.stringify({
907
+ const UNFRAMER_MAP_PACKAGES = {
908
908
  unframer: url.pathToFileURL(require.resolve('../esm/index.js')).href,
909
909
  react: url.pathToFileURL(require.resolve('react')).href,
910
910
  'react-dom': url.pathToFileURL(require.resolve('react-dom')).href,
911
911
  'react/jsx-runtime': url.pathToFileURL(
912
912
  require.resolve('react/jsx-runtime'),
913
913
  ).href,
914
- })
914
+ }
915
+ let loaderOption = `--loader ${url.pathToFileURL(
916
+ require.resolve('../dist/unframer-loader.js'),
917
+ )}`
918
+ try {
919
+ require.resolve('unframer/package.json')
920
+
921
+ UNFRAMER_MAP_PACKAGES.unframer = ''
922
+ } catch {}
915
923
  let stdout = await new Promise<string>((res, rej) => {
916
924
  const cmd = `"${
917
925
  nodePath
918
- }" --no-warnings --input-type=module --loader ${url.pathToFileURL(
919
- require.resolve('../dist/unframer-loader.js'),
920
- )} -e ${JSON.stringify(code)}`
926
+ }" --no-warnings --input-type=module ${loaderOption} -e ${JSON.stringify(code)}`
921
927
 
922
928
  let childProcess = exec(
923
929
  cmd,
924
930
  {
925
931
  env: {
926
932
  // ...process.env,
927
- UNFRAMER_MAP_PACKAGES,
933
+ UNFRAMER_MAP_PACKAGES: JSON.stringify(
934
+ UNFRAMER_MAP_PACKAGES,
935
+ ),
928
936
  },
929
937
  },
930
938
  (err, stdout, stderr) => {
package/src/framer.js CHANGED
@@ -554462,5 +554462,15 @@ if (typeof document !== 'undefined') {
554462
554462
  document.head.appendChild(fragment);
554463
554463
  }
554464
554464
 
554465
+ if (typeof document !== 'undefined'){
554466
+ const clearCaches = () => {
554467
+ defaultSheet = undefined
554468
+ componentsWithServerRenderedStyles.clear()
554469
+ defaultCache.clear()
554470
+ };
554471
+ document.addEventListener('astro:before-preparation', clearCaches);
554472
+ document.addEventListener('astro:before-swap', clearCaches);
554473
+ }
554474
+
554465
554475
  export { Link as FramerLink }
554466
554476
  export { Router, FetchClientProvider, FormContext, LocaleInfoContext }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.18.4'
1
+ export const version = '2.19.0'