babel-plugin-vona-bean-module 1.1.6 → 1.1.9

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2016-present Vona
3
+ Copyright (c) 2016-present Cabloy/Vona/Zova
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
File without changes
package/dist/index.d.ts CHANGED
@@ -6,3 +6,4 @@ export interface PluginZovaBeanModuleOptions {
6
6
  export default function (_plugin: any, options: PluginZovaBeanModuleOptions): {
7
7
  visitor: Visitor<PluginPass>;
8
8
  };
9
+ export declare function isValidBeanModuleFile(fileName?: string | null): boolean;
package/dist/index.js CHANGED
@@ -53,7 +53,7 @@ function __parseBeanInfo(state) {
53
53
  return { module: moduleName };
54
54
  }
55
55
  function __getModuleName(sourceFileName) {
56
- if (!__checkIfValid(sourceFileName))
56
+ if (!isValidBeanModuleFile(sourceFileName))
57
57
  return;
58
58
  const moduleInfo = parseInfoFromPath(sourceFileName);
59
59
  if (!moduleInfo)
@@ -77,9 +77,11 @@ function __createDecoratorNode(beanInfo) {
77
77
  // objectExpression.properties.push(propertyNode);
78
78
  // }
79
79
  // }
80
- function __checkIfValid(fileName) {
80
+ export function isValidBeanModuleFile(fileName) {
81
81
  if (!fileName)
82
82
  return false;
83
+ if (/[\\/].vona-test-\d{14}-[a-f0-9]{8}[\\/]/.test(fileName))
84
+ return false;
83
85
  return !['src/boot/app/', '.zova/app/', 'src/backend/', '.vona/'].some(item => {
84
86
  return fileName.includes(item);
85
87
  });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import assert from 'node:assert/strict';
2
+ import { test } from 'node:test';
3
+ import { isValidBeanModuleFile } from "./index.js";
4
+ test('excludes timestamped generated Vona roots from bean module transforms', () => {
5
+ assert.equal(isValidBeanModuleFile('/project/vona/.vona-test-20261014010203-a1b2c3d4/app.ts'), false);
6
+ assert.equal(isValidBeanModuleFile('C:\\project\\vona\\.vona-test-20261014010203-a1b2c3d4\\app.ts'), false);
7
+ assert.equal(isValidBeanModuleFile('/project/vona/src/module/foo/src/index.ts'), true);
8
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "babel-plugin-vona-bean-module",
3
- "version": "1.1.6",
4
- "gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
3
+ "version": "1.1.9",
4
+ "gitHead": "bc3034e45e4f728199560c682b3432d47381ceb4",
5
5
  "description": "babel-plugin-vona-bean-module",
6
6
  "keywords": [
7
7
  "framework",
@@ -26,15 +26,18 @@
26
26
  "publishConfig": {
27
27
  "access": "public"
28
28
  },
29
+ "scripts": {
30
+ "lint": "eslint .",
31
+ "clean": "rimraf dist tsconfig.tsbuildinfo",
32
+ "tsc:publish": "npm run clean && tsc",
33
+ "prepublishOnly": "npm run tsc:publish",
34
+ "prepack": "clean-package",
35
+ "postpack": "clean-package restore"
36
+ },
29
37
  "dependencies": {
30
38
  "@babel/core": "^7.29.0",
31
39
  "@babel/traverse": "^7.29.0",
32
- "@cabloy/module-info": "^2.0.0",
40
+ "@cabloy/module-info": "^2.0.3",
33
41
  "@cabloy/word-utils": "^2.1.8"
34
- },
35
- "scripts": {
36
- "lint": "eslint .",
37
- "clean": "rimraf dist tsconfig.tsbuildinfo",
38
- "tsc:publish": "npm run clean && tsc"
39
42
  }
40
- }
43
+ }