Skip to content

Commit ce96764

Browse files
committed
better onboarding
1 parent 5fc3879 commit ce96764

File tree

6 files changed

+37
-28
lines changed

6 files changed

+37
-28
lines changed

documentation/docs/20-commands/20-sv-add.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,7 @@ To start on a good track, create your add-on with the `addon` template.
7878
npx sv create --template addon [path]
7979
```
8080

81-
Two key things to note, your `add-on` should:
82-
83-
- export a function that returns a `defineAddon` object.
84-
- have a `package.json` with an `exports` field that points to the main entry point of the add-on.
81+
In your new add-on directory, check out the `README.md` and `CONTRIBUTING.md` files for more information.
8582

8683
### How to publish a community add-on
8784

packages/sv/lib/cli/tests/cli.ts

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,20 @@ describe('cli', () => {
6060
projectName
6161
);
6262

63-
const result = await exec(
64-
'node',
65-
[
66-
svBinPath,
67-
'create',
68-
testOutputPath,
69-
'--template',
70-
template,
71-
...(template === 'addon' ? ['--no-types'] : ['--types', 'ts']),
72-
'--no-install',
73-
...args
74-
],
75-
{ nodeOptions: { stdio: 'pipe' } }
76-
);
63+
const allArgs = [
64+
svBinPath,
65+
'create',
66+
testOutputPath,
67+
'--template',
68+
template,
69+
...(template === 'addon' ? [] : ['--types', 'ts']),
70+
'--no-install',
71+
...args
72+
];
73+
const result = await exec('node', allArgs, { nodeOptions: { stdio: 'pipe' } });
7774

7875
// cli finished well
7976
expect(result.exitCode, `Error with cli: '${result.stderr}'`).toBe(0);
80-
8177
// test output path exists
8278
expect(fs.existsSync(testOutputPath)).toBe(true);
8379

@@ -132,7 +128,7 @@ describe('cli', () => {
132128
// list of cmds to test
133129
['i'],
134130
['run', 'demo-create'],
135-
['run', 'demo-add'],
131+
['run', 'demo-add:ci'],
136132
['run', 'test']
137133
];
138134
for (const cmd of cmds) {

packages/sv/lib/cli/tests/snapshots/@my-org/sv/CONTRIBUTING.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
# Contributing Guide
22

3-
Some convinient scripts are provided to help develop the add-on.
3+
Some convenient scripts are provided to help develop the add-on.
44

55
```sh
6-
## create a new demo project
6+
## create a new minimal project in the `demo` directory
77
npm run demo-create
88

9-
## add your add-on to the demo project
9+
## add your current add-on to the demo project
1010
npm run demo-add
1111

1212
## run the tests
1313
npm run test
1414
```
1515

16+
## Key things to note
17+
18+
Your `add-on` should:
19+
20+
- export a function that returns a `defineAddon` object.
21+
- have a `package.json` with an `exports` field that points to the main entry point of the add-on.
22+
1623
## Sharing your add-on
1724

1825
When you're ready to publish your add-on to npm, run:

packages/sv/lib/cli/tests/snapshots/@my-org/sv/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"license": "MIT",
77
"scripts": {
88
"demo-create": "sv create demo --types ts --template minimal --no-add-ons --no-install",
9-
"demo-add": "sv add file:../=who:you --cwd demo --no-git-check --no-download-check --no-install",
9+
"demo-add": "sv add file:../ --cwd demo --no-git-check --no-install",
10+
"demo-add:ci": "sv add file:../=who:you --cwd demo --no-git-check --no-download-check --no-install",
1011
"test": "vitest run"
1112
},
1213
"files": [

packages/sv/lib/create/shared/+addon/CONTRIBUTING.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
# Contributing Guide
22

3-
Some convinient scripts are provided to help develop the add-on.
3+
Some convenient scripts are provided to help develop the add-on.
44

55
```sh
6-
## create a new demo project
6+
## create a new minimal project in the `demo` directory
77
npm run demo-create
88

9-
## add your add-on to the demo project
9+
## add your current add-on to the demo project
1010
npm run demo-add
1111

1212
## run the tests
1313
npm run test
1414
```
1515

16+
## Key things to note
17+
18+
Your `add-on` should:
19+
20+
- export a function that returns a `defineAddon` object.
21+
- have a `package.json` with an `exports` field that points to the main entry point of the add-on.
22+
1623
## Sharing your add-on
1724

1825
When you're ready to publish your add-on to npm, run:

packages/sv/lib/create/templates/addon/package.template.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"license": "MIT",
77
"scripts": {
88
"demo-create": "sv create demo --types ts --template minimal --no-add-ons --no-install",
9-
"demo-add": "sv add file:../=who:you --cwd demo --no-git-check --no-download-check --no-install",
9+
"demo-add": "sv add file:../ --cwd demo --no-git-check --no-install",
10+
"demo-add:ci": "sv add file:../=who:you --cwd demo --no-git-check --no-download-check --no-install",
1011
"test": "vitest run"
1112
},
1213
"files": ["src", "!src/**/*.test.*"],

0 commit comments

Comments
 (0)