Skip to content

Commit 94cbf38

Browse files
authored
chore: rename integrations to add-ons (#226)
1 parent dbb06e8 commit 94cbf38

File tree

7 files changed

+21
-25
lines changed

7 files changed

+21
-25
lines changed

community-adder-template/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
"type": "module",
77
"exports": "./src/index.js",
88
"keywords": [
9-
"sv-adder",
10-
"sv-add",
11-
"sv-integration",
9+
"svelte-add-on",
1210
"sv"
1311
],
1412
"scripts": {

community-adders/unocss.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { CommunityAdder } from '../packages/adders/_config/community.ts';
22

33
export default {
4-
id: 'unocss-svelte-integration'
4+
id: 'unocss-svelte-add-on'
55
} satisfies CommunityAdder;

community-adders/unplugin-icons.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { CommunityAdder } from '../packages/adders/_config/community.ts';
22

33
export default {
4-
id: 'unplugin-icons-svelte-integration'
4+
id: 'unplugin-icons-svelte-add-on'
55
} satisfies CommunityAdder;

documentation/docs/20-commands/10-sv-create.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ Whether and how to add typechecking to the project:
3131

3232
Prevent typechecking from being added. Not recommended!
3333

34-
### `--no-integrations`
35-
36-
<!-- TODO should be renamed to `--no-addons` -->
34+
### `--no-add-ons`
3735

3836
Run the command without the interactive add-ons prompt
3937

packages/cli/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
- fix: improve formatting on new script files ([#96](https://github.com/sveltejs/cli/pull/96))
113113

114114

115-
- fix: dont check preconditions if no integration selected ([#125](https://github.com/sveltejs/cli/pull/125))
115+
- fix: dont check preconditions if no add-on selected ([#125](https://github.com/sveltejs/cli/pull/125))
116116

117117

118118
- feat: improved homescreen for adding or creating projects ([#112](https://github.com/sveltejs/cli/pull/112))
@@ -127,4 +127,4 @@
127127
### Patch Changes
128128

129129

130-
- feat: paraglide integration ([#67](https://github.com/sveltejs/cli/pull/67))
130+
- feat: paraglide add-on ([#67](https://github.com/sveltejs/cli/pull/67))

packages/cli/commands/add/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ const defaultPkgPath = pkg.up();
4646
const defaultCwd = defaultPkgPath ? path.dirname(defaultPkgPath) : undefined;
4747

4848
export const add = new Command('add')
49-
.description('applies specified integrations into a project')
50-
.argument('[integration...]', 'integrations to install')
49+
.description('applies specified add-ons into a project')
50+
.argument('[add-on...]', 'add-ons to install')
5151
.option('-C, --cwd <path>', 'path to working directory', defaultCwd)
5252
.option('--no-install', 'skip installing dependencies')
5353
.option('--no-preconditions', 'skip validating preconditions')
@@ -317,7 +317,7 @@ export async function runAddCommand(
317317

318318
// prompt to install the dependent
319319
const install = await p.confirm({
320-
message: `The ${pc.bold(pc.cyan(adder.id))} integration requires ${pc.bold(pc.cyan(depId))} to also be setup. ${pc.green('Include it?')}`
320+
message: `The ${pc.bold(pc.cyan(adder.id))} add-on requires ${pc.bold(pc.cyan(depId))} to also be setup. ${pc.green('Include it?')}`
321321
});
322322
if (install !== true) {
323323
p.cancel('Operation cancelled.');
@@ -430,7 +430,7 @@ export async function runAddCommand(
430430

431431
// apply adders
432432
const filesToFormat = await runAdders({ cwd: options.cwd, packageManager, official, community });
433-
p.log.success('Successfully setup integrations');
433+
p.log.success('Successfully setup add-ons');
434434

435435
// install dependencies
436436
if (packageManager && options.install) {
@@ -589,7 +589,7 @@ function getAdderOptionFlags(): Option[] {
589589
const preset = defaults.join(', ') || 'none';
590590
const option = new Option(
591591
`--${id} [options...]`,
592-
`${id} integration options ${pc.dim(`(preset: ${preset})`)}\n${choices}`
592+
`${id} add-on options ${pc.dim(`(preset: ${preset})`)}\n${choices}`
593593
)
594594
// presets are applied when `--adder` is specified with no options
595595
.preset(preset)

packages/cli/commands/create.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const OptionsSchema = v.strictObject({
3333
v.optional(v.union([v.picklist(langs), v.boolean()])),
3434
v.transform((lang) => langMap[String(lang)])
3535
),
36-
integrations: v.boolean(),
36+
addOns: v.boolean(),
3737
install: v.boolean(),
3838
template: v.optional(v.picklist(templateChoices))
3939
});
@@ -45,14 +45,14 @@ export const create = new Command('create')
4545
.addOption(templateOption)
4646
.addOption(langOption)
4747
.option('--no-types')
48-
.option('--no-integrations', 'skip interactive integration installer')
48+
.option('--no-add-ons', 'skips interactive add-on installer')
4949
.option('--no-install', 'skip installing dependencies')
5050
.configureHelp(common.helpConfig)
5151
.action((projectPath, opts) => {
5252
const cwd = v.parse(ProjectPathSchema, projectPath);
5353
const options = v.parse(OptionsSchema, opts);
5454
common.runCommand(async () => {
55-
const { directory, integrationNextSteps, packageManager } = await createProject(cwd, options);
55+
const { directory, addOnNextSteps, packageManager } = await createProject(cwd, options);
5656
const highlight = (str: string) => pc.bold(pc.cyan(str));
5757

5858
let i = 1;
@@ -81,7 +81,7 @@ export const create = new Command('create')
8181
];
8282

8383
p.box(steps.join('\n'), 'Project next steps');
84-
if (integrationNextSteps) p.box(integrationNextSteps, 'Integration next steps');
84+
if (addOnNextSteps) p.box(addOnNextSteps, 'Add-on next steps');
8585
});
8686
});
8787

@@ -152,30 +152,30 @@ async function createProject(cwd: string, options: Options) {
152152
p.log.success('Project created');
153153

154154
let packageManager: AgentName | undefined | null;
155-
let integrationNextSteps: string | undefined;
155+
let addOnNextSteps: string | undefined;
156156
const installDeps = async () => {
157157
packageManager = await common.packageManagerPrompt(projectPath);
158158
if (packageManager) await common.installDependencies(packageManager, projectPath);
159159
};
160160

161-
if (options.integrations) {
161+
if (options.addOns) {
162162
// `runAddCommand` includes installing dependencies
163163
const { nextSteps, packageManager: pm } = await runAddCommand(
164164
{ cwd: projectPath, install: options.install, preconditions: true, community: [] },
165165
[]
166166
);
167167
packageManager = pm;
168-
integrationNextSteps = nextSteps;
168+
addOnNextSteps = nextSteps;
169169
} else if (options.install) {
170-
// `--no-integrations` was set, so we'll prompt to install deps manually
170+
// `--no-add-ons` was set, so we'll prompt to install deps manually
171171
await installDeps();
172172
}
173173

174-
// no integrations were selected (which means the install prompt was skipped in `runAddCommand`),
174+
// no add-ons were selected (which means the install prompt was skipped in `runAddCommand`),
175175
// so we'll prompt to install
176176
if (packageManager === null && options.install) {
177177
await installDeps();
178178
}
179179

180-
return { directory: projectPath, integrationNextSteps, packageManager };
180+
return { directory: projectPath, addOnNextSteps, packageManager };
181181
}

0 commit comments

Comments
 (0)