spotcharge-types 1.0.362 → 1.0.363

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.
@@ -24,6 +24,7 @@ export interface AdminVehicleListItemApiModel {
24
24
  type: VehicleTypeCatalog;
25
25
  vehicleBrandId: string;
26
26
  isActive: boolean;
27
+ year: number | null;
27
28
  brand: AdminVehicleBrandListItemApiModel;
28
29
  createdAt: string;
29
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"vehicle.api.model.d.ts","sourceRoot":"","sources":["../../../../src/models/api/catalog/vehicle.api.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EACL,iCAAiC,EAElC,MAAM,2BAA2B,CAAC;AAEnC,uDAAuD;AACvD,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,WAAW,CAAC;AAEvD,MAAM,WAAW,+BAA+B;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,6BAA6B;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,IAAI,EAAE,kBAAkB,CAAC;IACzB,KAAK,EAAE,+BAA+B,CAAC;CACxC;AAED,MAAM,WAAW,4BAA4B;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,IAAI,EAAE,kBAAkB,CAAC;IACzB,cAAc,EAAE,MAA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C;IACtB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spotcharge-types",
3
- "version": "1.0.362",
3
+ "version": "1.0.363",
4
4
  "description": "Spotcharge typesn",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -31,6 +31,7 @@ export interface AdminVehicleListItemApiModel {
31
31
  type: VehicleTypeCatalog;
32
32
  vehicleBrandId: string;
33
33
  isActive: boolean;
34
+ year: number | null;
34
35
  brand: AdminVehicleBrandListItemApiModel;
35
36
  createdAt: string;
36
37
  }
@@ -1,15 +1,8 @@
1
1
  #!/usr/bin/env bash
2
2
  #
3
- # Build local spotcharge-types and copy it into sibling project node_modules.
4
- # Never runs `npm install file:...` — that writes file:../spotcharge-types into
5
- # package.json and lockfiles, and some npm versions ignore --no-save.
6
- #
7
- # Bumps the local patch version first so unpublished work is not stuck on an
8
- # already-published number (npm install / IDEs treat that as "already have it").
9
- # Skip the bump with SYNC_NO_BUMP=1.
10
- #
11
- # Discovers sibling packages that depend on spotcharge-types (skips git/gitlab
12
- # specs). Pins each package.json to ^<version> and copies dist + src.
3
+ # Remove each sibling's node_modules/spotcharge-types, then install the
4
+ # published latest from npm. Does not copy the local tree and does not
5
+ # write file: specs.
13
6
  #
14
7
  # Usage (from spotcharge-types):
15
8
  # ./sync-types-to-repos.sh
@@ -35,26 +28,6 @@ fail() {
35
28
  exit 1
36
29
  }
37
30
 
38
- read_types_version() {
39
- node -p "require('$TYPES_DIR/package.json').version"
40
- }
41
-
42
- bump_local_patch() {
43
- if [[ "${SYNC_NO_BUMP:-}" == "1" ]]; then
44
- log "SYNC_NO_BUMP=1 — keeping spotcharge-types@$(read_types_version)"
45
- return 0
46
- fi
47
-
48
- local before after
49
- before="$(read_types_version)"
50
- log "Bumping patch ${before} → next (unpublished local sync)..."
51
- cd "$TYPES_DIR" || fail "cannot cd to $TYPES_DIR"
52
- npm version patch --no-git-tag-version >/dev/null
53
- after="$(read_types_version)"
54
- log " ${GREEN}${before} → ${after}${NC}"
55
- }
56
-
57
- # Sibling packages with a semver/file: spotcharge-types dep. Skips git hosts.
58
31
  discover_targets() {
59
32
  node - "$PROJECTS_ROOT" "$TYPES_DIR" <<'EOF'
60
33
  const fs = require('fs');
@@ -112,155 +85,63 @@ process.stdout.write(out.join('\n') + (out.length ? '\n' : ''));
112
85
  EOF
113
86
  }
114
87
 
115
- # Surgical string replace — do not JSON.parse/stringify lockfiles (preserves formatting).
116
- pin_types_spec() {
88
+ remove_installed_types() {
117
89
  local project_dir="$1"
118
- local published_spec="$2"
119
- local types_version="$3"
120
- node - "$project_dir" "$published_spec" "$types_version" <<'EOF'
121
- const fs = require('fs');
122
- const path = require('path');
123
-
124
- const projectDir = process.argv[2];
125
- const publishedSpec = process.argv[3];
126
- const typesVersion = process.argv[4];
127
- const files = ['package.json', 'package-lock.json', 'npm-shrinkwrap.json'];
128
-
129
- const pinSpecs = (raw) =>
130
- raw
131
- .replace(/("spotcharge-types"\s*:\s*)"(file:[^"]+|\^?\d+\.\d+\.\d+)"/g, `$1"${publishedSpec}"`)
132
- .replace(/\n "\.\.(?:\/\.\.)*\/spotcharge-types": \{[\s\S]*?\n \},/g, '')
133
- .replace(
134
- / "node_modules\/spotcharge-types": \{\s*"resolved": "(?:\.\.\/)+spotcharge-types",\s*"link": true\s*\}/g,
135
- [
136
- ' "node_modules/spotcharge-types": {',
137
- ` "version": "${typesVersion}",`,
138
- ' "license": "ISC"',
139
- ' }',
140
- ].join('\n')
141
- );
142
-
143
- const changed = [];
144
- for (const name of files) {
145
- const filePath = path.join(projectDir, name);
146
- if (!fs.existsSync(filePath)) {
147
- continue;
148
- }
149
- const raw = fs.readFileSync(filePath, 'utf8');
150
- const next = pinSpecs(raw);
151
- if (next !== raw) {
152
- fs.writeFileSync(filePath, next);
153
- changed.push(name);
154
- }
155
- }
156
-
157
- if (changed.length) {
158
- process.stdout.write(`pinned spotcharge-types@${publishedSpec} in ${changed.join(', ')}\n`);
159
- }
160
- EOF
161
- }
90
+ local dest="$project_dir/node_modules/spotcharge-types"
162
91
 
163
- has_file_spec() {
164
- local file_path="$1"
165
- [[ -f "$file_path" ]] && grep -qE '"spotcharge-types"[[:space:]]*:[[:space:]]*"file:' "$file_path"
166
- }
92
+ shopt -s nullglob
93
+ rm -rf "$project_dir"/node_modules/.spotcharge-types-*
94
+ shopt -u nullglob
167
95
 
168
- copy_types_into_node_modules() {
169
- local project_dir="$1"
170
- local dest="$project_dir/node_modules/spotcharge-types"
171
- local tmp="${dest}.syncing.$$"
172
-
173
- mkdir -p "$project_dir/node_modules"
174
- rm -rf "$tmp"
175
- mkdir -p "$tmp/dist"
176
- cp "$TYPES_DIR/package.json" "$tmp/package.json"
177
- cp -R "$TYPES_DIR/dist/." "$tmp/dist/"
178
- if [[ -d "$TYPES_DIR/src" ]]; then
179
- mkdir -p "$tmp/src"
180
- cp -R "$TYPES_DIR/src/." "$tmp/src/"
96
+ if [[ ! -e "$dest" ]]; then
97
+ log " no node_modules/spotcharge-types"
98
+ return 0
181
99
  fi
182
100
 
183
- mkdir -p "$dest"
184
- # Replace package files in place. Ignore leftover .cursor/.idea — those get
185
- # copied into node_modules when dest was once a full-repo copy, and the
186
- # sandbox/IDE often locks them so `rm -rf dest` cannot finish.
187
- if command -v rsync >/dev/null 2>&1; then
188
- rsync -a --delete --exclude '.cursor/' --exclude '.idea/' "$tmp/" "$dest/"
189
- else
190
- rm -rf "$dest/dist" "$dest/src" "$dest/package.json"
191
- cp "$tmp/package.json" "$dest/package.json"
192
- cp -R "$tmp/dist" "$dest/dist"
193
- if [[ -d "$tmp/src" ]]; then
194
- cp -R "$tmp/src" "$dest/src"
195
- fi
101
+ chmod -R u+w "$dest" 2>/dev/null || true
102
+ rm -rf "$dest"
103
+ if [[ -e "$dest" ]]; then
104
+ fail "could not remove $dest (file busy?). Close anything watching that folder and retry."
196
105
  fi
197
- rm -rf "$tmp"
198
- rm -rf "$dest/.cursor" "$dest/.idea" 2>/dev/null || true
106
+ log " removed node_modules/spotcharge-types"
199
107
  }
200
108
 
201
- verify_copy() {
109
+ install_latest() {
202
110
  local project_dir="$1"
203
- local label="$2"
204
- local types_version="$3"
205
- local published_spec="$4"
206
- node - "$project_dir" "$label" "$types_version" "$published_spec" "$TYPES_DIR" <<'EOF'
207
- const fs = require('fs');
208
- const path = require('path');
111
+ local latest="$2"
209
112
 
210
- const projectDir = process.argv[2];
211
- const label = process.argv[3];
212
- const typesVersion = process.argv[4];
213
- const publishedSpec = process.argv[5];
214
- const typesDir = process.argv[6];
215
- const dest = path.join(projectDir, 'node_modules', 'spotcharge-types');
216
- const issues = [];
217
-
218
- const pkg = JSON.parse(fs.readFileSync(path.join(projectDir, 'package.json'), 'utf8'));
219
- const spec =
220
- (pkg.dependencies && pkg.dependencies['spotcharge-types']) ||
221
- (pkg.devDependencies && pkg.devDependencies['spotcharge-types']);
222
- if (spec !== publishedSpec) {
223
- issues.push(`package.json spec is ${spec}, expected ${publishedSpec}`);
224
- }
113
+ log " npm install spotcharge-types@${latest}"
114
+ cd "$project_dir" || fail "cannot cd to $project_dir"
225
115
 
226
- if (!fs.existsSync(path.join(dest, 'package.json'))) {
227
- issues.push('node_modules/spotcharge-types missing');
228
- } else {
229
- const copied = JSON.parse(fs.readFileSync(path.join(dest, 'package.json'), 'utf8'));
230
- if (copied.version !== typesVersion) {
231
- issues.push(`copied version ${copied.version} != ${typesVersion}`);
232
- }
233
- }
116
+ if npm install "spotcharge-types@${latest}"; then
117
+ return 0
118
+ fi
234
119
 
235
- for (const rel of ['dist/index.js', 'dist/index.d.ts']) {
236
- if (!fs.existsSync(path.join(dest, rel))) {
237
- issues.push(`missing ${rel}`);
238
- }
120
+ log " ${YELLOW}retrying with --legacy-peer-deps${NC}"
121
+ npm install --legacy-peer-deps "spotcharge-types@${latest}"
239
122
  }
240
123
 
241
- if (fs.existsSync(path.join(typesDir, 'src')) && !fs.existsSync(path.join(dest, 'src'))) {
242
- issues.push('missing src (needed for declaration maps)');
243
- }
124
+ verify_installed() {
125
+ local project_dir="$1"
126
+ local label="$2"
127
+ local latest="$3"
128
+ local dest="$project_dir/node_modules/spotcharge-types/package.json"
244
129
 
245
- const catalogSrc = path.join(typesDir, 'dist', 'models', 'api', 'catalog', 'index.d.ts');
246
- const catalogDest = path.join(dest, 'dist', 'models', 'api', 'catalog', 'index.d.ts');
247
- if (fs.existsSync(catalogSrc) && !fs.existsSync(catalogDest)) {
248
- issues.push('missing catalog d.ts');
249
- }
130
+ if [[ ! -f "$dest" ]]; then
131
+ fail "$label — spotcharge-types missing after install"
132
+ fi
250
133
 
251
- if (issues.length) {
252
- process.stderr.write(`${label}: ${issues.join('; ')}\n`);
253
- process.exit(1);
254
- }
255
- EOF
134
+ local installed
135
+ installed="$(node -p "require('$dest').version")"
136
+ if [[ "$installed" != "$latest" ]]; then
137
+ fail "$label — installed ${installed}, expected ${latest}"
138
+ fi
256
139
  }
257
140
 
258
141
  install_types_in() {
259
142
  local project_dir="$1"
260
143
  local label="$2"
261
- local types_version="$3"
262
- local published_spec="$4"
263
- local pin_out
144
+ local latest="$3"
264
145
 
265
146
  if [[ ! -d "$project_dir" ]]; then
266
147
  log "${YELLOW}SKIP${NC} $label — directory not found: $project_dir"
@@ -273,37 +154,18 @@ install_types_in() {
273
154
  fi
274
155
 
275
156
  log "\n${GREEN}==>${NC} $label"
276
-
277
- pin_out="$(pin_types_spec "$project_dir" "$published_spec" "$types_version")"
278
- if [[ -n "$pin_out" ]]; then
279
- log " ${YELLOW}${pin_out}${NC}"
280
- fi
281
-
282
- if has_file_spec "$project_dir/package.json"; then
283
- log " ${RED}file: spec still present in package.json${NC}"
284
- return 1
285
- fi
286
-
287
- log " copying spotcharge-types@${types_version} into node_modules"
288
- copy_types_into_node_modules "$project_dir"
289
- verify_copy "$project_dir" "$label" "$types_version" "$published_spec"
290
- log " ${GREEN}ok${NC}"
157
+ remove_installed_types "$project_dir"
158
+ install_latest "$project_dir" "$latest"
159
+ verify_installed "$project_dir" "$label" "$latest"
160
+ log " ${GREEN}ok${NC} spotcharge-types@${latest}"
291
161
  }
292
162
 
293
163
  main() {
294
- cd "$TYPES_DIR" || fail "cannot cd to $TYPES_DIR"
295
- bump_local_patch
296
-
297
- local types_version published_spec
298
- types_version="$(read_types_version)"
299
- published_spec="^${types_version}"
300
-
301
- log "Building spotcharge-types@${types_version}..."
302
- npm start || fail "types build failed (npm start)"
303
-
304
- if [[ ! -f "$TYPES_DIR/dist/index.js" ]]; then
305
- fail "build output missing: dist/index.js — run npm start in spotcharge-types first"
306
- fi
164
+ local latest
165
+ log "Resolving latest spotcharge-types from npm..."
166
+ latest="$(npm view spotcharge-types version)"
167
+ [[ -n "$latest" ]] || fail "npm view spotcharge-types version returned empty"
168
+ log " latest is ${GREEN}${latest}${NC}"
307
169
 
308
170
  local targets=()
309
171
  local line
@@ -320,16 +182,15 @@ main() {
320
182
  local failed=0
321
183
  local target
322
184
  for target in "${targets[@]}"; do
323
- install_types_in "$PROJECTS_ROOT/$target" "$target" "$types_version" "$published_spec" || failed=$((failed + 1))
185
+ install_types_in "$PROJECTS_ROOT/$target" "$target" "$latest" || failed=$((failed + 1))
324
186
  done
325
187
 
326
188
  log ""
327
189
  if [[ "$failed" -gt 0 ]]; then
328
- fail "$failed project(s) failed to install spotcharge-types"
190
+ fail "$failed project(s) failed to install spotcharge-types@${latest}"
329
191
  fi
330
192
 
331
- log "${GREEN}Done.${NC} spotcharge-types@${types_version} synced."
332
- log "package.json uses ${published_spec}. Do not npm install in consumers until this version is published, or re-run sync-repos after."
193
+ log "${GREEN}Done.${NC} spotcharge-types@${latest} installed from npm."
333
194
  }
334
195
 
335
196
  main "$@"