babel-plugin-vasille 5.0.0 → 5.0.2

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/README.md CHANGED
@@ -2,9 +2,11 @@
2
2
 
3
3
  ![Vasille.js logo](https://raw.githubusercontent.com/vasille-js/vasille-js/refs/heads/v5/doc/img/logo.png)
4
4
 
5
- `SteelFrameKit` is a front-end development kit, which is developed to provide bulletproof frontends.
5
+ `SteelFrameKit` is a front-end development kit, which is developed to provide fault tolerant web applications.
6
6
 
7
- [![npm](https://img.shields.io/npm/v/vasille?style=flat-square)](https://www.npmjs.com/package/vasille)
7
+ [![npm](https://img.shields.io/npm/v/steel-frame?style=flat-square)](https://www.npmjs.com/package/steel-frame)
8
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/vasille-js/steel-frame)
9
+ [![Coverage Status](https://coveralls.io/repos/github/vasille-js/steel-frame/badge.svg?branch=v5)](https://coveralls.io/github/vasille-js/steel-frame?branch=v5)
8
10
 
9
11
  ## Table of content
10
12
 
@@ -19,11 +21,11 @@
19
21
  - [How POWERFUL is SteelFrameKit](#how-powerful-is-steelframekit)
20
22
  - [Road map](#road-map)
21
23
  - [Change log](#change-log)
22
- - [5.0.0](#500)
23
- - [4.3.0](#430)
24
- - [4.2.0](#420)
25
- - [4.1.0](#410)
26
- - [4.0.0](#400)
24
+ - [5.0](#50)
25
+ - [4.0 - 4.3](#40---43)
26
+ - [3.0 - 3.2](#30---32)
27
+ - [2.0 - 2.3](#20---23)
28
+ - [1.0 - 1.2](#10---12)
27
29
  - [Questions](#questions)
28
30
 
29
31
 
@@ -92,7 +94,7 @@ All of these are supported:
92
94
  * Reactive values (observables).
93
95
  * Inline computed values.
94
96
  * Multiline computed values.
95
- * HTML & SVG tags.
97
+ * HTML tags.
96
98
  * Component custom slots.
97
99
  * 2-way data binding in components.
98
100
  * Logic block (if, else).
@@ -103,7 +105,6 @@ All of these are supported:
103
105
 
104
106
  ## Road map
105
107
 
106
- * [x] Update the `core` library to version 3.0.
107
108
  * [x] `100%` Test Coverage for core Library v3.
108
109
  * [x] Develop the `JSX` library.
109
110
  * [x] `100%` Test Coverage for the JSX library.
@@ -117,25 +118,42 @@ All of these are supported:
117
118
 
118
119
  ## Change log
119
120
 
120
- ### 5.0.0
121
+ We respect semantic versioning:
122
+ - Major version is increased when we make incompatible API changes.
123
+ - Minor version is increased when we add functionality.
124
+ - Patch version is increased when we fix bugs.
121
125
 
122
- Add support for context and dependencies injection.
126
+ ### 5.0
123
127
 
124
- ### 4.3.0
128
+ - Add support for context and dependencies injection.
129
+ - New developement direction: `fault tolerant`.
130
+ - Renamed to `steel-frame`. **[API change]**
131
+ - Removed `forward` and `backward` functions. **[API change]**
132
+ - Removed `Debug` component. **[API change]**
125
133
 
126
- Add new function `safe` which make functions safe, errors are reported automatically.
134
+ ### 4.0 - 4.3
127
135
 
128
- ### 4.2.0
136
+ - Initial version of the framework with file based routing and building scripts (`web dev` and `web build spa`).
137
+ - Reactive values naming switched to `$` prefix. **[API change]**
138
+ - `4.1` Added SSG (static site generation) as build option `web build static`.
139
+ - `4.2` Add support for inlined conditions in JSX, binary `&&` and ternary `?:` operator.
140
+ - `4.3` Add new function `safe` which make functions safe, errors are reported automatically.
129
141
 
130
- Add support for inlined conditions in JSX, binary `&&` and ternary `?:` operator.
142
+ ### 3.0 - 3.2
131
143
 
132
- ### 4.1.0
144
+ - Switch to a babel plugin to compile components code. **[API change]**
145
+ - 100% of code has been covered with unit tests.
146
+ - New developement direction: `keep it simple`.
133
147
 
134
- Added SSG (static site generation) as build option `sf build static`.
148
+ ### 2.0 - 2.3
135
149
 
136
- ### 4.0.0
150
+ - Introduces components compilation via a typescript plugin. **[API change]**
151
+ - New developement direction: `write less, do more`.
137
152
 
138
- Initial version of the framework with file based routing and building scripts (`sf dev` and `sf build spa`).
153
+ ### 1.0 - 1.2
154
+
155
+ - Initial version of core library.
156
+ - Developemnt direction: `performance-first`.
139
157
 
140
158
  ## Questions
141
159
 
package/lib/expression.js CHANGED
@@ -33,6 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.nodeIsMeshed = nodeIsMeshed;
36
37
  exports.idIsIValue = idIsIValue;
37
38
  exports.memberIsIValue = memberIsIValue;
38
39
  exports.memberIsIValueInExpr = memberIsIValueInExpr;
@@ -83,9 +84,13 @@ function addExpression(path, search) {
83
84
  path.replaceWith(found.paramName);
84
85
  }
85
86
  }
87
+ function nodeIsMeshed(path) {
88
+ const parent = path.parent;
89
+ return (t.isMemberExpression(parent) || t.isOptionalMemberExpression(parent)) && parent.property === internal_js_1.V;
90
+ }
86
91
  function meshIdentifier(path) {
87
- if (idIsIValue(path)) {
88
- path.replaceWith(t.memberExpression(path.node, t.identifier("V")));
92
+ if (idIsIValue(path) && !nodeIsMeshed(path)) {
93
+ path.replaceWith(t.memberExpression(path.node, internal_js_1.V));
89
94
  }
90
95
  }
91
96
  function idIsIValue(path) {
@@ -131,8 +136,8 @@ function exprIsSure(path, internal) {
131
136
  return (reactivityData && reactivityData[propPath]) || t.isMemberExpression(path.parent);
132
137
  }
133
138
  function meshMember(path) {
134
- if (memberIsIValue(path.node)) {
135
- path.replaceWith(t.memberExpression(path.node, t.identifier("V"), false, true));
139
+ if (memberIsIValue(path.node) && !nodeIsMeshed(path)) {
140
+ path.replaceWith(t.memberExpression(path.node, internal_js_1.V, false, true));
136
141
  }
137
142
  }
138
143
  function meshLValue(path, internal) {
package/lib/internal.js CHANGED
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.inspector = exports.runner = exports.ctx = exports.StackedStates = void 0;
36
+ exports.V = exports.inspector = exports.runner = exports.ctx = exports.StackedStates = void 0;
37
37
  const t = __importStar(require("@babel/types"));
38
38
  class StackedStates {
39
39
  maps = [];
@@ -66,3 +66,4 @@ exports.StackedStates = StackedStates;
66
66
  exports.ctx = t.identifier("Vasille");
67
67
  exports.runner = t.memberExpression(exports.ctx, t.identifier("runner"));
68
68
  exports.inspector = t.memberExpression(exports.runner, t.identifier("inspector"));
69
+ exports.V = t.identifier("V");
package/lib/lib.js CHANGED
@@ -86,7 +86,7 @@ function processCalculateCall(path, internal, area, name) {
86
86
  path.node.arguments.unshift(internal.isComposing ? internal_js_1.ctx : t.nullLiteral());
87
87
  path.node.arguments.push(t.arrayExpression([...exprData.found.values()].map(item => item.node)));
88
88
  if (internal.devLayer) {
89
- path.node.arguments.push(t.arrayExpression([...exprData.found.keys()].map(name => t.identifier(name))), (0, transformer_1.nodeToStaticPosition)(area), (0, transformer_1.inspectorOf)(internal));
89
+ path.node.arguments.push(t.arrayExpression([...exprData.found.keys()].map(name => t.stringLiteral(name))), (0, transformer_1.nodeToStaticPosition)(area), (0, transformer_1.inspectorOf)(internal));
90
90
  /* istanbul ignore else */
91
91
  if (name) {
92
92
  path.replaceWith(internal.shareStateById(path.node, name));
package/lib/mesh.js CHANGED
@@ -125,8 +125,8 @@ function meshExpression(nodePath, internal) {
125
125
  break;
126
126
  }
127
127
  case "Identifier": {
128
- if ((0, expression_js_1.idIsIValue)(nodePath)) {
129
- nodePath.replaceWith(t.memberExpression(expr, t.identifier("V")));
128
+ if ((0, expression_js_1.idIsIValue)(nodePath) && !(0, expression_js_1.nodeIsMeshed)(nodePath)) {
129
+ nodePath.replaceWith(t.memberExpression(expr, internal_js_1.V));
130
130
  }
131
131
  break;
132
132
  }
@@ -265,12 +265,12 @@ function meshExpression(nodePath, internal) {
265
265
  if (t.isExpression(property) && !t.isIdentifier(property)) {
266
266
  meshOrIgnoreExpression(path.get("property"), internal);
267
267
  }
268
- if ((0, expression_js_1.memberIsIValue)(node)) {
268
+ if ((0, expression_js_1.memberIsIValue)(node) && !(0, expression_js_1.nodeIsMeshed)(path)) {
269
269
  if ((0, expression_js_1.exprIsSure)(path, internal)) {
270
- path.replaceWith(t.memberExpression(path.node, t.identifier("V")));
270
+ path.replaceWith(t.memberExpression(path.node, internal_js_1.V));
271
271
  }
272
272
  else {
273
- path.replaceWith(t.optionalMemberExpression(path.node, t.identifier("V"), false, true));
273
+ path.replaceWith(t.optionalMemberExpression(path.node, internal_js_1.V, false, true));
274
274
  }
275
275
  }
276
276
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babel-plugin-vasille",
3
- "version": "5.0.0",
3
+ "version": "5.0.2",
4
4
  "description": "Convert Vasille Meta Language code to pure JavaScript",
5
5
  "main": "lib/index.js",
6
6
  "type": "commonjs",