Skip to content
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/green-plants-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/rss': patch
---

Updates `fast-xml-parser` to v5.3.6
5 changes: 5 additions & 0 deletions .changeset/khaki-toys-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Upgrades `devalue` to v5.6.3
8 changes: 1 addition & 7 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@
"lockFileMaintenance": {
"enabled": true
},
"ignorePaths": [
"**/node_modules/**",
// This fixture depends on the versions in its package.json not being modified by
// CI because PNPM would link the local versions of the packages instead of installing
// them from NPM, leading to the tests depending on the fixture failing.
"**/astro-info-versions/**"
],
"ignorePaths": ["**/node_modules/**"],
"packageRules": [
{
"groupName": "lockfile maintenance",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- name: Get changed files in the .changeset folder
id: changed-files
uses: tj-actions/changed-files@8cba46e29c11878d930bca7870bb54394d3e8b21 # v47.0.2
uses: tj-actions/changed-files@7dee1b0c1557f278e5c7dc244927139d78c0e22a # v47.0.4
if: steps.blocked.outputs.result != 'true'
with:
files: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ jobs:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false
- name: Setup Biome
uses: biomejs/setup-biome@v2
uses: biomejs/setup-biome@29711cbb52afee00eb13aeb30636592f9edc0088 # v2.7.0
- name: Run Biome
run: biome ci --formatter-enabled=false --enforce-assist=false --reporter=default --reporter=github

Expand Down
2 changes: 1 addition & 1 deletion packages/astro-rss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"xml2js": "0.6.2"
},
"dependencies": {
"fast-xml-parser": "^5.3.5",
"fast-xml-parser": "^5.3.6",
"piccolore": "^0.1.3",
"zod": "^4.3.6"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"cookie": "^1.1.1",
"cssesc": "^3.0.0",
"deterministic-object-hash": "^2.0.2",
"devalue": "^5.6.2",
"devalue": "^5.6.3",
"diff": "^8.0.3",
"dlv": "^1.1.3",
"dset": "^3.1.4",
Expand Down
198 changes: 0 additions & 198 deletions packages/astro/test/cli.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import assert from 'node:assert/strict';
import { spawnSync } from 'node:child_process';
import { promises as fs, readFileSync } from 'node:fs';
import { isIPv4 } from 'node:net';
import { join } from 'node:path';
Expand All @@ -9,50 +8,6 @@ import { fileURLToPath } from 'node:url';
import { stripVTControlCharacters } from 'node:util';
import { cli, cliServerLogSetup, loadFixture, parseCliDevStart } from './test-utils.js';

/**
* Throws an error if no command is found for the current OS.
* @returns {string}
*/
function readFromClipboard() {
const system = process.platform;
let command = '';
let args = [];

if (system === 'darwin') {
command = 'pbpaste';
} else if (system === 'win32') {
command = 'powershell';
args = ['-command', 'Get-Clipboard'];
} else {
const unixCommands = [
['xclip', ['-sel', 'clipboard', '-o']],
['wl-paste', []],
];
for (const [unixCommand, unixArgs] of unixCommands) {
try {
const output = spawnSync('which', [unixCommand], { encoding: 'utf8' });
if (output.stdout.trim()) {
command = unixCommand;
args = unixArgs;
break;
}
} catch {
continue;
}
}
}

if (!command) {
throw new Error('Clipboard read command not found!');
}

const result = spawnSync(command, args, { encoding: 'utf8' });
if (result.error) {
throw result.error;
}
return result.stdout.trim();
}

describe('astro cli', () => {
const cliServerLogSetupWithFixture = (flags, cmd) => {
const projectRootURL = new URL('./fixtures/astro-basic/', import.meta.url);
Expand Down Expand Up @@ -123,159 +78,6 @@ describe('astro cli', () => {
assert.equal(result.stdout.includes(pkgVersion), true);
});

it('astro info has correct Astro version', async () => {
const result = await cli('info', '--copy').getResult();
const pkgURL = new URL('../package.json', import.meta.url);
const pkgJson = await fs.readFile(pkgURL, 'utf8').then((data) => JSON.parse(data));

const pkgVersion = pkgJson.version;

assert.ok(result.stdout.includes(`v${pkgVersion}`));
assert.equal(result.exitCode, 0);

// On Linux we only check if we have Wayland or x11. In Codespaces it falsely reports that it does have x11
if (
process.platform === 'linux' &&
((!process.env.WAYLAND_DISPLAY && !process.env.DISPLAY) || process.env.CODESPACES)
) {
assert.ok(result.stdout.includes('Please manually copy the text above'));
} else {
assert.ok(result.stdout.includes('Copied to clipboard!'));
const clipboardContent = await readFromClipboard();
assert.ok(clipboardContent.includes(`v${pkgVersion}`));
}
});

it(
'astro info shows correct Vite and integration versions when using pnpm',
{ skip: process.env.ECOSYSTEM_CI },
async () => {
const projectRootURL = new URL('./fixtures/astro-info-versions/', import.meta.url);
const projectPackageJSONUrl = new URL('./package.json', projectRootURL);

const packageJSON = await fs
.readFile(fileURLToPath(projectPackageJSONUrl))
.then((json) => JSON.parse(json));

const viteVersion = packageJSON.dependencies.vite;
const adapterVersion = packageJSON.dependencies['@astrojs/node'];
const integrationVersion = packageJSON.dependencies['@astrojs/react'];

const proc = spawnSync('pnpm', ['astro', 'info', '--copy'], {
cwd: projectRootURL,
encoding: 'utf-8',
shell: true,
});

assert.equal(proc.stdout.includes(`v${viteVersion}`), true);
assert.equal(proc.stdout.includes(`@astrojs/node (v${adapterVersion})`), true);
assert.equal(proc.stdout.includes(`@astrojs/react (v${integrationVersion})`), true);
assert.equal(proc.stdout.includes(`manual-integration`), true);
},
);

it(
'astro info shows correct Vite and integration versions when using npm',
{ skip: process.env.ECOSYSTEM_CI },
async () => {
const projectRootURL = new URL('./fixtures/astro-info-versions/', import.meta.url);
const projectPackageJSONUrl = new URL('./package.json', projectRootURL);

const packageJSON = await fs
.readFile(fileURLToPath(projectPackageJSONUrl))
.then((json) => JSON.parse(json));

const viteVersion = packageJSON.dependencies.vite;
const adapterVersion = packageJSON.dependencies['@astrojs/node'];
const integrationVersion = packageJSON.dependencies['@astrojs/react'];

const proc = spawnSync('npm', ['run', 'astro', 'info', '--copy'], {
cwd: projectRootURL,
encoding: 'utf-8',
shell: true,
});

assert.equal(proc.stdout.includes(`v${viteVersion}`), true);
assert.equal(proc.stdout.includes(`@astrojs/node (v${adapterVersion})`), true);
assert.equal(proc.stdout.includes(`@astrojs/react (v${integrationVersion})`), true);
assert.equal(proc.stdout.includes(`manual-integration`), true);
},
);

it(
'astro info shows correct Vite and integration versions when using yarn',
{ skip: true },
async () => {
const fixtureRootURL = new URL('./fixtures/astro-info-versions/', import.meta.url);
const testsRootURL = new URL('../', import.meta.url);
const astroPackageJSONUrl = new URL('./package.json', testsRootURL);
const packageJSONUrl = new URL('./package.json', fixtureRootURL);
const yarnLockUrl = new URL('./yarn.lock', fixtureRootURL);

const astroVersion = await fs
.readFile(fileURLToPath(astroPackageJSONUrl))
.then((text) => JSON.parse(text).version);
const packFileName = `./astro-${astroVersion}.tgz`;
const packURL = new URL(packFileName, testsRootURL);
const packDestinationURL = new URL(packFileName, fixtureRootURL);

// Add a packageManager field to the fixture's package.json file, otherwise
// corepack won't allow us to use yarn because a parent directory has a different
// package.json file with a packageManager field
let packageJSON = await fs
.readFile(fileURLToPath(packageJSONUrl), { encoding: 'utf-8' })
.then((text) => JSON.parse(text));
packageJSON.packageManager = 'yarn@4.9.4';

const viteVersion = packageJSON.dependencies.vite;
const adapterVersion = packageJSON.dependencies['@astrojs/node'];
const integrationVersion = packageJSON.dependencies['@astrojs/react'];

await fs.writeFile(fileURLToPath(packageJSONUrl), JSON.stringify(packageJSON), {
encoding: 'utf-8',
});
await fs.writeFile(yarnLockUrl, '', { encoding: 'utf-8' });

spawnSync('pnpm', ['pack'], { cwd: testsRootURL, encoding: 'utf-8', shell: true });
await fs.rename(packURL, packDestinationURL);

spawnSync('corepack', ['use', 'yarn@4.9.4'], {
cwd: fixtureRootURL,
encoding: 'utf-8',
shell: true,
});

spawnSync('corepack', ['yarn', 'add', packFileName], {
cwd: fixtureRootURL,
encoding: 'utf-8',
shell: true,
});

const proc = spawnSync('corepack', ['yarn', 'astro', 'info', '--copy'], {
cwd: fixtureRootURL,
encoding: 'utf-8',
shell: true,
});

// Reset changes to package.json
delete packageJSON.packageManager;
packageJSON.dependencies.astro = 'workspace:*';

await fs.writeFile(packageJSONUrl, JSON.stringify(packageJSON, null, 2), {
encoding: 'utf-8',
});
await fs.rm(yarnLockUrl, { force: true });
await fs.rm(packDestinationURL, { force: true });

spawnSync('pnpm', ['install'], { cwd: fixtureRootURL, shell: true });

assert.equal(proc.stdout.includes(`v${viteVersion}`), true);
assert.equal(proc.stdout.includes(`@astrojs/node (v${adapterVersion})`), true);
assert.equal(proc.stdout.includes(`@astrojs/react (v${integrationVersion})`), true);
assert.equal(proc.stdout.includes(`manual-integration`), true);
},
);

it(
'astro check no errors',
{
Expand Down
6 changes: 0 additions & 6 deletions packages/astro/test/fixtures/astro-info-versions/.gitignore

This file was deleted.

14 changes: 0 additions & 14 deletions packages/astro/test/fixtures/astro-info-versions/astro.config.mjs

This file was deleted.

18 changes: 0 additions & 18 deletions packages/astro/test/fixtures/astro-info-versions/package.json

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion packages/integrations/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"astro": "workspace:*",
"astro-scripts": "workspace:*",
"cheerio": "1.2.0",
"devalue": "^5.6.2"
"devalue": "^5.6.3"
},
"publishConfig": {
"provenance": true
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"@types/markdown-it": "^14.1.2",
"astro": "workspace:*",
"astro-scripts": "workspace:*",
"devalue": "^5.6.2",
"devalue": "^5.6.3",
"linkedom": "^0.18.12",
"vite": "^7.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/netlify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"astro": "workspace:*",
"astro-scripts": "workspace:*",
"cheerio": "1.2.0",
"devalue": "^5.6.2",
"devalue": "^5.6.3",
"typescript": "^5.9.3"
},
"astro": {
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"astro": "workspace:*",
"astro-scripts": "workspace:*",
"cheerio": "1.2.0",
"devalue": "^5.6.2",
"devalue": "^5.6.3",
"express": "^5.2.1",
"fastify": "^5.7.4",
"@fastify/middie": "^9.1.0",
Expand Down
Loading
Loading