diff --git a/.github/workflows/new_stats_build.yaml b/.github/workflows/new_stats_build.yaml deleted file mode 100644 index a146621cf0..0000000000 --- a/.github/workflows/new_stats_build.yaml +++ /dev/null @@ -1,43 +0,0 @@ -# This workflow will do a clean install of node dependencies, cache/restore them, build the source code using yarn build:app - -name: New Stats Build - -on: - push: - branches: [development, development_314] - paths: - - "packages/new_stats/**" - pull_request: - branches: [development, development_314] - paths: - - "packages/new_stats/**" - -jobs: - build: - runs-on: ubuntu-latest - env: - NODE_OPTIONS: "--max-old-space-size=8192" - - strategy: - matrix: - node-version: [18.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v2 - - - name: Setup Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - cache: "yarn" - cache-dependency-path: "**/yarn.lock" - - - name: Install dependencies - run: | - yarn install - - - name: Build - run: | - lerna run build --no-private - yarn workspace @threefold/newstats build diff --git a/.github/workflows/new_stats_docker.yaml b/.github/workflows/new_stats_docker.yaml deleted file mode 100644 index 0770f28a2f..0000000000 --- a/.github/workflows/new_stats_docker.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: New Stats Docker Build/Push -on: - release: - types: [published] - workflow_dispatch: - -jobs: - Build-and-push-docker-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - name: Checkout the repo - uses: actions/checkout@v3 - - name: Log in to the Container registry - uses: docker/login-action@v2.1.0 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: ghcr.io/threefoldtech/newstats - tags: | - type=semver,pattern={{version}} - - name: Build and push Docker image - uses: docker/build-push-action@v4 - with: - file: packages/new_stats/Dockerfile - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/packages/new_stats/Dockerfile b/packages/new_stats/Dockerfile deleted file mode 100644 index 6c9c383547..0000000000 --- a/packages/new_stats/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM node:18 AS build - -WORKDIR /app - -COPY . /app/ - -# Install yarn and build project -RUN yarn install -RUN yarn lerna run build --no-private && yarn workspace @threefold/newstats build - -FROM nginx:1.25.3-alpine -COPY --from=build /app/packages/new_stats/dist /usr/share/nginx/html -COPY --from=build /app/packages/new_stats/nginx /etc/nginx diff --git a/packages/new_stats/README.md b/packages/new_stats/README.md deleted file mode 100644 index 5fb4a3ce12..0000000000 --- a/packages/new_stats/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# Grid Stats - -## Introduction - -Grid Stats is a web application created to replace explorer.threefold.io with a simple page showing a capacity map + statistics. In the map, you get to see node distribution with each node location highlighted. While in Statistics section, general details about the nodes are being displayed like online nodes, farms count, total storage used, gateways ...etc. -Also, you can select one or more networks to get their stats. - -## Installation - -- **Prerequisite** - - - Nodejs 18^ - -- **Clone the repository** - - ```bash - git clone https://github.com/threefoldtech/tfgrid-sdk-ts.git - ``` - -## Get started - -Install the dependencies... - -Before running the Grid Stats, in your terminal move to the project directory, then install the required dependencies using - -```bash -cd tfgrid-sdk-ts -yarn install -``` - -You can now run the project in development mode using - -```bash -yarn workspace @threefold/newstats dev -``` - -## Building and running in production mode - -To create an optimised version of the app: - -```bash -yarn workspace @threefold/newstats build -``` - -This will generate the production build in the [dist](./dist/) directory, which can be served using [Caddy](https://caddyserver.com/) or [NGINX](https://www.nginx.com/) diff --git a/packages/new_stats/chart/.helmignore b/packages/new_stats/chart/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/packages/new_stats/chart/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/packages/new_stats/chart/Chart.yaml b/packages/new_stats/chart/Chart.yaml deleted file mode 100644 index 91da86ec3c..0000000000 --- a/packages/new_stats/chart/Chart.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: v2 -name: tfgrid-newstats -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "v2.3.0-alpha11" diff --git a/packages/new_stats/chart/README.md b/packages/new_stats/chart/README.md deleted file mode 100644 index a2379c083a..0000000000 --- a/packages/new_stats/chart/README.md +++ /dev/null @@ -1,31 +0,0 @@ -#### Note - -* by default we use nginx ingress controller. -* if you want to use the ingress, you need to install the ingress controller. - -#### 1. Deploying the TFGrid Chart and set host domain_name - -```bash - helm install ./tfgrid-newstats/ --values ./tfgrid-newstats/values.yaml --set ingress.hosts[0].host= -``` - -#### 2. Test it, and check the results - -```bash - curl -X GET http:/// -``` - -#### 3. Using traefik ingress controller - -```yaml - # Make sure traefik is installed. - # Just replace the annotations with: - annotations: - kubernetes.io/ingress.class: traefik -``` - -#### 4. Deploying with nginx ingress and https - -```bash - helm install ./tfgrid-newstats/ --values ./tfgrid-newstats/values.yaml --set ingress.hosts[0].host= --set ingress.tls[0].hosts[0]= --set ingress.tls[0].secretName= -``` diff --git a/packages/new_stats/chart/templates/NOTES.txt b/packages/new_stats/chart/templates/NOTES.txt deleted file mode 100644 index cd442546ff..0000000000 --- a/packages/new_stats/chart/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "tfgrid-stats.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "tfgrid-stats.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "tfgrid-stats.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "tfgrid-stats.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/packages/new_stats/chart/templates/_helpers.tpl b/packages/new_stats/chart/templates/_helpers.tpl deleted file mode 100644 index f30dce7d0b..0000000000 --- a/packages/new_stats/chart/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "tfgrid-newstats.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "tfgrid-newstats.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "tfgrid-newstats.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "tfgrid-newstats.labels" -}} -helm.sh/chart: {{ include "tfgrid-newstats.chart" . }} -{{ include "tfgrid-newstats.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "tfgrid-newstats.selectorLabels" -}} -app.kubernetes.io/name: {{ include "tfgrid-newstats.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "tfgrid-newstats.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "tfgrid-newstats.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/packages/new_stats/chart/templates/deployment.yaml b/packages/new_stats/chart/templates/deployment.yaml deleted file mode 100644 index c6b1db7550..0000000000 --- a/packages/new_stats/chart/templates/deployment.yaml +++ /dev/null @@ -1,61 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "tfgrid-newstats.fullname" . }} - labels: - {{- include "tfgrid-newstats.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "tfgrid-newstats.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "tfgrid-newstats.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "tfgrid-newstats.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: http - containerPort: 80 - protocol: TCP - livenessProbe: - httpGet: - path: / - port: http - readinessProbe: - httpGet: - path: / - port: http - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/packages/new_stats/chart/templates/hpa.yaml b/packages/new_stats/chart/templates/hpa.yaml deleted file mode 100644 index 6c2cdad1ac..0000000000 --- a/packages/new_stats/chart/templates/hpa.yaml +++ /dev/null @@ -1,28 +0,0 @@ -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "tfgrid-newstats.fullname" . }} - labels: - {{- include "tfgrid-newstats.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "tfgrid-newstats.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/packages/new_stats/chart/templates/ingress.yaml b/packages/new_stats/chart/templates/ingress.yaml deleted file mode 100644 index dcc4277c65..0000000000 --- a/packages/new_stats/chart/templates/ingress.yaml +++ /dev/null @@ -1,61 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "tfgrid-newstats.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "tfgrid-newstats.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/packages/new_stats/chart/templates/service.yaml b/packages/new_stats/chart/templates/service.yaml deleted file mode 100644 index c9adcd91ba..0000000000 --- a/packages/new_stats/chart/templates/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "tfgrid-newstats.fullname" . }} - labels: - {{- include "tfgrid-newstats.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - {{- include "tfgrid-newstats.selectorLabels" . | nindent 4 }} diff --git a/packages/new_stats/chart/templates/serviceaccount.yaml b/packages/new_stats/chart/templates/serviceaccount.yaml deleted file mode 100644 index ce1054b806..0000000000 --- a/packages/new_stats/chart/templates/serviceaccount.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "tfgrid-newstats.serviceAccountName" . }} - labels: - {{- include "tfgrid-newstats.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/packages/new_stats/chart/templates/tests/test-connection.yaml b/packages/new_stats/chart/templates/tests/test-connection.yaml deleted file mode 100644 index c43e73eb98..0000000000 --- a/packages/new_stats/chart/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "tfgrid-newstats.fullname" . }}-test-connection" - labels: - {{- include "tfgrid-newstats.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "tfgrid-newstats.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/packages/new_stats/chart/values.yaml b/packages/new_stats/chart/values.yaml deleted file mode 100644 index 1f454c5fb0..0000000000 --- a/packages/new_stats/chart/values.yaml +++ /dev/null @@ -1,65 +0,0 @@ -replicaCount: 1 - -image: - repository: ghcr.io/threefoldtech/newstats - pullPolicy: Always - # Overrides the image tag whose default is the chart appVersion. - tag: "2.3.0-alpha11" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: true - annotations: {} - name: "" - -podAnnotations: {} - -podSecurityContext: {} - -securityContext: {} - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: true - className: "" - annotations: - cert-manager.io/cluster-issuer: letsencrypt - kubernetes.io/ingress.class: nginx - kubernetes.io/tls-acme: "true" - nginx.ingress.kubernetes.io/enable-cors: "true" - nginx.ingress.kubernetes.io/cors-allow-methods: "GET, OPTIONS" - nginx.ingress.kubernetes.io/cors-allow-origin: "*" - nginx.ingress.kubernetes.io/cors-allow-headers: "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization" - hosts: - - host: "domain.com" - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - -resources: - limits: - cpu: 1000m - memory: 1024Mi - requests: - cpu: 900m - memory: 1000Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/packages/new_stats/package.json b/packages/new_stats/package.json deleted file mode 100644 index c94f41cc59..0000000000 --- a/packages/new_stats/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "@threefold/newstats", - "version": "2.3.0-alpha11", - "private": true, - "scripts": { - "dev": "vite", - "build": "run-p type-check \"build-only {@}\" --", - "preview": "vite preview", - "test:unit": "vitest", - "build-only": "vite build", - "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false" - }, - "dependencies": { - "@threefold/gridproxy_client": "^2.3.0-alpha11", - "vue": "^3.3.4", - "vuetify": "^3.3.21" - }, - "devDependencies": { - "@tsconfig/node18": "^18.2.2", - "@types/jsdom": "^21.1.3", - "@types/node": "^18.17.17", - "@vitejs/plugin-vue": "^4.3.4", - "@vitejs/plugin-vue-jsx": "^3.0.2", - "@vue/test-utils": "^2.4.1", - "@vue/tsconfig": "^0.4.0", - "jsdom": "^22.1.0", - "npm-run-all2": "^6.0.6", - "start-server-and-test": "^2.0.0", - "typescript": "~5.2.0", - "vite": "^4.4.9", - "vitest": "^0.34.4", - "vue-tsc": "^1.8.11" - } -} diff --git a/packages/new_stats/public/favicon.png b/packages/new_stats/public/favicon.png deleted file mode 100644 index 49b8ba965b..0000000000 Binary files a/packages/new_stats/public/favicon.png and /dev/null differ diff --git a/packages/new_stats/src/main.ts b/packages/new_stats/src/main.ts deleted file mode 100644 index bd39520463..0000000000 --- a/packages/new_stats/src/main.ts +++ /dev/null @@ -1,12 +0,0 @@ -import "@mdi/font/css/materialdesignicons.css"; -import "vuetify/styles"; - -import { createApp } from "vue"; - -import App from "./App.vue"; -import vuetify from "./plugins/vuetify"; - -const app = createApp(App); - -app.use(vuetify); -app.mount("#app"); diff --git a/packages/new_stats/tsconfig.json b/packages/new_stats/tsconfig.json deleted file mode 100644 index 100cf6a8f2..0000000000 --- a/packages/new_stats/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "files": [], - "references": [ - { - "path": "./tsconfig.node.json" - }, - { - "path": "./tsconfig.app.json" - }, - { - "path": "./tsconfig.vitest.json" - } - ] -} diff --git a/packages/stats/.dockerignore b/packages/stats/.dockerignore deleted file mode 100644 index ede639bb0f..0000000000 --- a/packages/stats/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -public/build diff --git a/packages/new_stats/.gitignore b/packages/stats/.gitignore similarity index 100% rename from packages/new_stats/.gitignore rename to packages/stats/.gitignore diff --git a/packages/stats/Dockerfile b/packages/stats/Dockerfile index 134cafef8c..035842d608 100644 --- a/packages/stats/Dockerfile +++ b/packages/stats/Dockerfile @@ -8,5 +8,6 @@ COPY . /app/ RUN yarn install RUN yarn lerna run build --no-private && yarn workspace @threefold/stats build -FROM nginx:1.16.0-alpine -COPY --from=build /app/packages/stats/public /usr/share/nginx/html +FROM nginx:1.25.3-alpine +COPY --from=build /app/packages/stats/dist /usr/share/nginx/html +COPY --from=build /app/packages/stats/nginx /etc/nginx diff --git a/packages/stats/README.md b/packages/stats/README.md index 578fbbdb44..6c7ecd805b 100644 --- a/packages/stats/README.md +++ b/packages/stats/README.md @@ -1,17 +1,15 @@ # Grid Stats -![Version](https://img.shields.io/github/package-json/v/threefoldtech/tfgrid-sdk-ts?color=blue&filename=packages%2Fstats%2Fpackage.json) -[![Docker](https://github.com/threefoldtech/tfgrid-sdk-ts/actions/workflows/stats_docker.yaml/badge.svg)](https://github.com/threefoldtech/tfgrid-sdk-ts/actions/workflows/stats_docker.yaml) - ## Introduction Grid Stats is a web application created to replace explorer.threefold.io with a simple page showing a capacity map + statistics. In the map, you get to see node distribution with each node location highlighted. While in Statistics section, general details about the nodes are being displayed like online nodes, farms count, total storage used, gateways ...etc. +Also, you can select one or more networks to get their stats. ## Installation - **Prerequisite** - - Nodejs 16^ + - Nodejs 18^ - **Clone the repository** @@ -44,4 +42,4 @@ To create an optimised version of the app: yarn workspace @threefold/stats build ``` -This will generate the production build in the [public](./public/) directory, which can be served using [Caddy](https://caddyserver.com/) or [NGINX](https://www.nginx.com/) +This will generate the production build in the [dist](./dist/) directory, which can be served using [Caddy](https://caddyserver.com/) or [NGINX](https://www.nginx.com/) diff --git a/packages/stats/chart/README.md b/packages/stats/chart/README.md index 9bfe8d2ad4..1d5d97f369 100644 --- a/packages/stats/chart/README.md +++ b/packages/stats/chart/README.md @@ -17,7 +17,7 @@ #### 3. Using traefik ingress controller -```yaml +```yaml # Make sure traefik is installed. # Just replace the annotations with: annotations: @@ -26,6 +26,6 @@ #### 4. Deploying with nginx ingress and https -```bash +```bash helm install ./tfgrid-stats/ --values ./tfgrid-stats/values.yaml --set ingress.hosts[0].host= --set ingress.tls[0].hosts[0]= --set ingress.tls[0].secretName= ``` diff --git a/packages/stats/chart/values.yaml b/packages/stats/chart/values.yaml index a28a22a201..d422be1a33 100644 --- a/packages/stats/chart/values.yaml +++ b/packages/stats/chart/values.yaml @@ -33,6 +33,10 @@ ingress: cert-manager.io/cluster-issuer: letsencrypt kubernetes.io/ingress.class: nginx kubernetes.io/tls-acme: "true" + nginx.ingress.kubernetes.io/enable-cors: "true" + nginx.ingress.kubernetes.io/cors-allow-methods: "GET, OPTIONS" + nginx.ingress.kubernetes.io/cors-allow-origin: "*" + nginx.ingress.kubernetes.io/cors-allow-headers: "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization" hosts: - host: "domain.com" paths: diff --git a/packages/new_stats/index.html b/packages/stats/index.html similarity index 100% rename from packages/new_stats/index.html rename to packages/stats/index.html diff --git a/packages/new_stats/nginx/conf.d/default.conf b/packages/stats/nginx/conf.d/default.conf similarity index 100% rename from packages/new_stats/nginx/conf.d/default.conf rename to packages/stats/nginx/conf.d/default.conf diff --git a/packages/new_stats/nginx/nginx.conf b/packages/stats/nginx/nginx.conf similarity index 100% rename from packages/new_stats/nginx/nginx.conf rename to packages/stats/nginx/nginx.conf diff --git a/packages/new_stats/nginx/njs/cache.js b/packages/stats/nginx/njs/cache.js similarity index 100% rename from packages/new_stats/nginx/njs/cache.js rename to packages/stats/nginx/njs/cache.js diff --git a/packages/new_stats/nginx/njs/stats.js b/packages/stats/nginx/njs/stats.js similarity index 100% rename from packages/new_stats/nginx/njs/stats.js rename to packages/stats/nginx/njs/stats.js diff --git a/packages/stats/package.json b/packages/stats/package.json index cd1eaa8bc2..bda87fb4b3 100644 --- a/packages/stats/package.json +++ b/packages/stats/package.json @@ -3,29 +3,32 @@ "version": "2.3.0-alpha11", "private": true, "scripts": { - "build": "rollup -c", - "dev": "rollup -c -w", - "start": "sirv public --no-clear", - "check": "svelte-check --tsconfig ./tsconfig.json" - }, - "devDependencies": { - "@rollup/plugin-commonjs": "^17.0.0", - "@rollup/plugin-node-resolve": "^11.0.0", - "@rollup/plugin-typescript": "^8.0.0", - "@tsconfig/svelte": "^2.0.0", - "rollup": "^2.3.4", - "rollup-plugin-css-only": "^3.1.0", - "rollup-plugin-livereload": "^2.0.0", - "rollup-plugin-svelte": "^7.0.0", - "rollup-plugin-terser": "^7.0.0", - "svelte": "^3.0.0", - "svelte-check": "^2.0.0", - "svelte-preprocess": "^4.0.0", - "tslib": "^2.0.0", - "typescript": "^4.0.0" + "dev": "vite", + "build": "run-p type-check \"build-only {@}\" --", + "preview": "vite preview", + "test:unit": "vitest", + "build-only": "vite build", + "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false" }, "dependencies": { - "axios": "^0.27.2", - "sirv-cli": "^2.0.0" + "@threefold/gridproxy_client": "^2.3.0-alpha11", + "vue": "^3.3.4", + "vuetify": "^3.3.21" + }, + "devDependencies": { + "@tsconfig/node18": "^18.2.2", + "@types/jsdom": "^21.1.3", + "@types/node": "^18.17.17", + "@vitejs/plugin-vue": "^4.3.4", + "@vitejs/plugin-vue-jsx": "^3.0.2", + "@vue/test-utils": "^2.4.1", + "@vue/tsconfig": "^0.4.0", + "jsdom": "^22.1.0", + "npm-run-all2": "^6.0.6", + "start-server-and-test": "^2.0.0", + "typescript": "~5.2.0", + "vite": "^4.4.9", + "vitest": "^0.34.4", + "vue-tsc": "^1.8.11" } } diff --git a/packages/stats/public/assets/access.svg b/packages/stats/public/assets/access.svg deleted file mode 100644 index 553d69ebf3..0000000000 --- a/packages/stats/public/assets/access.svg +++ /dev/null @@ -1 +0,0 @@ -access \ No newline at end of file diff --git a/packages/stats/public/assets/contract.svg b/packages/stats/public/assets/contract.svg deleted file mode 100644 index 7a4e8398c8..0000000000 --- a/packages/stats/public/assets/contract.svg +++ /dev/null @@ -1 +0,0 @@ -contract \ No newline at end of file diff --git a/packages/stats/public/assets/countries.svg b/packages/stats/public/assets/countries.svg deleted file mode 100644 index 5dfef8f9ff..0000000000 --- a/packages/stats/public/assets/countries.svg +++ /dev/null @@ -1 +0,0 @@ -countries \ No newline at end of file diff --git a/packages/stats/public/assets/cpu.svg b/packages/stats/public/assets/cpu.svg deleted file mode 100644 index 02fbacb272..0000000000 --- a/packages/stats/public/assets/cpu.svg +++ /dev/null @@ -1 +0,0 @@ -cpu \ No newline at end of file diff --git a/packages/stats/public/assets/farms.svg b/packages/stats/public/assets/farms.svg deleted file mode 100644 index 06d36a5834..0000000000 --- a/packages/stats/public/assets/farms.svg +++ /dev/null @@ -1 +0,0 @@ -farms \ No newline at end of file diff --git a/packages/stats/public/assets/gateways.svg b/packages/stats/public/assets/gateways.svg deleted file mode 100644 index 37a32910b2..0000000000 --- a/packages/stats/public/assets/gateways.svg +++ /dev/null @@ -1 +0,0 @@ -gateways \ No newline at end of file diff --git a/packages/stats/public/assets/gpu.svg b/packages/stats/public/assets/gpu.svg deleted file mode 100644 index b75ddcee72..0000000000 --- a/packages/stats/public/assets/gpu.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/packages/stats/public/assets/hdd.svg b/packages/stats/public/assets/hdd.svg deleted file mode 100644 index b7a883b32f..0000000000 --- a/packages/stats/public/assets/hdd.svg +++ /dev/null @@ -1 +0,0 @@ -hdd \ No newline at end of file diff --git a/packages/stats/public/assets/ip.svg b/packages/stats/public/assets/ip.svg deleted file mode 100644 index ca363a768f..0000000000 --- a/packages/stats/public/assets/ip.svg +++ /dev/null @@ -1 +0,0 @@ -ip \ No newline at end of file diff --git a/packages/stats/public/assets/node.svg b/packages/stats/public/assets/node.svg deleted file mode 100644 index 4783410c70..0000000000 --- a/packages/stats/public/assets/node.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - diff --git a/packages/stats/public/assets/overview.svg b/packages/stats/public/assets/overview.svg deleted file mode 100644 index c1242e8956..0000000000 --- a/packages/stats/public/assets/overview.svg +++ /dev/null @@ -1 +0,0 @@ -overview \ No newline at end of file diff --git a/packages/stats/public/assets/ram.svg b/packages/stats/public/assets/ram.svg deleted file mode 100644 index 8403464da4..0000000000 --- a/packages/stats/public/assets/ram.svg +++ /dev/null @@ -1 +0,0 @@ -ram \ No newline at end of file diff --git a/packages/stats/public/assets/ssd.svg b/packages/stats/public/assets/ssd.svg deleted file mode 100644 index 51c2718017..0000000000 --- a/packages/stats/public/assets/ssd.svg +++ /dev/null @@ -1 +0,0 @@ -ssd \ No newline at end of file diff --git a/packages/stats/public/assets/twin.svg b/packages/stats/public/assets/twin.svg deleted file mode 100644 index 9671a03137..0000000000 --- a/packages/stats/public/assets/twin.svg +++ /dev/null @@ -1 +0,0 @@ -twin \ No newline at end of file diff --git a/packages/stats/public/favicon.png b/packages/stats/public/favicon.png index 7e6f5eb5a2..49b8ba965b 100644 Binary files a/packages/stats/public/favicon.png and b/packages/stats/public/favicon.png differ diff --git a/packages/stats/public/global.css b/packages/stats/public/global.css deleted file mode 100644 index 15d639ffea..0000000000 --- a/packages/stats/public/global.css +++ /dev/null @@ -1,69 +0,0 @@ -html, -body { - position: relative; - width: 100%; - height: 100%; -} - -body { - color: #333; - margin: 0; - padding: 0; - box-sizing: border-box; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", - sans-serif; - background-color: #ebe7e7; -} - -a { - color: rgb(0, 100, 200); - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - -a:visited { - color: rgb(0, 80, 160); -} - -label { - display: block; -} - -input, -button, -select, -textarea { - font-family: inherit; - font-size: inherit; - -webkit-padding: 0.4em 0; - padding: 0.4em; - margin: 0 0 0.5em 0; - box-sizing: border-box; - border: 1px solid #ccc; - border-radius: 2px; -} - -input:disabled { - color: #ccc; -} - -button { - color: #333; - background-color: #f4f4f4; - outline: none; -} - -button:disabled { - color: #999; -} - -button:not(:disabled):active { - background-color: #ddd; -} - -button:focus { - border-color: #666; -} diff --git a/packages/stats/public/index.html b/packages/stats/public/index.html deleted file mode 100644 index 8b24a2eddd..0000000000 --- a/packages/stats/public/index.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - Threefold Capacity - - - - - - - - - - - - diff --git a/packages/stats/rollup.config.js b/packages/stats/rollup.config.js deleted file mode 100644 index 6eb54a51d9..0000000000 --- a/packages/stats/rollup.config.js +++ /dev/null @@ -1,85 +0,0 @@ -import svelte from "rollup-plugin-svelte"; -import commonjs from "@rollup/plugin-commonjs"; -import resolve from "@rollup/plugin-node-resolve"; -import livereload from "rollup-plugin-livereload"; -import { terser } from "rollup-plugin-terser"; -import sveltePreprocess from "svelte-preprocess"; -import typescript from "@rollup/plugin-typescript"; -import css from "rollup-plugin-css-only"; -import preprocess from "svelte-preprocess"; - -const production = !process.env.ROLLUP_WATCH; - -function serve() { - let server; - - function toExit() { - if (server) server.kill(0); - } - - return { - writeBundle() { - if (server) return; - server = require("child_process").spawn("npm", ["run", "start", "--", "--dev"], { - stdio: ["ignore", "inherit", "inherit"], - shell: true, - }); - - process.on("SIGTERM", toExit); - process.on("exit", toExit); - }, - }; -} - -export default { - input: "src/main.ts", - output: { - sourcemap: true, - format: "iife", - name: "app", - file: "public/build/bundle.js", - }, - plugins: [ - svelte({ - preprocess: sveltePreprocess({ sourceMap: !production }), - compilerOptions: { - // enable run-time checks when not in production - dev: !production, - }, - preprocess: preprocess(), - }), - // we'll extract any component CSS out into - // a separate file - better for performance - css({ output: "bundle.css" }), - - // If you have external dependencies installed from - // npm, you'll most likely need these plugins. In - // some cases you'll need additional configuration - - // consult the documentation for details: - // https://github.com/rollup/plugins/tree/master/packages/commonjs - resolve({ - browser: true, - dedupe: ["svelte"], - }), - commonjs(), - typescript({ - sourceMap: !production, - inlineSources: !production, - }), - - // In dev mode, call `npm run start` once - // the bundle has been generated - !production && serve(), - - // Watch the `public` directory and refresh the - // browser on changes when not in production - !production && livereload("public"), - - // If we're building for production (npm run build - // instead of npm run dev), minify - production && terser(), - ], - watch: { - clearScreen: false, - }, -}; diff --git a/packages/stats/src/App.svelte b/packages/stats/src/App.svelte deleted file mode 100644 index df2e9f0dbe..0000000000 --- a/packages/stats/src/App.svelte +++ /dev/null @@ -1,161 +0,0 @@ - - -
-
- -
- {#if loading} -
- {:else if data} -

Node Distribution

-
-

{networks()}

-
-
-
- -
-
-
-
-

Statistics

- -
-
- {:else} -

Something went wrong. Please try again later.

- {/if} -
- - diff --git a/packages/new_stats/src/App.vue b/packages/stats/src/App.vue similarity index 100% rename from packages/new_stats/src/App.vue rename to packages/stats/src/App.vue diff --git a/packages/stats/src/components/Card.svelte b/packages/stats/src/components/Card.svelte deleted file mode 100644 index e7540dfc17..0000000000 --- a/packages/stats/src/components/Card.svelte +++ /dev/null @@ -1,3 +0,0 @@ -
- -
diff --git a/packages/stats/src/components/CardDetails.svelte b/packages/stats/src/components/CardDetails.svelte deleted file mode 100644 index 93edf635d2..0000000000 --- a/packages/stats/src/components/CardDetails.svelte +++ /dev/null @@ -1,81 +0,0 @@ - - - -
-
-

{card.title}

-
-
-
- -
-
{data}
-
-
-
- - diff --git a/packages/stats/src/components/CardList.svelte b/packages/stats/src/components/CardList.svelte deleted file mode 100644 index 2f799f06bf..0000000000 --- a/packages/stats/src/components/CardList.svelte +++ /dev/null @@ -1,109 +0,0 @@ - - -
- {#each stats as card, index (card.id)} - - {/each} -
- - diff --git a/packages/new_stats/src/components/network_filter.vue b/packages/stats/src/components/network_filter.vue similarity index 100% rename from packages/new_stats/src/components/network_filter.vue rename to packages/stats/src/components/network_filter.vue diff --git a/packages/new_stats/src/components/statistics_card.vue b/packages/stats/src/components/statistics_card.vue similarity index 100% rename from packages/new_stats/src/components/statistics_card.vue rename to packages/stats/src/components/statistics_card.vue diff --git a/packages/new_stats/src/components/stats_table.vue b/packages/stats/src/components/stats_table.vue similarity index 100% rename from packages/new_stats/src/components/stats_table.vue rename to packages/stats/src/components/stats_table.vue diff --git a/packages/stats/src/filters/toTeraOrGiga.ts b/packages/stats/src/filters/toTeraOrGiga.ts deleted file mode 100644 index 9892ee5bf1..0000000000 --- a/packages/stats/src/filters/toTeraOrGiga.ts +++ /dev/null @@ -1,21 +0,0 @@ -export default function toTeraOrGiga(value?: string) { - const giga = 1024 ** 3; - - if (!value) return "0"; - - const val = +value; - if (val === 0 || isNaN(val)) return "0"; - - if (val < giga) return val.toString(); - - let storageUnit = val / giga; - - if (storageUnit < 1024) return `${storageUnit.toFixed(0)} GB`; - - storageUnit = storageUnit / 1024; - - if (storageUnit < 1024) return `${storageUnit.toFixed(0)} TB`; - - storageUnit = storageUnit / 1024; - return `${storageUnit.toFixed(0)} PB`; -} diff --git a/packages/stats/src/global.d.ts b/packages/stats/src/global.d.ts deleted file mode 100644 index 1a25456a2c..0000000000 --- a/packages/stats/src/global.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/packages/stats/src/main.ts b/packages/stats/src/main.ts index 0976cdff58..bd39520463 100644 --- a/packages/stats/src/main.ts +++ b/packages/stats/src/main.ts @@ -1,10 +1,12 @@ -import App from "./App.svelte"; +import "@mdi/font/css/materialdesignicons.css"; +import "vuetify/styles"; -const app = new App({ - target: document.body, - props: { - name: "world", - }, -}); +import { createApp } from "vue"; -export default app; +import App from "./App.vue"; +import vuetify from "./plugins/vuetify"; + +const app = createApp(App); + +app.use(vuetify); +app.mount("#app"); diff --git a/packages/new_stats/src/plugins/vuetify.ts b/packages/stats/src/plugins/vuetify.ts similarity index 100% rename from packages/new_stats/src/plugins/vuetify.ts rename to packages/stats/src/plugins/vuetify.ts diff --git a/packages/new_stats/src/types/index.ts b/packages/stats/src/types/index.ts similarity index 100% rename from packages/new_stats/src/types/index.ts rename to packages/stats/src/types/index.ts diff --git a/packages/stats/src/types/map.ts b/packages/stats/src/types/map.ts deleted file mode 100644 index 127b6988ea..0000000000 --- a/packages/stats/src/types/map.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface MapActions { - update(country: string, nodes: number | null): void; -} diff --git a/packages/stats/src/utils/fetchData.ts b/packages/stats/src/utils/fetchData.ts deleted file mode 100644 index 50f602f610..0000000000 --- a/packages/stats/src/utils/fetchData.ts +++ /dev/null @@ -1,74 +0,0 @@ -import axios from "axios"; -import { writable } from "svelte/store"; - -export interface IStatsRes { - gpus: number; - nodes: number; - farms: number; - countries: number; - totalCru: number; - totalSru: number; - totalMru: number; - totalHru: number; - publicIps: number; - accessNodes: number; - gateways: number; - twins: number; - contracts: number; - nodesDistribution: { [country: string]: number }; -} - -export interface IStatus { - dev: boolean; - test: boolean; - main: boolean; -} - -function merge(...objs: unknown[]) { - const keys = new Set(objs.map(obj => Object.keys(obj)).flat()); - const [x, y, z] = objs; - - return Array.from(keys).reduce((res, key) => { - res[key] = (x[key] || 0) + (y[key] || 0) + (z[key] || 0); - return res; - }, {} as { [key: string]: number }); -} - -function fetchStats(url: string) { - return function _fetchStats(x = 0) { - return axios - .get(url) - .then(({ data }) => data) - .catch(error => { - if (x >= 2) console.log("The network might be down"); - else _fetchStats(x + 1); - }) as Promise; - }; -} - -export const status = writable({ - dev: false, - test: false, - main: false, -}); - -export async function fetchData() { - const dev = await fetchStats("https://gridproxy.dev.grid.tf/stats?status=up")(); - const test = await fetchStats("https://gridproxy.test.grid.tf/stats?status=up")(); - const main = await fetchStats("https://gridproxy.grid.tf/stats?status=up")(); - - status.set({ - dev: !!dev, - test: !!test, - main: !!main, - }); - - return { - ...merge(dev || {}, test || {}, main || {}), - nodesDistribution: merge( - dev?.nodesDistribution || {}, - test?.nodesDistribution || {}, - main?.nodesDistribution || {}, - ), - } as IStatsRes; -} diff --git a/packages/new_stats/src/utils/stats.ts b/packages/stats/src/utils/stats.ts similarity index 100% rename from packages/new_stats/src/utils/stats.ts rename to packages/stats/src/utils/stats.ts diff --git a/packages/new_stats/src/utils/toTeraOrGegaOrPeta.ts b/packages/stats/src/utils/toTeraOrGegaOrPeta.ts similarity index 100% rename from packages/new_stats/src/utils/toTeraOrGegaOrPeta.ts rename to packages/stats/src/utils/toTeraOrGegaOrPeta.ts diff --git a/packages/new_stats/src/views/statistics.vue b/packages/stats/src/views/statistics.vue similarity index 100% rename from packages/new_stats/src/views/statistics.vue rename to packages/stats/src/views/statistics.vue diff --git a/packages/new_stats/tsconfig.app.json b/packages/stats/tsconfig.app.json similarity index 100% rename from packages/new_stats/tsconfig.app.json rename to packages/stats/tsconfig.app.json diff --git a/packages/stats/tsconfig.json b/packages/stats/tsconfig.json index cd512921de..100cf6a8f2 100644 --- a/packages/stats/tsconfig.json +++ b/packages/stats/tsconfig.json @@ -1,11 +1,14 @@ { - "extends": "@tsconfig/svelte/tsconfig.json", - "include": [ - "src/**/*" - ], - "exclude": [ - "node_modules/*", - "__sapper__/*", - "public/*" + "files": [], + "references": [ + { + "path": "./tsconfig.node.json" + }, + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.vitest.json" + } ] -} \ No newline at end of file +} diff --git a/packages/new_stats/tsconfig.node.json b/packages/stats/tsconfig.node.json similarity index 100% rename from packages/new_stats/tsconfig.node.json rename to packages/stats/tsconfig.node.json diff --git a/packages/new_stats/tsconfig.vitest.json b/packages/stats/tsconfig.vitest.json similarity index 100% rename from packages/new_stats/tsconfig.vitest.json rename to packages/stats/tsconfig.vitest.json diff --git a/packages/new_stats/vite.config.ts b/packages/stats/vite.config.ts similarity index 100% rename from packages/new_stats/vite.config.ts rename to packages/stats/vite.config.ts diff --git a/packages/new_stats/vitest.config.ts b/packages/stats/vitest.config.ts similarity index 96% rename from packages/new_stats/vitest.config.ts rename to packages/stats/vitest.config.ts index 29ff4b9fd8..54a7a6d574 100644 --- a/packages/new_stats/vitest.config.ts +++ b/packages/stats/vitest.config.ts @@ -1,5 +1,5 @@ import { fileURLToPath } from "node:url"; -import { mergeConfig, defineConfig, configDefaults } from "vitest/config"; +import { mergeConfig, defineConfig, configDefaults } from "vitest/config.js"; import viteConfig from "./vite.config"; export default mergeConfig(