From bfac0f0fa23e900d5cb26145280c86ddfae412e8 Mon Sep 17 00:00:00 2001 From: Brev Patterson Date: Sun, 16 Oct 2022 18:14:04 -0700 Subject: [PATCH 1/4] After running `svelte-package` (via `create-svelte`), the user is supposed to run: `npm publish package/`. However, I keep accidentally running `npm publish` (the wrong directory) out of habit, instead. With this change, when the user accidentally tries to publish the `./` directory, they will be directed to publish the `./package/` directory instead. --- .changeset/wild-bags-cheat.md | 9 +++++++++ .../templates/skeletonlib/package.template.json | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/wild-bags-cheat.md diff --git a/.changeset/wild-bags-cheat.md b/.changeset/wild-bags-cheat.md new file mode 100644 index 000000000000..0693f61047c1 --- /dev/null +++ b/.changeset/wild-bags-cheat.md @@ -0,0 +1,9 @@ +--- +'create-svelte': patch +--- + +After running `svelte-package` (via `create-svelte`), the user is supposed to +run: `npm publish package/`. However, I keep accidentally running `npm publish` +(the wrong directory) out of habit, instead. +With this change, when the user accidentally tries to publish the `./` +directory, they will be directed to publish the `./package/` directory instead. diff --git a/packages/create-svelte/templates/skeletonlib/package.template.json b/packages/create-svelte/templates/skeletonlib/package.template.json index 6b90688f1171..80e89e2a25a7 100644 --- a/packages/create-svelte/templates/skeletonlib/package.template.json +++ b/packages/create-svelte/templates/skeletonlib/package.template.json @@ -3,7 +3,8 @@ "version": "0.0.1", "scripts": { "dev": "vite dev", - "build": "svelte-kit sync && svelte-package" + "build": "svelte-kit sync && svelte-package", + "prepublishOnly": "echo 'Did you mean to publish `./package/`, instead of `./`?\n' && exit 1" }, "devDependencies": { "@sveltejs/adapter-auto": "workspace:*", From f77eb9a273afee5ede9f34b3e39c75b5d72ef2be Mon Sep 17 00:00:00 2001 From: Brev Patterson Date: Sun, 16 Oct 2022 18:29:20 -0700 Subject: [PATCH 2/4] better description --- .changeset/wild-bags-cheat.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.changeset/wild-bags-cheat.md b/.changeset/wild-bags-cheat.md index 0693f61047c1..e543e66f5756 100644 --- a/.changeset/wild-bags-cheat.md +++ b/.changeset/wild-bags-cheat.md @@ -3,7 +3,7 @@ --- After running `svelte-package` (via `create-svelte`), the user is supposed to -run: `npm publish package/`. However, I keep accidentally running `npm publish` -(the wrong directory) out of habit, instead. -With this change, when the user accidentally tries to publish the `./` -directory, they will be directed to publish the `./package/` directory instead. +run: `npm publish package/`. However, it is easy to accidentally run +`npm publish` on the wrong directory out of habit. With this change, +when the user accidentally tries to publish the `./` directory, they will be +directed to publish the `./package/` directory instead. From 810eb359ed8598afc158484e77ba913a8a0abc62 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Mon, 17 Oct 2022 08:34:23 +0200 Subject: [PATCH 3/4] changeset --- .changeset/wild-bags-cheat.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.changeset/wild-bags-cheat.md b/.changeset/wild-bags-cheat.md index e543e66f5756..fbe87d045e47 100644 --- a/.changeset/wild-bags-cheat.md +++ b/.changeset/wild-bags-cheat.md @@ -2,8 +2,4 @@ 'create-svelte': patch --- -After running `svelte-package` (via `create-svelte`), the user is supposed to -run: `npm publish package/`. However, it is easy to accidentally run -`npm publish` on the wrong directory out of habit. With this change, -when the user accidentally tries to publish the `./` directory, they will be -directed to publish the `./package/` directory instead. +Warn user when they accidentally try to publish the `./` directory From eed3a68e894f5a19985d9878b7312f3242117e8f Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Mon, 17 Oct 2022 08:37:25 +0200 Subject: [PATCH 4/4] remove linebreak --- .../create-svelte/templates/skeletonlib/package.template.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/create-svelte/templates/skeletonlib/package.template.json b/packages/create-svelte/templates/skeletonlib/package.template.json index 80e89e2a25a7..78e1bbf168cb 100644 --- a/packages/create-svelte/templates/skeletonlib/package.template.json +++ b/packages/create-svelte/templates/skeletonlib/package.template.json @@ -4,7 +4,7 @@ "scripts": { "dev": "vite dev", "build": "svelte-kit sync && svelte-package", - "prepublishOnly": "echo 'Did you mean to publish `./package/`, instead of `./`?\n' && exit 1" + "prepublishOnly": "echo 'Did you mean to publish `./package/`, instead of `./`?' && exit 1" }, "devDependencies": { "@sveltejs/adapter-auto": "workspace:*",