> For the complete documentation index, see [llms.txt](https://sygnal.gitbook.io/sygnal-webflow-components/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sygnal.gitbook.io/sygnal-webflow-components/cc/technical-notes/sygnals-code-components-development-framework/updates-to-build-scripts.md).

# Updates to Build Scripts

Updating @sygnal/code-component&#x20;

<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`:

```javascript
"publishConfig": {
  "access": "public"
}
```

## NPM Link Workflow Guide

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

### What is npm link?

`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)

#### 1. Link the package globally

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

```bash
cd d:\projects\sygnal-webflow-component
npm link
```

This creates a global symlink to this package.

#### 2. Link in your consuming project

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

```bash
cd d:\Projects\sygnal-forms
npm link @sygnal/code-component
```

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

```bash
cd d:\Projects\sygnal-forms
npm run deploy  # Uses your local linked version
```

#### If something breaks

Re-link to refresh the symlink:

```bash
cd d:\projects\sygnal-webflow-component
npm link --force

cd d:\Projects\sygnal-forms
npm link @sygnal/code-component
```

### Publishing Workflow

When ready to publish changes:

#### 1. Update version in package.json

```bash
cd d:\projects\sygnal-webflow-component
# Edit package.json - bump version (e.g., 0.2.0 -> 0.2.1)
```

#### 2. Publish to npm

```bash
npm publish
```

#### 3. Update consuming projects

In your projects, you can either:

**Option A: Keep using link** (for active development)

```bash
# Do nothing - keep using the link
```

**Option B: Switch back to npm** (for production)

```bash
npm unlink @sygnal/code-component
npm install @sygnal/code-component@latest
```

### Troubleshooting

#### "Module not found"

The link might be broken. Re-link:

```bash
cd d:\projects\sygnal-webflow-component && npm link --force
cd d:\Projects\sygnal-forms && npm link @sygnal/code-component
```

#### "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:

```bash
cd d:\Projects\sygnal-forms
npm unlink @sygnal/code-component
npm install @sygnal/code-component
```

### Current Status

✓ Package linked globally: `@sygnal/code-component` ✓ Linked in: `sygnal-forms` ✓ Version: 0.2.0 (local development)

### Benefits of npm link

* ⚡ **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
