Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: preserve spaces from the template's package.json #6357

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/old-fireants-allow.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/orange-cheetahs-hide.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/purple-crews-agree.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/yellow-kings-rhyme.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15"
"astro": "^2.0.16"
}
}
2 changes: 1 addition & 1 deletion examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15",
"astro": "^2.0.16",
"@astrojs/mdx": "^0.17.2",
"@astrojs/rss": "^2.1.1",
"@astrojs/sitemap": "^1.1.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^2.0.15"
"astro": "^2.0.16"
},
"peerDependencies": {
"astro": "^2.0.0-beta.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/deno/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15"
"astro": "^2.0.16"
},
"devDependencies": {
"@astrojs/deno": "^4.0.2"
Expand Down
2 changes: 1 addition & 1 deletion examples/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15",
"astro": "^2.0.16",
"preact": "^10.7.3",
"react": "^18.1.0",
"react-dom": "^18.1.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-alpine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15",
"astro": "^2.0.16",
"alpinejs": "^3.10.2",
"@astrojs/alpinejs": "^0.1.3",
"@types/alpinejs": "^3.7.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/framework-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15",
"astro": "^2.0.16",
"lit": "^2.2.5",
"@astrojs/lit": "^1.2.0",
"@astrojs/lit": "^1.2.1",
"@webcomponents/template-shadowroot": "^0.1.0"
}
}
2 changes: 1 addition & 1 deletion examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15",
"astro": "^2.0.16",
"preact": "^10.7.3",
"react": "^18.1.0",
"react-dom": "^18.1.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15",
"astro": "^2.0.16",
"preact": "^10.7.3",
"@astrojs/preact": "^2.0.3",
"@preact/signals": "^1.1.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15",
"astro": "^2.0.16",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"@astrojs/react": "^2.0.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15",
"astro": "^2.0.16",
"solid-js": "^1.4.3",
"@astrojs/solid-js": "^2.0.2"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"dependencies": {
"svelte": "^3.48.0",
"@astrojs/svelte": "^2.0.2",
"astro": "^2.0.15"
"astro": "^2.0.16"
}
}
2 changes: 1 addition & 1 deletion examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15",
"astro": "^2.0.16",
"vue": "^3.2.37",
"@astrojs/vue": "^2.0.1"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/node": "^5.0.4",
"astro": "^2.0.15"
"astro": "^2.0.16"
}
}
2 changes: 1 addition & 1 deletion examples/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^2.0.15"
"astro": "^2.0.16"
},
"peerDependencies": {
"astro": "^2.0.0-beta.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15"
"astro": "^2.0.16"
}
}
4 changes: 2 additions & 2 deletions examples/non-html-pages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Documentation for "Non-HTML Pages":

https://docs.astro.build/en/core-concepts/astro-pages/#non-html-pages
https://docs.astro.build/en/core-concepts/endpoints/#static-file-endpoints

```
npm create astro@latest -- --template non-html-pages
Expand All @@ -28,7 +28,7 @@ Inside of your Astro project, you'll see the following folders and files:
└── package.json
```

Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
Astro looks for `.astro`, `.js` or `.ts` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.

There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.

Expand Down
2 changes: 1 addition & 1 deletion examples/non-html-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15"
"astro": "^2.0.16"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15"
"astro": "^2.0.16"
}
}
2 changes: 1 addition & 1 deletion examples/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"server": "node dist/server/entry.mjs"
},
"dependencies": {
"astro": "^2.0.15",
"astro": "^2.0.16",
"svelte": "^3.48.0",
"@astrojs/svelte": "^2.0.2",
"@astrojs/node": "^5.0.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-markdown-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15",
"astro": "^2.0.16",
"@astrojs/markdown-remark": "^2.0.1",
"hast-util-select": "5.0.1",
"rehype-autolink-headings": "^6.1.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-markdown-shiki/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15"
"astro": "^2.0.16"
}
}
2 changes: 1 addition & 1 deletion examples/with-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15",
"astro": "^2.0.16",
"preact": "^10.6.5",
"@astrojs/preact": "^2.0.3",
"@astrojs/mdx": "^0.17.2"
Expand Down
2 changes: 1 addition & 1 deletion examples/with-nanostores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15",
"astro": "^2.0.16",
"preact": "^10.7.3",
"@astrojs/preact": "^2.0.3",
"nanostores": "^0.5.12",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@astrojs/mdx": "^0.17.2",
"@astrojs/tailwind": "^3.0.1",
"@types/canvas-confetti": "^1.4.3",
"astro": "^2.0.15",
"astro": "^2.0.16",
"autoprefixer": "^10.4.7",
"canvas-confetti": "^1.5.1",
"postcss": "^8.4.14",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-vite-plugin-pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.0.15",
"astro": "^2.0.16",
"vite-plugin-pwa": "0.11.11",
"workbox-window": "^6.5.3"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test": "vitest"
},
"dependencies": {
"astro": "^2.0.15",
"astro": "^2.0.16",
"vitest": "^0.20.3"
}
}
10 changes: 10 additions & 0 deletions packages/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# astro

## 2.0.16

### Patch Changes

- [#6363](https://github.com/withastro/astro/pull/6363) [`d94aae776`](https://github.com/withastro/astro/commit/d94aae77656f14f56898d33c6d3f83c59112212e) Thanks [@matthewp](https://github.com/matthewp)! - Fixes cases where head is injected in body when using Astro.slots.render()

- Updated dependencies [[`5aa6580f7`](https://github.com/withastro/astro/commit/5aa6580f775405a4443835bf7eb81f0c65e5aed6)]:
- @astrojs/[email protected]
- @astrojs/[email protected]

## 2.0.15

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "astro",
"version": "2.0.15",
"version": "2.0.16",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module",
"author": "withastro",
Expand Down Expand Up @@ -102,8 +102,8 @@
"@astrojs/compiler": "^1.1.0",
"@astrojs/language-server": "^0.28.3",
"@astrojs/markdown-remark": "^2.0.1",
"@astrojs/telemetry": "^2.0.0",
"@astrojs/webapi": "^2.0.1",
"@astrojs/telemetry": "^2.0.1",
"@astrojs/webapi": "^2.0.2",
"@babel/core": "^7.18.2",
"@babel/generator": "^7.18.2",
"@babel/parser": "^7.18.4",
Expand Down
6 changes: 6 additions & 0 deletions packages/create-astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# create-astro

## 3.0.4

### Patch Changes

- [#6352](https://github.com/withastro/astro/pull/6352) [`c87c16cfa`](https://github.com/withastro/astro/commit/c87c16cfaddea3a05af87c3258d57ef1a31516f7) Thanks [@SerekKiri](https://github.com/SerekKiri)! - Add missing flags to help command

## 3.0.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/create-astro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-astro",
"version": "3.0.3",
"version": "3.0.4",
"type": "module",
"author": "withastro",
"license": "MIT",
Expand Down
12 changes: 6 additions & 6 deletions packages/create-astro/src/actions/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import fs from 'node:fs';
import path from 'node:path';
import { error, info, spinner, title } from '../messages.js';

export async function template(
ctx: Pick<Context, 'template' | 'prompt' | 'dryRun' | 'exit' | 'exit'>
) {
export async function template(ctx: Pick<Context, 'template' | 'prompt' | 'dryRun' | 'exit'>) {
if (!ctx.template) {
const { template: tmpl } = await ctx.prompt({
name: 'template',
Expand Down Expand Up @@ -52,17 +50,19 @@ const FILES_TO_UPDATE = {
'package.json': (file: string, overrides: { name: string }) =>
fs.promises
.readFile(file, 'utf-8')
.then((value) =>
.then((value) => {
const indent = (text) => /(^\s+)/m.exec(text)?.[1] ?? '\t';
fs.promises.writeFile(
file,
JSON.stringify(
Object.assign(JSON.parse(value), Object.assign(overrides, { private: undefined })),
null,
'\t'
indent
),
'utf-8'
)
),
}
),
};

export default async function copyTemplate(tmpl: string, ctx: Context) {
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"tiny-glob": "^0.2.9"
},
"peerDependencies": {
"astro": "workspace:^2.0.15"
"astro": "workspace:^2.0.16"
},
"devDependencies": {
"astro": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/deno/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"esbuild": "^0.15.18"
},
"peerDependencies": {
"astro": "workspace:^2.0.15"
"astro": "workspace:^2.0.16"
},
"devDependencies": {
"astro": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"vite": "^4.1.2"
},
"peerDependencies": {
"astro": "workspace:^2.0.15",
"astro": "workspace:^2.0.16",
"sharp": ">=0.31.0"
},
"peerDependenciesMeta": {
Expand Down
Loading