@jay-framework/compiler-jay-stack 0.15.1 → 0.15.3

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
@@ -118,8 +118,9 @@ declare function transformActionImports(code: string, id: string, resolveActionM
118
118
  * wix-server-client, the import should be rewritten to wix-server-client/client
119
119
  * in client builds.
120
120
  *
121
- * Uses a `transform` hook instead of `resolveId` to ensure the rewrite happens
122
- * before rollup's `external` option is evaluated.
121
+ * Uses a `transform` hook to rewrite import specifiers in source code, and a
122
+ * `resolveId` hook (build mode only) to ensure Rollup uses the rewritten
123
+ * specifiers for external packages.
123
124
  *
124
125
  * Detection:
125
126
  * 1. Check if the imported package has a plugin.yaml (is a Jay plugin)
@@ -190,8 +191,9 @@ interface PluginClientImportResolverOptions {
190
191
  * Creates a Vite plugin that transforms plugin package imports to /client
191
192
  * in client builds.
192
193
  *
193
- * Uses the `transform` hook to rewrite import declarations before rollup's
194
- * external option is evaluated.
194
+ * Uses `transform` hook to rewrite import specifiers in source code, plus
195
+ * `resolveId` hook (build mode only) for external packages where Rollup
196
+ * uses the specifier from resolveId rather than the transformed source.
195
197
  */
196
198
  declare function createPluginClientImportResolver(options?: PluginClientImportResolverOptions): Plugin;
197
199
 
package/dist/index.js CHANGED
@@ -635,8 +635,8 @@ function extractPackageName(source) {
635
635
  function isSubpathImport(source, packageName) {
636
636
  return source.length > packageName.length && source[packageName.length] === "/";
637
637
  }
638
- const IMPORT_REGEX = /import\s+(.+?)\s+from\s+(['"])([^'"]+)\2/g;
639
- const EXPORT_FROM_REGEX = /export\s+(.+?)\s+from\s+(['"])([^'"]+)\2/g;
638
+ const IMPORT_REGEX = /import\s+([\s\S]+?)\s+from\s+(['"])([^'"]+)\2/g;
639
+ const EXPORT_FROM_REGEX = /export\s+([\s\S]+?)\s+from\s+(['"])([^'"]+)\2/g;
640
640
  function transformImports(options) {
641
641
  const { code, projectRoot, filePath, pluginDetector, verbose = false } = options;
642
642
  let hasChanges = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jay-framework/compiler-jay-stack",
3
- "version": "0.15.1",
3
+ "version": "0.15.3",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -27,16 +27,16 @@
27
27
  "test:watch": "vitest"
28
28
  },
29
29
  "dependencies": {
30
- "@jay-framework/compiler": "^0.15.1",
31
- "@jay-framework/compiler-shared": "^0.15.1",
32
- "@jay-framework/logger": "^0.15.1",
33
- "@jay-framework/typescript-bridge": "^0.15.1",
34
- "@jay-framework/vite-plugin": "^0.15.1",
30
+ "@jay-framework/compiler": "^0.15.3",
31
+ "@jay-framework/compiler-shared": "^0.15.3",
32
+ "@jay-framework/logger": "^0.15.3",
33
+ "@jay-framework/typescript-bridge": "^0.15.3",
34
+ "@jay-framework/vite-plugin": "^0.15.3",
35
35
  "typescript": "^5.3.3",
36
36
  "vite": "^5.0.11"
37
37
  },
38
38
  "devDependencies": {
39
- "@jay-framework/dev-environment": "^0.15.1",
39
+ "@jay-framework/dev-environment": "^0.15.3",
40
40
  "rimraf": "^5.0.5",
41
41
  "tsup": "^8.0.1",
42
42
  "vitest": "^1.2.1"