@superblocksteam/cli 2.0.0-next.15 → 2.0.0-next.17

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
@@ -14,7 +14,7 @@ $ npm install -g @superblocksteam/cli
14
14
  $ superblocks COMMAND
15
15
  running command...
16
16
  $ superblocks (--version)
17
- @superblocksteam/cli/2.0.0-next.15 linux-x64 node-v20.19.0
17
+ @superblocksteam/cli/2.0.0-next.17 linux-x64 node-v20.19.0
18
18
  $ superblocks --help [COMMAND]
19
19
  USAGE
20
20
  $ superblocks COMMAND
package/dist/index.js CHANGED
@@ -263726,7 +263726,7 @@ init_esm();
263726
263726
  // ../sdk/package.json
263727
263727
  var package_default = {
263728
263728
  name: "@superblocksteam/sdk",
263729
- version: "2.0.0-next.15",
263729
+ version: "2.0.0-next.17",
263730
263730
  type: "module",
263731
263731
  description: "Superblocks JS SDK",
263732
263732
  homepage: "https://www.superblocks.com",
@@ -263763,8 +263763,8 @@ var package_default = {
263763
263763
  "@rollup/wasm-node": "^4.35.0",
263764
263764
  "@superblocksteam/bucketeer-sdk": "0.4.1",
263765
263765
  "@superblocksteam/shared": "0.9132.0",
263766
- "@superblocksteam/util": "2.0.0-next.15",
263767
- "@superblocksteam/vite-plugin-file-sync": "2.0.0-next.15",
263766
+ "@superblocksteam/util": "2.0.0-next.17",
263767
+ "@superblocksteam/vite-plugin-file-sync": "2.0.0-next.17",
263768
263768
  "@vitejs/plugin-react": "^4.3.4",
263769
263769
  axios: "^1.4.0",
263770
263770
  chokidar: "^4.0.3",
@@ -277110,7 +277110,7 @@ function generateJSXAttribute(name17, info) {
277110
277110
  return import_types11.default.jsxAttribute(import_types11.default.jsxIdentifier(name17), import_types11.default.jsxExpressionContainer(valueNode));
277111
277111
  }
277112
277112
  }
277113
- function writeNestedProperty({ node, paths, info }) {
277113
+ function writeNestedProperty({ node, paths, info, isDelete = false }) {
277114
277114
  let currentNode = node;
277115
277115
  const cleanedPaths = paths.map((path45) => {
277116
277116
  if (path45.startsWith("[")) {
@@ -277128,7 +277128,14 @@ function writeNestedProperty({ node, paths, info }) {
277128
277128
  }
277129
277129
  if (currentNode.isObjectExpression()) {
277130
277130
  let property = currentNode.get("properties").find((prop) => prop.isObjectProperty() && getIdentiferName(prop.node.key) === currentKey);
277131
+ if (isDelete && cleanedPaths.length === 0) {
277132
+ property?.remove();
277133
+ return;
277134
+ }
277131
277135
  if (!property) {
277136
+ if (isDelete) {
277137
+ return;
277138
+ }
277132
277139
  const value3 = cleanedPaths.length > 0 ? import_types11.default.objectExpression([]) : import_types11.default.stringLiteral("");
277133
277140
  property = currentNode.pushContainer("properties", [
277134
277141
  import_types11.default.objectProperty(import_types11.default.identifier(currentKey.toString()), value3)
@@ -277142,7 +277149,16 @@ function writeNestedProperty({ node, paths, info }) {
277142
277149
  } else if (currentNode.isArrayExpression() && typeof currentKey === "number") {
277143
277150
  const index = currentKey;
277144
277151
  const nodeAtIndex = currentNode.get("elements")[index];
277152
+ if (isDelete && cleanedPaths.length === 0) {
277153
+ if (nodeAtIndex && nodeAtIndex.node != null) {
277154
+ nodeAtIndex.remove();
277155
+ }
277156
+ return;
277157
+ }
277145
277158
  if (!nodeAtIndex || nodeAtIndex.node == null) {
277159
+ if (isDelete) {
277160
+ return;
277161
+ }
277146
277162
  if (cleanedPaths.length > 0) {
277147
277163
  const newObjectNode = import_types11.default.objectExpression([]);
277148
277164
  if (currentNode.get("elements").length > 0) {
@@ -277171,7 +277187,7 @@ function writeNestedProperty({ node, paths, info }) {
277171
277187
  }
277172
277188
  }
277173
277189
  }
277174
- if (currentNode) {
277190
+ if (currentNode && !isDelete) {
277175
277191
  const valueNode = getPropertyExpression(info, "");
277176
277192
  currentNode.replaceWith(valueNode);
277177
277193
  }
@@ -302695,6 +302711,23 @@ var SourceTracker = class {
302695
302711
  setNestedAttribute = ({ openingTag, property, info }) => {
302696
302712
  const [parent, ...paths] = splitJSPathAdvanced(property, []);
302697
302713
  let parentAttr = openingTag.get("attributes").find((attr) => attr.isJSXAttribute() && attr.node.name.name === parent);
302714
+ if (info.value === void 0) {
302715
+ if (!parentAttr) {
302716
+ return;
302717
+ }
302718
+ const expressionContainer2 = parentAttr?.get("value");
302719
+ if (!expressionContainer2 || !expressionContainer2.isJSXExpressionContainer()) {
302720
+ return;
302721
+ }
302722
+ const currentNode2 = expressionContainer2.get("expression");
302723
+ writeNestedProperty({
302724
+ node: currentNode2,
302725
+ paths,
302726
+ info,
302727
+ isDelete: true
302728
+ });
302729
+ return;
302730
+ }
302698
302731
  if (!parentAttr && parent) {
302699
302732
  const newAttr = openingTag.pushContainer("attributes", [
302700
302733
  import_types22.default.jsxAttribute(import_types22.default.jsxIdentifier(parent), import_types22.default.jSXExpressionContainer(import_types22.default.objectExpression([])))
@@ -302797,21 +302830,6 @@ var SourceTracker = class {
302797
302830
  }
302798
302831
  }
302799
302832
  }
302800
- if (info.type === "EVENT" && jsxAttribute) {
302801
- const referencedGlobalFunctions = getVariableReferences(jsxAttribute, GLOBAL_LIBRARY_NAMES);
302802
- referencedGlobalFunctions.forEach((funcName) => {
302803
- if (!this.fileToMeta[fileName].imports[funcName]) {
302804
- addImport({
302805
- importPath: "@superblocksteam/library",
302806
- importName: funcName,
302807
- path: openingTag,
302808
- onAdd: () => {
302809
- this.fileToMeta[fileName].imports[funcName] = true;
302810
- }
302811
- });
302812
- }
302813
- });
302814
- }
302815
302833
  if (ATTRIBUTE_TYPES_WITH_STATE_ACCESS.includes(info.type) && jsxAttribute) {
302816
302834
  const elementLocation = this.getElementToLocation(source2.id);
302817
302835
  const scopeImports = this.sbScopeManager.getAndUpdateScopeImportsForCodeSnippet({
@@ -308648,7 +308666,7 @@ async function startVite({ app, httpServer: httpServer2, root: root2, mode, port
308648
308666
  };
308649
308667
  const isCustomBuildEnabled2 = await isCustomComponentsEnabled();
308650
308668
  const customFolder = path21.join(root2, "custom");
308651
- const cdnUrl = "https://assets-cdn.superblocks.com/library/2.0.0-next.15";
308669
+ const cdnUrl = "https://assets-cdn.superblocks.com/library/2.0.0-next.17";
308652
308670
  const env3 = loadEnv(mode, root2, "");
308653
308671
  const hmrPort = await getFreePort();
308654
308672
  const hmrOptions = {
@@ -509,5 +509,5 @@
509
509
  "strict": true
510
510
  }
511
511
  },
512
- "version": "2.0.0-next.15"
512
+ "version": "2.0.0-next.17"
513
513
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superblocksteam/cli",
3
- "version": "2.0.0-next.15",
3
+ "version": "2.0.0-next.17",
4
4
  "type": "module",
5
5
  "description": "Official Superblocks CLI",
6
6
  "homepage": "https://www.superblocks.com",
@@ -42,9 +42,9 @@
42
42
  "devDependencies": {
43
43
  "@eslint/js": "^9.16.0",
44
44
  "@oclif/test": "^4.1.11",
45
- "@superblocksteam/sdk": "2.0.0-next.15",
45
+ "@superblocksteam/sdk": "2.0.0-next.17",
46
46
  "@superblocksteam/shared": "0.9132.0",
47
- "@superblocksteam/util": "2.0.0-next.15",
47
+ "@superblocksteam/util": "2.0.0-next.17",
48
48
  "@types/babel__core": "^7.20.0",
49
49
  "@types/chai": "^4",
50
50
  "@types/fs-extra": "^11.0.1",