-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: AdrianGonz97 <31664583+AdrianGonz97@users.noreply.github.com>
- Loading branch information
1 parent
61c62ec
commit d58d3bc
Showing
81 changed files
with
334 additions
and
346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'sv': patch | ||
--- | ||
|
||
chore: rename `adder` to `add-on` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# community-addon-template | ||
|
||
> [!IMPORTANT] | ||
> Community add-ons are currently not supported. Please see [#184](https://github.com/sveltejs/cli/issues/184) for details. | ||
> [!IMPORTANT] | ||
> This template's dependencies may not be up-to-date; be sure to update them to the latest! | ||
> If you get stuck, check out the [implementations of official add-ons](https://github.com/sveltejs/cli/tree/main/packages/add-ons). | ||
The add-on template for community add-ons for [`sv`](https://github.com/sveltejs/cli). | ||
|
||
## Cloning the template | ||
|
||
Use [`degit`](https://github.com/Rich-Harris/degit) to clone the template: | ||
|
||
```shell | ||
npx degit sveltejs/cli/community-addon-template addon-name | ||
``` | ||
|
||
## Using the add-on | ||
|
||
To run the add-on, we'll first need a project to apply it to. | ||
|
||
Create the project with the following script: | ||
|
||
```shell | ||
npm run create-temp | ||
``` | ||
|
||
This will create a SvelteKit project in the `temp` directory. | ||
|
||
To execute the add-on, run: | ||
|
||
```shell | ||
npm start | ||
``` | ||
|
||
## Sharing your add-on | ||
|
||
When you're ready to publish your add-on to NPM, run: | ||
|
||
```shell | ||
npm publish | ||
``` | ||
|
||
Your published add-on can now be used by anyone! | ||
|
||
To execute the newly published package with `sv`, run: | ||
|
||
```shell | ||
npx sv add --community npm:addon-package-name | ||
``` | ||
|
||
After that, feel free to open a pull request to [`sv`](https://github.com/sveltejs/cli) and add your add-on to the [community list](/community-addons/). | ||
|
||
## Things to be aware of | ||
|
||
Community add-ons are **not permitted** to have any external dependencies outside of `@sveltejs/cli-core`. If the use of a dependency is absolutely necessary, then they can be bundled using a bundler of your choosing (e.g. Rollup, Rolldown, tsup, etc.). |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
community-adder-template/package.json → community-addon-template/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
community-adder-template/src/index.js → community-addon-template/src/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...dder-template/tests/fixtures/+page.svelte → ...ddon-template/tests/fixtures/+page.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<script> | ||
import demo from '../../adder-template-demo.txt?raw'; | ||
import demo from '../../addon-template-demo.txt?raw'; | ||
</script> | ||
|
||
<span data-testid="demo">{demo}</span> |
2 changes: 1 addition & 1 deletion
2
...-adder-template/tests/fixtures/App.svelte → ...-addon-template/tests/fixtures/App.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<script> | ||
import demo from '../adder-template-demo.txt?raw'; | ||
import demo from '../addon-template-demo.txt?raw'; | ||
</script> | ||
|
||
<span data-testid="demo">{demo}</span> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type { CommunityAddon } from '../packages/addons/_config/community.ts'; | ||
|
||
export default { | ||
id: 'unocss-svelte-add-on' | ||
} satisfies CommunityAddon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type { CommunityAddon } from '../packages/addons/_config/community.ts'; | ||
|
||
export default { | ||
id: 'unplugin-icons-svelte-add-on' | ||
} satisfies CommunityAddon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export type CommunityAddon = { | ||
id: string; // the npm package name | ||
}; | ||
|
||
/** EVALUATED AT BUILD TIME */ | ||
export const communityAddonIds: string[] = []; | ||
|
||
export async function getCommunityAddon(name: string): Promise<CommunityAddon> { | ||
const { default: details } = await import(`../../../community-addons/${name}.ts`); | ||
return details; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { officialAddons, getAddonDetails } from './official.ts'; | ||
export { getCommunityAddon, communityAddonIds } from './community.ts'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
packages/adders/_tests/all-addons/test.ts → packages/addons/_tests/all-addons/test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes.
Oops, something went wrong.