aboutsummaryrefslogtreecommitdiff
path: root/packages/create-astro
diff options
context:
space:
mode:
authorGravatar Cristopher <32661241+Namchee@users.noreply.github.com> 2024-10-04 16:21:03 +0700
committerGravatar GitHub <noreply@github.com> 2024-10-04 11:21:03 +0200
commitf47b347da899c6e1dcd0b2e7887f7fce6ec8e270 (patch)
tree98b3af845f3fd5ba8b5905f49d539e7a4ac07d0e /packages/create-astro
parent657d1973719e20470c3934d086b971e474fee3c6 (diff)
downloadastro-f47b347da899c6e1dcd0b2e7887f7fce6ec8e270.tar.gz
astro-f47b347da899c6e1dcd0b2e7887f7fce6ec8e270.tar.zst
astro-f47b347da899c6e1dcd0b2e7887f7fce6ec8e270.zip
chore(deps): replace strip-ansi with native module (#12118)
* chore(deps): replace strip-ansi with native module * chore: changeset --------- Co-authored-by: Princesseuh <3019731+Princesseuh@users.noreply.github.com>
Diffstat (limited to 'packages/create-astro')
-rw-r--r--packages/create-astro/package.json1
-rw-r--r--packages/create-astro/src/messages.ts4
-rw-r--r--packages/create-astro/test/utils.js4
3 files changed, 4 insertions, 5 deletions
diff --git a/packages/create-astro/package.json b/packages/create-astro/package.json
index fcae9af3d..d48c7065d 100644
--- a/packages/create-astro/package.json
+++ b/packages/create-astro/package.json
@@ -37,7 +37,6 @@
"devDependencies": {
"arg": "^5.0.2",
"astro-scripts": "workspace:*",
- "strip-ansi": "^7.1.0",
"strip-json-comments": "^5.0.1"
},
"engines": {
diff --git a/packages/create-astro/src/messages.ts b/packages/create-astro/src/messages.ts
index ba765f723..898c9c728 100644
--- a/packages/create-astro/src/messages.ts
+++ b/packages/create-astro/src/messages.ts
@@ -1,8 +1,8 @@
import { exec } from 'node:child_process';
+import { stripVTControlCharacters } from 'node:util';
/* eslint no-console: 'off' */
import { color, say as houston, label, spinner as load } from '@astrojs/cli-kit';
import { align, sleep } from '@astrojs/cli-kit/utils';
-import stripAnsi from 'strip-ansi';
import { shell } from './shell.js';
// Users might lack access to the global npm registry, this function
@@ -122,7 +122,7 @@ export const nextSteps = async ({ projectDir, devCmd }: { projectDir: string; de
`\n${prefix}Enter your project directory using`,
color.cyan(`cd ${projectDir}`, ''),
];
- const len = enter[0].length + stripAnsi(enter[1]).length;
+ const len = enter[0].length + stripVTControlCharacters(enter[1]).length;
log(enter.join(len > max ? '\n' + prefix : ' '));
}
log(
diff --git a/packages/create-astro/test/utils.js b/packages/create-astro/test/utils.js
index 5412c8cab..dfae93c33 100644
--- a/packages/create-astro/test/utils.js
+++ b/packages/create-astro/test/utils.js
@@ -1,6 +1,6 @@
import fs from 'node:fs';
import { before, beforeEach } from 'node:test';
-import stripAnsi from 'strip-ansi';
+import { stripVTControlCharacters } from 'node:util';
import { setStdout } from '../dist/index.js';
export function setup() {
@@ -9,7 +9,7 @@ export function setup() {
setStdout(
Object.assign({}, process.stdout, {
write(buf) {
- ctx.messages.push(stripAnsi(String(buf)).trim());
+ ctx.messages.push(stripVTControlCharacters(String(buf)).trim());
return true;
},
}),