chore: move next admin packages to core repo (#5983)
**What** - Move packages for `next` version of admin to core repo **Other** - Since this PR introduces packages that depend on Vite 5, it also introduces @types/node@^20. We have never had a direct dependency on the types package for Node, and as far as I can see that has resulted in us using the types from Node.js@8, as those are a dependency of one of our dependencies. With the introduction of @types/node@^20, two of our packages had TS errors because they were using the NodeJS.Timer type, which was deprecated in Node.js@14. We should add specific @types/node packages to all our packages, but I haven't done so in this PR to keep it as clean as possible. - Q: @olivermrbl I've added the new packages to the ignore list for changeset, is this enough to prevent them from being published?
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import boxen from "boxen"
|
||||
import chalk from "chalk"
|
||||
import { Ora } from "ora"
|
||||
import { emojify } from "node-emoji"
|
||||
import { Ora } from "ora"
|
||||
import ProcessManager from "./process-manager.js"
|
||||
|
||||
export type FactBoxOptions = {
|
||||
interval: NodeJS.Timer | null
|
||||
interval: NodeJS.Timeout | null
|
||||
spinner: Ora
|
||||
processManager: ProcessManager
|
||||
message?: string
|
||||
@@ -53,7 +53,7 @@ export const createFactBox = (
|
||||
spinner: Ora,
|
||||
title: string,
|
||||
processManager: ProcessManager
|
||||
): NodeJS.Timer => {
|
||||
): NodeJS.Timeout => {
|
||||
showFact(spinner, title)
|
||||
const interval = setInterval(() => {
|
||||
showFact(spinner, title)
|
||||
@@ -65,12 +65,12 @@ export const createFactBox = (
|
||||
}
|
||||
|
||||
export const resetFactBox = (
|
||||
interval: NodeJS.Timer | null,
|
||||
interval: NodeJS.Timeout | null,
|
||||
spinner: Ora,
|
||||
successMessage: string,
|
||||
processManager: ProcessManager,
|
||||
newTitle?: string
|
||||
): NodeJS.Timer | null => {
|
||||
): NodeJS.Timeout | null => {
|
||||
if (interval) {
|
||||
clearInterval(interval)
|
||||
}
|
||||
@@ -90,7 +90,7 @@ export function displayFactBox({
|
||||
processManager,
|
||||
title = "",
|
||||
message = "",
|
||||
}: FactBoxOptions): NodeJS.Timer | null {
|
||||
}: FactBoxOptions): NodeJS.Timeout | null {
|
||||
if (!message) {
|
||||
return createFactBox(spinner, title, processManager)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ type ProcessOptions = {
|
||||
}
|
||||
|
||||
export default class ProcessManager {
|
||||
intervals: NodeJS.Timer[] = []
|
||||
intervals: NodeJS.Timeout[] = []
|
||||
static MAX_RETRIES = 3
|
||||
|
||||
constructor() {
|
||||
@@ -20,7 +20,7 @@ export default class ProcessManager {
|
||||
process.on("SIGINT", () => fn())
|
||||
}
|
||||
|
||||
addInterval(interval: NodeJS.Timer) {
|
||||
addInterval(interval: NodeJS.Timeout) {
|
||||
this.intervals.push(interval)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user