Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions .github/workflows/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,29 @@ jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: ['20.x', '22.x']

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/iron'
- uses: actions/cache@v4
id: npm-cache
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- run: npm test
- name: Build project
run: npm run build
- name: Run tests
run: npm test
- name: Verify built files exist
run: |
test -f dist/index.js || exit 1
test -f dist/index.cjs || exit 1
echo "✅ Both ESM and CommonJS builds exist"
- name: Test CLI functionality (ESM)
run: node dist/index.js --help || echo "Expected error - no extension.json in root"
- name: Test CLI functionality (CommonJS)
run: node dist/index.cjs --help || echo "Expected error - no extension.json in root"
33 changes: 21 additions & 12 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:
inputs:
tag:
description: 'The tag to publish to: latest | next'
description: 'The tag to publish to: latest | next | beta'
required: false
default: 'latest'
release:
Expand All @@ -18,23 +18,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check Tag Name
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag != 'latest' && github.event.inputs.tag != 'next' }}
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag != 'latest' && github.event.inputs.tag != 'next' && github.event.inputs.tag != 'beta' }}
run: |
echo 'Only the tags "latest" or "next" are supported. You entered "${{ github.event.inputs.tag }}"'
echo 'Only the tags "latest", "next", or "beta" are supported. You entered "${{ github.event.inputs.tag }}"'
exit 1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 'lts/iron'
- uses: actions/cache@v4
id: npm-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
node-version: '20.x'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- run: npm test
- name: Build project
run: npm run build
- name: Verify build artifacts
run: |
test -f dist/index.js || exit 1
test -f dist/index.cjs || exit 1
echo "✅ Both ESM and CommonJS builds exist and ready for publishing"
- name: Run tests
run: npm test
- name: Test package contents
run: |
npm pack --dry-run
echo "✅ Package contents verified"
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}
Expand Down
23 changes: 23 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Development files
tasks/
.github/
.idea/
.editorconfig
.eslintrc
rollup.config.js
test-dist/

# Source files (only ship built files)
# Keep the built dist/ directory

# Development dependencies and configs
*.log
.DS_Store
node_modules/
coverage/

# Git files
.git*

# Test files and examples (if you don't want to ship them)
# tasks/test/
Loading