dappbooster 3.3.1 → 3.3.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.
@@ -114,6 +114,24 @@ function scriptTargetsRemovedDir(command, removedDirs) {
114
114
  const tokens = command.split(/\s+/);
115
115
  return removedDirs.some((dir) => tokens.some((token) => token === dir || token.startsWith(`${dir}/`)));
116
116
  }
117
+ function workspaceEntryRemoved(entry, removedDirs) {
118
+ return removedDirs.some((dir) => entry === dir || entry.startsWith(`${dir}/`));
119
+ }
120
+ // Drop workspaces entries pointing at a removed dir. Handles both the string[] and { packages }
121
+ // forms (other object keys preserved); mutates in place.
122
+ function pruneRemovedWorkspaces(packageJson, removedDirs) {
123
+ if (removedDirs.length === 0) {
124
+ return;
125
+ }
126
+ const { workspaces } = packageJson;
127
+ const keep = (entry) => !workspaceEntryRemoved(entry, removedDirs);
128
+ if (Array.isArray(workspaces)) {
129
+ packageJson.workspaces = workspaces.filter(keep);
130
+ }
131
+ else if (workspaces && Array.isArray(workspaces.packages)) {
132
+ workspaces.packages = workspaces.packages.filter(keep);
133
+ }
134
+ }
117
135
  function patchPackageJsonCanton(projectFolder, removedDirs, precommitRemoved) {
118
136
  const packageJsonPath = resolve(projectFolder, 'package.json');
119
137
  const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
@@ -125,6 +143,8 @@ function patchPackageJsonCanton(projectFolder, removedDirs, precommitRemoved) {
125
143
  }
126
144
  }
127
145
  }
146
+ // Removed dirs also drop out of the workspaces array, else the manifest lists a missing dir.
147
+ pruneRemovedWorkspaces(packageJson, removedDirs);
128
148
  // The husky tooling (prepare/commitlint scripts + husky/lint-staged/commitlint deps) only leaves
129
149
  // with the pre-commit feature.
130
150
  if (precommitRemoved) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dappbooster",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "description": "Agent-friendly dAppBooster installer that scaffolds Web3 dApps via TUI or non-interactive CLI/CI.",
5
5
  "keywords": [
6
6
  "dappbooster",