edges-svelte 3.0.0 → 3.0.1

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/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './provider/Provider.js';
2
2
  export { batch, transaction } from './utils/batch.js';
3
+ export { __withEdgesUniversalLoad } from './server/ServerSync.js';
3
4
  export type * from './types.js';
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './provider/Provider.js';
2
2
  export { batch, transaction } from './utils/batch.js';
3
+ export { __withEdgesUniversalLoad } from './server/ServerSync.js';
@@ -60,8 +60,9 @@ export function createEdgesPluginFactory(packageName, serverPath) {
60
60
  return `${beforeImports}\n${SYNC_MARKER}\n${importLine}\n${afterImports}`;
61
61
  };
62
62
  const ensureAstServerImport = (sourceCode) => ensureSyncImport(sourceCode, `import { __withEdgesServerLoad as ${AST_SERVER_LOAD_ALIAS}, __withEdgesActions as ${AST_ACTIONS_ALIAS} } from '${serverPath}';`);
63
- const ensureAstUniversalImport = (sourceCode) => ensureSyncImport(sourceCode, `import { __withEdgesUniversalLoad as ${AST_UNIVERSAL_LOAD_ALIAS} } from '${serverPath}';`);
64
- const ensureRegexImport = (sourceCode) => ensureSyncImport(sourceCode, `import { __withEdgesServerLoad, __withEdgesActions, __withEdgesUniversalLoad } from '${serverPath}';`);
63
+ const ensureAstUniversalImport = (sourceCode) => ensureSyncImport(sourceCode, `import { __withEdgesUniversalLoad as ${AST_UNIVERSAL_LOAD_ALIAS} } from '${packageName}';`);
64
+ const ensureRegexServerImport = (sourceCode) => ensureSyncImport(sourceCode, `import { __withEdgesServerLoad, __withEdgesActions } from '${serverPath}';`);
65
+ const ensureRegexUniversalImport = (sourceCode) => ensureSyncImport(sourceCode, `import { __withEdgesUniversalLoad } from '${packageName}';`);
65
66
  const findExportedLocal = (sourceFile, code, exportedName) => {
66
67
  const edits = [];
67
68
  let localName = null;
@@ -117,7 +118,7 @@ export function createEdgesPluginFactory(packageName, serverPath) {
117
118
  if (!LOAD_EXPORT_PATTERN.test(sourceCode) && !ACTIONS_EXPORT_PATTERN.test(sourceCode)) {
118
119
  return null;
119
120
  }
120
- let wrapped = ensureRegexImport(sourceCode);
121
+ let wrapped = ensureRegexServerImport(sourceCode);
121
122
  if (LOAD_EXPORT_PATTERN.test(wrapped)) {
122
123
  wrapped = wrapped
123
124
  .replace(LOAD_EXPORT_PATTERN, (match) => match.replace('export const load', 'const __userLoad'))
@@ -133,7 +134,7 @@ export function createEdgesPluginFactory(packageName, serverPath) {
133
134
  const wrapUniversalRouteModuleRegex = (sourceCode) => {
134
135
  if (!LOAD_EXPORT_PATTERN.test(sourceCode))
135
136
  return null;
136
- let wrapped = ensureRegexImport(sourceCode);
137
+ let wrapped = ensureRegexUniversalImport(sourceCode);
137
138
  wrapped = wrapped
138
139
  .replace(LOAD_EXPORT_PATTERN, (match) => match.replace('export const load', 'const __userUniversalLoad'))
139
140
  .concat('\n\nexport const load = __withEdgesUniversalLoad(__userUniversalLoad);');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edges-svelte",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "license": "MIT",
5
5
  "author": "Pixel1917",
6
6
  "description": "A blazing-fast, extremely lightweight and SSR-friendly store for Svelte",