shared-hosting-sync 0.1.0 → 0.1.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.1 — 26 October 2026
4
+
5
+ - Fix dashboard “Edit setup” so saved projects can change their local folder,
6
+ including after the original folder has moved.
7
+ - Retain the existing project, saved credentials, and server destination when
8
+ changing folders, and load environment settings from the replacement folder.
9
+ - Reject replacement folders already assigned to another project.
10
+
3
11
  ## 0.1.0 — 21 October 2026
4
12
 
5
13
  First release of shared-hosting-sync, developed under the devsync name.
package/PHASES.md CHANGED
@@ -118,7 +118,7 @@ conflicts, crashed owners, and dashboard/CLI coordination. Locks are local to on
118
118
  machine/settings store and do not detect remote aliases or other deployment tools.
119
119
  Production-host checks and cross-platform installation remain release work.
120
120
 
121
- ## Phase 6: npm release — 0.1.0
121
+ ## Phase 6: npm release — 0.1.0 published 21 October 2026
122
122
 
123
123
  - Package and primary command renamed to `shared-hosting-sync`; `devsync` remains
124
124
  an alias, with compatible settings and environment variables.
@@ -137,5 +137,11 @@ Production-host checks and cross-platform installation remain release work.
137
137
  registry acceptance. Registry installation confirms publication; see RELEASING.md
138
138
  for the verification steps.
139
139
 
140
+ Published [shared-hosting-sync@0.1.0](https://www.npmjs.com/package/shared-hosting-sync/v/0.1.0)
141
+ with `latest` pointing to 0.1.0. Windows, Linux, and macOS release checks passed.
142
+ The registry tarball matches the validated archive byte for byte (SHA-256
143
+ `e2301a79bc1aa64f28262b929c7b57c9447dfba6c82bc2c5b56b0b476f2c6a6e`).
144
+ A fresh registry installation verified both command aliases and SQLite startup.
145
+
140
146
  After release: GitHub Actions integration, deployment history, rollback, and
141
147
  optional remote deletion.
package/README.md CHANGED
@@ -357,27 +357,6 @@ FTPS certificates must pass normal certificate verification. Self-signed or
357
357
  expired hosting certificates need correction or an appropriately trusted CA;
358
358
  devsync does not silently bypass verification.
359
359
 
360
- ## Current implementation
361
-
362
- The package is in development. Before relying on it for deployments:
363
-
364
- - CLI onboarding, `.env` discovery, hidden password prompts, server-folder
365
- selection, and `deploy` are implemented in Phase 2.
366
- - Phase 4 adds UI upload previews, deploy/sync, watch start/stop, progress, and
367
- actionable file errors through the shared deployment engine.
368
- - Phase 5 adds shared CLI/UI locks, transient connection recovery, watch retries,
369
- exclusion previews in the CLI, and real local FTPS/SFTP integration checks.
370
- - Phase 3 adds complete UI onboarding, local/server folder pickers, secure
371
- imported settings, and reviewed project saving.
372
- - Phase 1 fixes destination handling, same-size change detection, path validation,
373
- and failed-sync status. See [PHASES.md](PHASES.md) for the implementation milestones.
374
- - Phase 6 prepares `shared-hosting-sync@0.1.0`, including production-only packaging,
375
- global installation checks, and Windows/Linux/macOS release checks in CI.
376
- See [RELEASING.md](RELEASING.md) for maintainer publication instructions.
377
-
378
- See [PRODUCT.md](PRODUCT.md) for product requirements and [ROADMAP.md](ROADMAP.md)
379
- for historical design notes. PHASES.md tracks the current release sequence.
380
-
381
360
  ## Development
382
361
 
383
362
  ```sh
@@ -401,6 +380,18 @@ directory. It writes a tarball, manifest, and SHA-256 checksum to `artifacts/`.
401
380
  Tests, fixtures, development scripts, local state, and credentials are excluded
402
381
  from the published package. See [RELEASING.md](RELEASING.md) for the release process.
403
382
 
383
+ ## Buy me a coffee ☕
384
+
385
+ If shared-hosting-sync saves you time, consider buying me a coffee. Your support
386
+ helps keep the project growing.
387
+
388
+ You can send your support to either number:
389
+
390
+ - **+256757035774**
391
+ - **+256789291098**
392
+
393
+ Thank you for supporting the project!
394
+
404
395
  ## License
405
396
 
406
397
  MIT. See [LICENSE](LICENSE).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-hosting-sync",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Deploy and sync local projects to shared hosting over FTP, FTPS, or SFTP, with a CLI and local dashboard.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -12,7 +12,7 @@ const present = (value) => value !== undefined && value !== null && value !== ''
12
12
 
13
13
  export function resolveEnv(projectId, { transport = 'sftp', envFile, localPath, overrides = {}, useEnvFileEnvironment = true } = {}) {
14
14
  const project = projectId == null ? null : getProject(projectId)
15
- localPath = project?.localPath || localPath
15
+ localPath = localPath || project?.localPath
16
16
  if (!localPath) throw new Error('A local project folder is required')
17
17
  const values = { ...defaultsFor(transport) }
18
18
  const sources = Object.fromEntries(ENV_SCHEMA.map((s) => [s.key, 'default']))
@@ -72,7 +72,10 @@ export class OnboardingService {
72
72
  if (this.drafts.size >= 50) throw fail('Too many open setups. Close a setup and try again.', 429)
73
73
  let project = projectId ? getProject(Number(projectId)) : null
74
74
  if (projectId && !project) throw fail('Project not found', 404)
75
- const folder = assertLocalFolder(project?.localPath || localPath)
75
+ // An existing project can be repaired even after its original folder moved.
76
+ const folder = project && localPath === undefined ? project.localPath : assertLocalFolder(localPath)
77
+ const owner = getProjectByLocalPath(folder)
78
+ if (project && owner && owner.id !== project.id) throw fail('That local folder belongs to another project', 409)
76
79
  project ||= getProjectByLocalPath(folder)
77
80
  this.ensureEditable(project?.id)
78
81
  const resolved = resolveEnv(project?.id, { localPath: folder, useEnvFileEnvironment: false })
@@ -164,6 +167,8 @@ export class OnboardingService {
164
167
  label = label.trim()
165
168
  const duplicate = getProjectByLabel(label)
166
169
  if (duplicate && duplicate.id !== draft.projectId) throw fail('That project name is already in use', 409)
170
+ const owner = getProjectByLocalPath(draft.localPath)
171
+ if (owner && owner.id !== draft.projectId) throw fail('That local folder belongs to another project', 409)
167
172
  const errors = ENV_SCHEMA.map((schema) => settingError(schema.key, draft.values[schema.key], draft.values)).filter(Boolean)
168
173
  if (errors.length) throw fail(errors.join('; '))
169
174
  if (!draft.tested) throw fail('Test the connection before saving', 409)
@@ -179,7 +184,7 @@ export class OnboardingService {
179
184
  project ||= createProject({ label, localPath: draft.localPath })
180
185
  mutateProject(project.id, () => {
181
186
  saveConfiguration(project.id, draft.values, { sources: draft.sources })
182
- if (project.label !== label) updateProject(project.id, { label })
187
+ updateProject(project.id, { label, local_path: draft.localPath })
183
188
  })
184
189
  } catch (error) {
185
190
  if (created && project) deleteProject(project.id)
package/src/ui/ui.js CHANGED
@@ -118,7 +118,7 @@ function renderWizard() {
118
118
  renderedStep = step
119
119
  let content = ''
120
120
  if (step === 1) {
121
- content = `<h2>Where are your project files?</h2><p>Choose the folder you want to deploy. For a built frontend, choose its dist or build folder.</p><form id="localForm"><div class="field"><label for="localPath">Local project folder</label><div class="path-row"><input id="localPath" value="${esc(draft?.localPath || '')}" placeholder="Absolute path to a project folder" ${draft?.projectId ? 'readonly' : ''}><button class="secondary" type="button" id="openLocal" ${draft?.projectId ? 'disabled' : ''}>Browse folders</button></div><span class="help">Only hosting settings named DEVSYNC_* are read from this folder’s .env.</span></div><div id="localPicker"></div><div class="actions"><button class="secondary" type="button" id="cancelSetup">Cancel</button><span class="spacer"></span><button class="primary" type="submit">Continue to hosting</button></div></form>`
121
+ content = `<h2>Where are your project files?</h2><p>Choose the folder you want to deploy. For a built frontend, choose its dist or build folder.</p><form id="localForm"><div class="field"><label for="localPath">Local project folder</label><div class="path-row"><input id="localPath" value="${esc(draft?.localPath || '')}" placeholder="Absolute path to a project folder"><button class="secondary" type="button" id="openLocal">Browse folders</button></div><span class="help">Only hosting settings named DEVSYNC_* are read from this folder’s .env.</span></div><div id="localPicker"></div><div class="actions"><button class="secondary" type="button" id="cancelSetup">Cancel</button><span class="spacer"></span><button class="primary" type="submit">Continue to hosting</button></div></form>`
122
122
  } else if (step === 2) {
123
123
  const transport = draft.values.DEVSYNC_TRANSPORT
124
124
  const loaded = Object.entries(draft.sources).filter(([, value]) => value === '.env' || value === '.devsync.env').length
@@ -139,7 +139,7 @@ function renderWizard() {
139
139
  const localPath = $('#localPath').value.trim()
140
140
  if (!localPath) throw new Error('Choose a local project folder first')
141
141
  if (!draft || localPath !== draft.localPath) {
142
- const loaded = await api('POST', '/api/onboarding', { localPath })
142
+ const loaded = await api('POST', '/api/onboarding', { localPath, ...(draft?.projectId ? { projectId: draft.projectId } : {}) })
143
143
  if (draft) try { await api('DELETE', `/api/onboarding/${draft.id}`) } catch {}
144
144
  state.draft = loaded
145
145
  state.fileOverrides = false
@@ -255,7 +255,7 @@ async function openProject(id) {
255
255
  const values = config.values
256
256
  $('#pane').innerHTML = `<p class="eyebrow">SAVED PROJECT</p><div class="summary-head"><div><h1>${esc(data.label)}</h1><p class="sub">${esc(data.localPath)}</p></div><span class="ready">● ${Object.keys(config.errors).length ? 'Setup needed' : 'Project configured'}</span></div><div id="message" class="notice"></div><section class="summary-card"><h2>Source → destination</h2><dl class="review"><dt>Local source</dt><dd>${esc(data.localPath)}</dd><dt>Server folder</dt><dd>${esc(values.DEVSYNC_REMOTE_PATH || 'Not configured')}</dd><dt>Connection</dt><dd>${esc(values.DEVSYNC_TRANSPORT?.toUpperCase())} · ${esc(values.DEVSYNC_HOST || 'Not configured')}:${esc(values.DEVSYNC_PORT)}</dd><dt>Username</dt><dd>${esc(values.DEVSYNC_USERNAME || 'Not configured')}</dd><dt>Credentials</dt><dd>${config.secrets.DEVSYNC_PASSWORD || config.secrets.DEVSYNC_PRIVATE_KEY ? 'Supplied · never shown in this browser' : 'Not configured'}</dd></dl><div class="actions"><button class="primary" id="editProject">Edit setup</button><button class="secondary" id="testProject">Test connection</button><span class="spacer"></span><button class="danger" id="deleteProject">Remove project</button></div></section>`
257
257
  if (Object.keys(config.errors).length) message(Object.values(config.errors).join('; '), 'warning')
258
- $('#editProject').onclick = () => act(async () => { state.draft = await api('POST', '/api/onboarding', { projectId: id }); deploymentPanel.close(); state.fileOverrides = false; state.step = 2; renderWizard() })
258
+ $('#editProject').onclick = () => act(async () => { state.draft = await api('POST', '/api/onboarding', { projectId: id }); deploymentPanel.close(); state.fileOverrides = false; state.local = null; state.remote = null; state.verifiedPath = null; state.step = 1; renderWizard() })
259
259
  $('#testProject').onclick = () => act(async () => { await api('POST', '/api/test', { projectId: id }); message('Connection test passed.', 'success') }, 'Testing your hosting connection…')
260
260
  $('#deleteProject').onclick = () => act(async () => {
261
261
  if (!confirm(`Remove "${data.label}" from devsync? Local and server files stay in place.`)) return