Skip to content
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Requires Node.js 20+.
a8c-integration init
```

Interactive — it asks for your **vendor name** and **integration name**, always builds from the canonical [VIP Integrations Starter Kit](https://github.com/Automattic/vip-integrations-starter-kit) (its default branch, no git history pulled), rewrites the example prefix set to your names, renames the entry file, and starts a fresh git history. You can also pass the answers as flags:
Interactive — it asks for your **vendor name** and **integration name**, always builds from the canonical [VIP Integrations Starter Kit](https://github.com/Automattic/vip-integrations-starter-kit) (its default branch, no git history pulled), rewrites the example prefix set to your names, and renames the entry file. You can also pass the answers as flags:

```bash
a8c-integration init --vendor "WordPress" --name "Content Sync"
Expand Down
37 changes: 37 additions & 0 deletions __tests__/scaffold.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,43 @@ describe( 'scaffoldTree', () => {
expect( result.changed ).toBeGreaterThanOrEqual( 3 );
} );

it( 'personalizes derivable manifest fields and placeholders the rest', () => {
const root = join( dir, 'manifest' );
mkdirSync( root, { recursive: true } );
writeFileSync(
join( root, 'a8c-manifest.yaml' ),
[
'# yaml-language-server: $schema=./a8c-manifest.schema.json',
'integration:',
' slug: example-integration',
' summary: Reference integration built from the VIP Integrations Starter Kit.',
' partner:',
' support_contact: support@example.com',
'documentation:',
' public_url: https://example.com/docs/example-integration',
' support_url: https://example.com/docs/example-integration/support',
'release:',
' changelog: Initial VIP integration starter kit example.',
'',
].join( '\n' )
);

scaffoldTree( root, 'Acme', 'Content Sync' );

const manifest = readFileSync( join( root, 'a8c-manifest.yaml' ), 'utf8' );
// Derivable fields get real values.
expect( manifest ).toContain( 'summary: Content Sync integration for WordPress VIP.' );
expect( manifest ).toContain( 'changelog: Initial release.' );
// Partner-only fields become placeholders so validate fails until filled.
expect( manifest ).toContain( 'support_contact: REPLACE_ME' );
expect( manifest ).toContain( 'public_url: https://REPLACE_ME' );
expect( manifest ).toContain( 'support_url: https://REPLACE_ME' );
// The schema modeline comment survives the edit.
expect( manifest ).toContain( '# yaml-language-server: $schema=./a8c-manifest.schema.json' );
// The token pass still ran: the example slug was rewritten.
expect( manifest ).toContain( 'slug: content-sync' );
} );

it( 'leaves a binary file untouched even when it contains a token', () => {
const root = join( dir, 'binary' );
mkdirSync( root, { recursive: true } );
Expand Down
Loading
Loading