diff --git a/.changeset/breezy-nails-love.md b/.changeset/breezy-nails-love.md new file mode 100644 index 0000000..b743e93 --- /dev/null +++ b/.changeset/breezy-nails-love.md @@ -0,0 +1,5 @@ +--- +'@scalar/snippetz': minor +--- + +refactor!: move everything into a single package with multiple entrypoints diff --git a/README.md b/README.md index ffc01e2..f28467d 100644 --- a/README.md +++ b/README.md @@ -4,22 +4,19 @@ [![Contributors](https://img.shields.io/github/contributors/scalar/snippetz)](https://github.com/scalar/snippetz/graphs/contributors) [![GitHub License](https://img.shields.io/github/license/scalar/snippetz)](https://github.com/scalar/snippetz/blob/main/LICENSE) [![Version](https://img.shields.io/npm/v/%40scalar/snippetz)](https://www.npmjs.com/package/@scalar/snippetz) -[![Discord](https://img.shields.io/discord/1135330207960678410?style=flat&color=5865F2)](https://discord.gg/8HeZcRGPFS) - -> [!WARNING] -> This package is in early development. Don’t use it in production! +[![Discord](https://img.shields.io/discord/1135330207960678410?style=flat&color=5865F2)](https://discord.gg/scalar) A modern way to generate code examples for different languages. ## Installation -``` +```bash npm install @scalar/snippetz ``` ## Usage -```js +```ts import { snippetz } from '@scalar/snippetz' const snippet = snippetz().print('node', 'undici', { @@ -39,7 +36,7 @@ const snippet = snippetz().print('node', 'undici', { ### Get all plugins -```js +```ts import { snippetz } from '@scalar/snippetz' const snippet = snippetz().plugins() @@ -56,7 +53,7 @@ const snippet = snippetz().plugins() ### Check if a plugin is loaded -```js +```ts import { snippetz } from '@scalar/snippetz' const snippet = snippetz().hasPlugin('node', 'undici') @@ -66,10 +63,12 @@ const snippet = snippetz().hasPlugin('node', 'undici') // true ``` -### Use just one plugin +### Lean usage -```js -import { undici } from '@scalar/snippetz-plugin-undici' +You can also just use one specific plugin to keep your bundle size small. + +```ts +import { undici } from '@scalar/snippetz/plugins/node/undici' const source = undici({ url: 'https://example.com', @@ -86,10 +85,12 @@ console.log(source.code) ## Community -We are API nerds. You too? Let’s chat on Discord: +We are API nerds. You too? Let’s chat on Discord: ## Contributors +Contributions are welcome! Read [`CONTRIBUTING`](https://github.com/scalar/snippetz/blob/main/CONTRIBUTING). + @@ -113,8 +114,6 @@ We are API nerds. You too? Let’s chat on Discord: -Contributions are welcome! Read [`CONTRIBUTING`](https://github.com/scalar/snippetz/blob/main/CONTRIBUTING). - ## License The source code in this repository is licensed under [MIT](https://github.com/scalar/snippetz/blob/main/LICENSE). diff --git a/demo/CHANGELOG.md b/demo/CHANGELOG.md deleted file mode 100644 index 6e0f6a9..0000000 --- a/demo/CHANGELOG.md +++ /dev/null @@ -1,9 +0,0 @@ -# demo - -## 0.0.1 - -### Patch Changes - -- Updated dependencies [64a09b0] - - @scalar/snippetz@0.1.0 - - @scalar/snippetz-plugin-undici@0.1.0 diff --git a/demo/package.json b/demo/package.json index 5b301fc..e433e90 100644 --- a/demo/package.json +++ b/demo/package.json @@ -12,7 +12,6 @@ }, "dependencies": { "@scalar/snippetz": "workspace:*", - "@scalar/snippetz-core": "workspace:*", "vue": "^3.4.35" }, "devDependencies": { diff --git a/demo/src/App.vue b/demo/src/App.vue index 914f774..a613d79 100644 --- a/demo/src/App.vue +++ b/demo/src/App.vue @@ -1,7 +1,6 @@