Updates to Build Scripts

Updating @sygnal/code-component

https://www.npmjs.com/package/@sygnal/code-component

npm publish --access=public

Update: The --access=public argument is needed to make the scoped package public - otherwise it will be private by default. Instead of the command-line argument you can set access to "public" in the publishConfig section of your package.json:

"publishConfig": {
  "access": "public"
}

This guide explains how to use npm link for local development of @sygnal/code-component.

npm link creates a symlink from your global node_modules to your local package directory. This allows you to:

  • Test package changes instantly in consuming projects

  • Avoid publishing to npm for every small change

  • Develop and test simultaneously

Setup (One-time)

In the package directory (sygnal-webflow-component):

This creates a global symlink to this package.

In your project directory (e.g., sygnal-forms):

This replaces the npm-installed version with your local development version.

Daily Workflow

Making changes

  1. Edit files in d:\projects\sygnal-webflow-component\

  2. Test immediately in your project - changes are live!

  3. No need to run any commands - the symlink means changes are instant

Testing changes

If something breaks

Re-link to refresh the symlink:

Publishing Workflow

When ready to publish changes:

1. Update version in package.json

2. Publish to npm

3. Update consuming projects

In your projects, you can either:

Option A: Keep using link (for active development)

Option B: Switch back to npm (for production)

Troubleshooting

"Module not found"

The link might be broken. Re-link:

"Old code is running"

Node.js might have cached the old module. Clear the require cache or restart your terminal.

"Want to switch back to npm version"

Unlink and reinstall:

Current Status

βœ“ Package linked globally: @sygnal/code-component βœ“ Linked in: sygnal-forms βœ“ Version: 0.2.0 (local development)

  • ⚑ Instant feedback - No build/publish cycle

  • πŸ”„ Two-way development - Work on package and project simultaneously

  • πŸ§ͺ Safe testing - Test changes before publishing

  • πŸ’° Cost-free - No need to publish test versions to npm

Last updated