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 up pnpm dev #7424

Merged
merged 9 commits into from
Jun 20, 2023
Merged
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: 5 additions & 0 deletions .changeset/fluffy-pandas-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Update internal types for more stable builds for Astro maintainers.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build": "turbo run build --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"build:ci": "turbo run build:ci --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"build:examples": "turbo run build --filter=\"@example/*\"",
"dev": "turbo run dev --parallel --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"dev": "turbo run dev --concurrency=40 --parallel --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
bluwy marked this conversation as resolved.
Show resolved Hide resolved
"format": "pnpm run format:code",
"format:ci": "pnpm run format:imports && pnpm run format:code",
"format:code": "prettier -w . --cache --plugin-search-dir=.",
Expand Down
5 changes: 3 additions & 2 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@
"client.d.ts",
"client-base.d.ts",
"client-image.d.ts",
"content-types.template.d.ts",
"content-module.template.mjs",
"import-meta.d.ts",
"astro-jsx.d.ts",
"types.d.ts",
"README.md",
"vendor",
"src/content/template"
"vendor"
],
"scripts": {
"prebuild": "astro-scripts prebuild --to-string \"src/runtime/server/astro-island.ts\" \"src/runtime/client/{idle,load,media,only,visible}.ts\"",
Expand Down
10 changes: 4 additions & 6 deletions packages/astro/src/content/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { createImage } from './runtime-assets.js';
/**
* Amap from a collection + slug to the local file path.
* This is used internally to resolve entry imports when using `getEntry()`.
* @see `src/content/virtual-mod.mjs`
* @see `content-module.template.mjs`
*/
export type ContentLookupMap = {
[collectionName: string]: { type: 'content' | 'data'; entries: { [lookupId: string]: string } };
Expand Down Expand Up @@ -432,7 +432,6 @@ export type ContentPaths = {
cacheDir: URL;
typesTemplate: URL;
virtualModTemplate: URL;
virtualAssetsModTemplate: URL;
config: {
exists: boolean;
url: URL;
Expand All @@ -444,14 +443,13 @@ export function getContentPaths(
fs: typeof fsMod = fsMod
): ContentPaths {
const configStats = search(fs, srcDir);
const templateDir = new URL('../../src/content/template/', import.meta.url);
const pkgBase = new URL('../../', import.meta.url);
return {
cacheDir: new URL('.astro/', root),
contentDir: new URL('./content/', srcDir),
assetsDir: new URL('./assets/', srcDir),
typesTemplate: new URL('types.d.ts', templateDir),
virtualModTemplate: new URL('virtual-mod.mjs', templateDir),
virtualAssetsModTemplate: new URL('virtual-mod-assets.mjs', templateDir),
typesTemplate: new URL('content-types.template.d.ts', pkgBase),
virtualModTemplate: new URL('content-module.template.mjs', pkgBase),
config: configStats,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function astroContentVirtualModPlugin({
/**
* Generate a map from a collection + slug to the local file path.
* This is used internally to resolve entry imports when using `getEntry()`.
* @see `src/content/virtual-mod.mjs`
* @see `content-module.template.mjs`
*/
export async function getStringifiedLookupMap({
contentPaths,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createFs, triggerFSEvent } from '../test-utils.js';
const root = new URL('../../fixtures/alias/', import.meta.url);

function getTypesDts() {
const typesdtsURL = new URL('../../../src/content/template/types.d.ts', import.meta.url);
const typesdtsURL = new URL('../../../content-types.template.d.ts', import.meta.url);
const relpath = slash(path.relative(fileURLToPath(root), fileURLToPath(typesdtsURL)));
return {
[relpath]: nodeFS.readFileSync(typesdtsURL, 'utf-8'),
Expand Down
4 changes: 3 additions & 1 deletion scripts/cmd/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,7 @@ export default async function build(...args) {
}

async function clean(outdir) {
return deleteAsync([`${outdir}/**`, `!${outdir}/**/*.d.ts`]);
await deleteAsync([`${outdir}/**`, `!${outdir}/**/*.d.ts`], {
onlyFiles: true,
});
}
3 changes: 2 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"outputMode": "new-only"
},
"dev": {
"cache": false
"cache": false,
"persistent": true
},
"test": {
"env": ["RUNNER_OS", "NODE_VERSION"],
Expand Down