v1.0 with SW PWA enabled

This commit is contained in:
Blomios
2026-01-01 17:40:53 +01:00
parent 1c0e22aac1
commit 3c8bebb2ad
29775 changed files with 2197201 additions and 119080 deletions

View File

@ -1,14 +1,22 @@
# Build stage
FROM golang:1.22 AS builder
WORKDIR /app
COPY go.mod ./
COPY main.go ./
RUN go mod tidy
RUN go build -o backend main.go
# Run stage
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go mod tidy
RUN go build -o backend .
FROM debian:bookworm-slim
WORKDIR /app
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/backend .
COPY --from=builder /app/sql ./sql
EXPOSE 8080
CMD ["./backend"]

BIN
backend/backend Executable file

Binary file not shown.

View File

@ -1,3 +1,11 @@
module backend
go 1.22
require github.com/gorilla/mux v1.8.1
require github.com/rs/cors v1.11.1
require github.com/lib/pq v1.10.9
require github.com/jmoiron/sqlx v1.4.0 // indirect

11
backend/go.sum Normal file
View File

@ -0,0 +1,11 @@
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=
github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA=
github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=

View File

@ -0,0 +1,148 @@
package handlers
import (
"backend/models"
"backend/repositories"
"encoding/json"
"log"
"net/http"
"github.com/gorilla/mux"
)
type NodeHandler struct {
Repo *repositories.NodeRepository // On stocke le repo ici
}
var registeredNodes = make(map[string]models.NodeInfo)
func (h *NodeHandler) HandleRegisterNode(w http.ResponseWriter, r *http.Request) {
if r.Method != "POST" {
http.Error(w, "POST requested", http.StatusMethodNotAllowed)
return
}
var node models.NodeInfo
err := json.NewDecoder(r.Body).Decode(&node)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
var nodeID int
nodeID, err = h.Repo.RegisterNode(node)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
json.NewEncoder(w).Encode(map[string]int{"id": nodeID})
}
func (h *NodeHandler) HandleRetrieveNodeList(w http.ResponseWriter, r *http.Request) {
if r.Method != "GET" {
http.Error(w, "GET requested", http.StatusMethodNotAllowed)
return
}
log.Printf("All node retrieved")
var registeredNodes = make(map[string]models.FullNodeInfo)
var err error
registeredNodes, err = h.Repo.RetriveNodeList()
log.Printf("nb nodes: %v", len(registeredNodes))
if err != nil {
log.Fatalf("Request error on retrieving all node: %v", err)
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
w.Header().Set("Content-Type", "application/json")
err = json.NewEncoder(w).Encode(registeredNodes)
if err != nil {
log.Fatalf("Erreur lors de l'encodage JSON: %v", err)
http.Error(w, "Erreur lors de l'encodage JSON", http.StatusInternalServerError)
return
}
}
/*func (h *NodeHandler) HandleUpdateNode(w http.ResponseWriter, r *http.Request) {
if r.Method != "POST" {
http.Error(w, "POST requested", http.StatusMethodNotAllowed)
return
}
var nodeUpdate models.NodeUpdate
err := json.NewDecoder(r.Body).Decode(&nodeUpdate)
if err != nil {
http.Error(w, "Erreur lors du décodage du JSON", http.StatusBadRequest)
return
}
h.UpdateNode(nodeUpdate)
w.WriteHeader(http.StatusOK)
w.Write([]byte(`{"status": "success"}`))
}*/
func HandleUpdateNodes(w http.ResponseWriter, r *http.Request) {
if r.Method != "POST" {
http.Error(w, "POST requested", http.StatusMethodNotAllowed)
return
}
w.Header().Set("Content-Type", "application/json")
UpdateNodes()
}
/*func (h *NodeHandler) UpdateNode(nodeUpdate models.NodeUpdate) {
node, found := registeredNodes[nodeUpdate.NodeId]
if found {
updateServicesFromNode(&node)
h.Repo.UpdateNodeLastSeen(nodeUpdate.NodeId)
for _, serviceUpdate := range nodeUpdate.Services {
h.Repo.UpdateServiceStatus(serviceUpdate)
}
}
}*/
func HandleRetrieveNode(w http.ResponseWriter, r *http.Request) {
if r.Method != "GET" {
http.Error(w, "GET requested", http.StatusMethodNotAllowed)
return
}
w.Header().Set("Content-Type", "application/json")
params := mux.Vars(r)
nodeID := params["id"]
node, found := registeredNodes[nodeID]
if found {
// 4. Node trouvé : le retourner au format JSON
json.NewEncoder(w).Encode(node)
} else {
// 5. Node non trouvé : retourner une erreur 404
w.WriteHeader(http.StatusNotFound)
// Optionnel : Retourner un message d'erreur clair
errorResponse := map[string]string{"error": "Node non trouvé", "id": nodeID}
json.NewEncoder(w).Encode(errorResponse)
}
}
func UpdateNodes() {
/*for nodeId := range registeredNodes {
updateNode(nodeId)
}*/
}

View File

@ -0,0 +1,133 @@
package handlers
import (
"backend/models"
"encoding/json"
"log"
"net/http"
)
/*func retrieveServicesFromNode(node *models.NodeInfo) map[string]models.Service {
apiURL := node.Address + "/list"
resp, err := http.Get(apiURL)
log.Printf("retrieving node %s on address %s", node.Name, apiURL)
if err != nil {
log.Fatalf("Erreur lors de la requête : %v", err)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
log.Fatalf("Requête échouée avec le statut : %s", resp.Status)
}
bodyBytes, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatalf("Erreur lors de la lecture du corps de la réponse : %v", err)
}
var services []models.Service
err = json.Unmarshal(bodyBytes, &services)
if err != nil {
log.Fatalf("Erreur lors du décodage JSON : %v", err)
}
var result map[string]models.Service
for _, service := range services {
result[service.Name] = service
}
return result
}*/
func (h *NodeHandler) HandleRegisterService(w http.ResponseWriter, r *http.Request) {
if r.Method != "POST" {
http.Error(w, "POST requested", http.StatusMethodNotAllowed)
return
}
var serviceRegister models.ServiceRegister
err := json.NewDecoder(r.Body).Decode(&serviceRegister)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
var serviceID int
serviceID, err = h.Repo.RegisterService(serviceRegister.Service, serviceRegister.NodeId)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
json.NewEncoder(w).Encode(map[string]int{"id": serviceID})
}
func (h *NodeHandler) HandleUpdateServiceStatus(w http.ResponseWriter, r *http.Request) {
if r.Method != "POST" {
http.Error(w, "POST requested", http.StatusMethodNotAllowed)
return
}
var serviceUpdate models.ServiceUpdateRequest
err := json.NewDecoder(r.Body).Decode(&serviceUpdate)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
err = h.Repo.UpdateServiceStatus(serviceUpdate)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
}
/*func updateServicesFromNode(node *models.NodeInfo) {
node.Services = retrieveServicesFromNode(node)
}*/
func (h *NodeHandler) HandleDeleteService(w http.ResponseWriter, r *http.Request) {
if r.Method != "DELETE" {
http.Error(w, "DELETE requested", http.StatusMethodNotAllowed)
return
}
var serviceDelete models.ServiceMinimal
err := json.NewDecoder(r.Body).Decode(&serviceDelete)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
var node models.NodeInfo
node, err = h.Repo.RetriveNode(serviceDelete.NodeId)
if err == nil {
err = h.Repo.DeleteService(node, serviceDelete.ServiceId)
if err != nil {
log.Fatalf("error on deleteing service from node %v error : %v", serviceDelete.NodeId, err.Error())
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
w.Header().Set("Content-Type", "application/json")
} else {
log.Fatalf("Node not found %v error : %v", serviceDelete.NodeId, err.Error())
}
}

View File

@ -1,16 +1,64 @@
package main
import (
"fmt"
"backend/handlers"
"backend/repositories"
"database/sql"
"log"
"net/http"
"github.com/jmoiron/sqlx"
_ "github.com/lib/pq"
"github.com/gorilla/mux"
"github.com/rs/cors"
)
func main() {
http.HandleFunc("/api/hello", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, `{"message": "Hello World from Go!"}`)
dsn := "host=db user=admin password=admin dbname=monitoring sslmode=disable"
db, err := sql.Open("postgres", dsn)
if err != nil {
log.Fatal(err)
}
err = db.Ping()
if err != nil {
log.Fatal("Impossible de joindre la DB:", err)
}
dbSqlx := sqlx.NewDb(db, "postgres")
nodeRepo := &repositories.NodeRepository{DB: dbSqlx}
nodeHandler := &handlers.NodeHandler{
Repo: nodeRepo,
}
router := mux.NewRouter()
router.HandleFunc("/register", nodeHandler.HandleRegisterNode).Methods("POST")
router.HandleFunc("/registerService", nodeHandler.HandleRegisterService).Methods("POST")
router.HandleFunc("/updateServiceStatus", nodeHandler.HandleUpdateServiceStatus).Methods("POST")
router.HandleFunc("/retrieveNodeList", nodeHandler.HandleRetrieveNodeList).Methods("GET")
router.HandleFunc("/retrieveNode/{id}", handlers.HandleRetrieveNode).Methods("GET")
//router.HandleFunc("/updateNode/{id}", nodeHandler.HandleUpdateNode).Methods("POST")
//router.HandleFunc("/handleAddService/{NodeId}", handleUpdateNode).Methods("POST")
router.HandleFunc("/deleteService", nodeHandler.HandleDeleteService).Methods("DELETE")
c := cors.New(cors.Options{
// Remplacez par l'origine exacte de votre frontend
AllowedOrigins: []string{"http://localhost:3000"},
AllowedMethods: []string{"GET", "POST", "PATCH", "DELETE"},
AllowCredentials: true,
})
handler := c.Handler(router)
log.Println("Backend running on :8080")
log.Fatal(http.ListenAndServe(":8080", nil))
log.Fatal(http.ListenAndServe(":8080", handler))
}

View File

@ -0,0 +1,25 @@
CREATE TABLE nodes (
id SERIAL PRIMARY KEY,
name VARCHAR(50) NOT NULL,
address VARCHAR(50) NOT NULL,
status SMALLINT NOT NULL,
last_seen TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE services (
id SERIAL PRIMARY KEY,
node_id INTEGER NOT NULL REFERENCES nodes(id) ON DELETE CASCADE,
name VARCHAR(50) NOT NULL,
status SMALLINT NOT NULL,
command TEXT
);
CREATE TABLE status_records (
id SERIAL PRIMARY KEY,
service_id INTEGER NOT NULL REFERENCES services(id) ON DELETE CASCADE,
status SMALLINT NOT NULL,
timestamp TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_services_node_id ON services(node_id);
CREATE INDEX idx_status_history ON status_records (service_id, timestamp DESC);

34
backend/models/node.go Normal file
View File

@ -0,0 +1,34 @@
package models
import "time"
type NodeInfo struct {
Id int `json:"id"`
Name string `json:"name"`
Address string `json:"address"`
Status int16 `json:"status"`
LastSeen string `json:"last_seen"`
Services map[string]Service `json:"services"`
}
type SimpleNodeInfo struct {
Id int `db:"id" json:"id"`
Name string `db:"name" json:"name"`
Address string `db:"address" json:"address"`
Status int16 `db:"status" json:"status"`
LastSeen time.Time `db:"last_seen" json:"last_seen"`
}
type FullNodeInfo struct {
Id int `json:"id"`
Name string `json:"name"`
Address string `json:"address"`
Status int16 `json:"status"`
LastSeen string `json:"last_seen"`
Services []ServiceInfo `json:"services"`
}
type NodeUpdate struct {
NodeId string `json:"node_id"`
Services []ServiceUpdate `json:"services"`
}

48
backend/models/service.go Normal file
View File

@ -0,0 +1,48 @@
package models
import (
"time"
)
type ServiceUpdateRequest struct {
NodeId int `json:"nodeid"`
Services []ServiceUpdate `json:"services"`
}
type ServiceUpdate struct {
ServiceId int `json:"service_id"`
Status StatusRecord `json:"service_status"`
}
type StatusRecord struct {
Timestamp time.Time `json:"timestamp"`
Status uint `json:"status"`
}
type Service struct {
Id int `json:"id"`
Name string `json:"name"`
Command string `json:"command"`
}
type History struct {
Days []StatusRecord `json:"day"`
Hours []StatusRecord `json:"hour"`
Minutes []StatusRecord `json:"minute"`
}
type ServiceInfo struct {
Id int `json:"id"`
Name string `json:"name"`
Command string `json:"command"`
History History `json:"history"`
}
type ServiceRegister struct {
NodeId int `json:"node_id"`
Service Service `json:"service"`
}
type ServiceMinimal struct {
NodeId int `json:"node_id"`
ServiceId int `json:"service_id"`
}

View File

@ -0,0 +1,226 @@
package repositories
import (
"backend/models"
"bytes"
"database/sql"
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"time"
"github.com/jmoiron/sqlx"
"github.com/lib/pq"
_ "github.com/lib/pq"
)
type NodeRepository struct {
DB *sqlx.DB
}
func (r *NodeRepository) UpdateNodeLastSeen(nodeId string) error {
query, _ := os.ReadFile("sql/update_service_status.sql")
_, err := r.DB.Exec(string(query), nodeId, time.Now().UTC())
return err
}
func (r *NodeRepository) UpdateServiceStatus(serviceUpdate models.ServiceUpdateRequest) error {
query, _ := os.ReadFile("sql/update_service_status.sql")
var (
serviceIds []int
statuses []int
timestamps []time.Time
)
for _, s := range serviceUpdate.Services {
serviceIds = append(serviceIds, s.ServiceId)
statuses = append(statuses, int(s.Status.Status))
timestamps = append(timestamps, s.Status.Timestamp)
}
// lib/pq supporte le passage de slices Go vers les types array de Postgres
_, err := r.DB.Exec(string(query), pq.Array(serviceIds), pq.Array(statuses), pq.Array(timestamps))
return err
}
func (r *NodeRepository) RegisterNode(node models.NodeInfo) (int, error) {
log.Printf("Register node id %v, name %v, address %v", node.Id, node.Name, node.Address)
query, err := os.ReadFile("sql/register_node.sql")
if err != nil {
log.Printf("❌ Erreur de lecture SQL: %v", err)
return 0, err
}
var id int
err = r.DB.QueryRow(string(query), node.Name, node.Address, 0, node.Id).Scan(&id)
if err != nil {
if err == sql.ErrNoRows {
return node.Id, nil
}
return 0, err
}
return id, nil
}
func (r *NodeRepository) RegisterService(service models.Service, nodeId int) (int, error) {
log.Printf("Register service id %v, name %v, nodeId %v with command %v", service.Id, service.Name, nodeId, service.Command)
query, err := os.ReadFile("sql/register_service.sql")
if err != nil {
log.Printf("❌ Erreur de lecture SQL: %v", err)
return 0, err
}
var id int
err = r.DB.QueryRow(string(query), nodeId, service.Name, 0, service.Command, service.Id).Scan(&id)
if err != nil {
if err == sql.ErrNoRows {
return service.Id, nil
}
return 0, err
}
return id, nil
}
func (r *NodeRepository) RetriveNodeList() (map[string]models.FullNodeInfo, error) {
query, err := os.ReadFile("sql/retrieve_node_list.sql")
rows, err := r.DB.Query(string(query))
if err != nil {
return nil, err
}
defer rows.Close()
var nodes = make(map[string]models.FullNodeInfo)
for rows.Next() {
log.Printf("new node")
var node models.FullNodeInfo
var servicesData []byte // On récupère le JSON brut ici
// On scanne les colonnes dans l'ordre du SELECT
err := rows.Scan(
&node.Id,
&node.Name,
&node.Address,
&node.Status,
&node.LastSeen,
&servicesData,
)
if err != nil {
log.Printf("error on request")
return nil, err
}
// On décode le JSON des services dans la Map de la structure
if err := json.Unmarshal(servicesData, &node.Services); err != nil {
return nil, fmt.Errorf("error decoding services for node %d: %v", node.Id, err)
}
nodes[node.Name] = node
}
return nodes, nil
}
func deleteServiceFromNode(node *models.NodeInfo, serviceId int) error {
apiURL := node.Address + "/services"
bodyData := map[string]int{
"service_id": serviceId,
}
jsonData, err := json.Marshal(bodyData)
if err != nil {
return err
}
req, err := http.NewRequest(http.MethodDelete, apiURL, bytes.NewBuffer(jsonData)) // Le corps (body) est nil pour un DELETE
req.Header.Set("Content-Type", "application/json")
if err != nil {
return fmt.Errorf("Erreur lors de la création de la requête DELETE : %v", err)
}
client := http.Client{
Timeout: 10 * time.Second, // Définir un timeout
}
resp, err := client.Do(req)
if err != nil {
return fmt.Errorf("Erreur lors de l'exécution de la requête DELETE : %v", err)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusNoContent && resp.StatusCode != http.StatusOK {
return fmt.Errorf("Requête DELETE échouée pour %s. Statut : %s", apiURL, resp.Status)
}
log.Printf("Service %d supprimé avec succès. Réponse : %s", serviceId, resp.Status)
return nil
}
func (r *NodeRepository) DeleteService(node models.NodeInfo, serviceId int) error {
tx, err := r.DB.Begin()
log.Printf("Delete service id %v, on nodeId %v", serviceId, node.Id)
query, err := os.ReadFile("sql/delete_service.sql")
if err != nil {
log.Printf("❌ Erreur de lecture SQL: %v", err)
return err
}
_, err = tx.Exec(string(query), node.Id, serviceId)
if err != nil {
tx.Rollback()
return err
}
err = deleteServiceFromNode(&node, serviceId)
if err != nil {
// 4. LE NODE A ÉCHOUÉ : On annule tout en DB
tx.Rollback()
return fmt.Errorf("échec sur le node, annulation du changement en base de données : %w", err)
}
return tx.Commit()
}
func (r *NodeRepository) RetriveNode(nodeId int) (models.NodeInfo, error) {
query := "SELECT * FROM nodes WHERE id = $1"
var node models.SimpleNodeInfo
err := r.DB.Get(&node, query, nodeId)
if err != nil {
return models.NodeInfo{}, err
}
var result models.NodeInfo
result.Address = node.Address
result.Id = node.Id
result.LastSeen = node.LastSeen.String()
result.Name = node.Name
result.Status = node.Status
return result, nil
}

View File

@ -0,0 +1,3 @@
DELETE FROM services
WHERE node_id = $1
AND id = $2;

View File

@ -0,0 +1,6 @@
INSERT INTO nodes (name, address, status)
SELECT $1, $2, $3
WHERE NOT EXISTS (
SELECT 1 FROM nodes WHERE id = $4
)
RETURNING id;

View File

@ -0,0 +1,6 @@
INSERT INTO services (node_id, name, status, command)
SELECT $1, $2, $3, $4
WHERE NOT EXISTS (
SELECT 1 FROM nodes WHERE id = $5
)
RETURNING id;

View File

@ -0,0 +1,149 @@
WITH base_data AS (
-- On récupère les 60 derniers jours de données
SELECT
service_id,
status,
timestamp,
date_trunc('hour', timestamp) as hr_ts,
date_trunc('day', timestamp) as day_ts
FROM status_records
WHERE timestamp >= NOW() - INTERVAL '60 days'
),
time_slots_minutes AS (
-- On génère une série de 60 minutes jusqu'à maintenant
SELECT generate_series(
date_trunc('minute', now()) - interval '59 minutes',
date_trunc('minute', now()),
interval '1 minute'
) as slot
),
filled_minute_data AS (
-- On crée une ligne pour chaque minute et chaque service
SELECT
s.id as service_id,
ts.slot as timestamp,
-- On prend la valeur la plus récente si plusieurs existent dans la même minute,
-- sinon 3 s'il n'y a rien (COALESCE)
COALESCE(MAX(bd.status), 3) as status
FROM time_slots_minutes ts
CROSS JOIN services s
LEFT JOIN base_data bd ON
date_trunc('minute', bd.timestamp) = ts.slot
AND bd.service_id = s.id
GROUP BY s.id, ts.slot
),
minute_agg AS (
-- 60 dernières minutes
SELECT
service_id,
json_agg(
json_build_object('timestamp', timestamp, 'status', status)
ORDER BY timestamp DESC
) as data
FROM filled_minute_data
GROUP BY service_id
),
time_slots_hours AS (
SELECT generate_series(
date_trunc('hour', now()) - interval '23 hours', -- 23 car on inclut l'heure actuelle pour faire 24h
date_trunc('hour', now()),
interval '1 hour'
) as slot
),
filled_hours_data AS (
SELECT
s.id as service_id,
ts.slot as timestamp,
-- On récupère tous les statuts bruts de base_data qui tombent dans cette heure
-- On garde la liste pour calculer le ratio après
COALESCE(AVG(CASE WHEN bd.status = 1 THEN 1.0 WHEN bd.status = 3 THEN NULL ELSE 0.0 END), 3) as ratio
FROM time_slots_hours ts
CROSS JOIN services s
LEFT JOIN base_data bd ON
date_trunc('hour', bd.timestamp) = ts.slot
AND bd.service_id = s.id
GROUP BY s.id, ts.slot
),
hour_agg AS (
SELECT
service_id,
json_agg(
json_build_object(
'timestamp', timestamp,
'status', CASE
WHEN ratio = 3 THEN 3 -- Aucune donnée (Inconnu)
WHEN ratio >= 0.95 THEN 1 -- Presque tout l'heure est OK
WHEN ratio >= 0.5 THEN 2 -- Moitié de l'heure instable
ELSE 0 -- Majorité de l'heure en panne
END
) ORDER BY timestamp DESC
) as data
FROM filled_hours_data
GROUP BY service_id
),
time_slots_days AS (
-- On génère les 60 derniers jours
SELECT generate_series(
date_trunc('day', now()) - interval '59 days',
date_trunc('day', now()),
interval '1 day'
) as slot
),
filled_days_data AS (
-- On calcule le ratio pour chaque jour et chaque service
SELECT
s.id as service_id,
ts.slot as timestamp,
-- Ratio d'uptime : (points OK) / (points totaux réels)
-- Si aucun point n'existe du tout pour le jour, on met 3 (Inconnu)
COALESCE(
AVG(CASE WHEN bd.status = 1 THEN 1.0 WHEN bd.status = 3 THEN NULL ELSE 0.0 END),
3
) as ratio
FROM time_slots_days ts
CROSS JOIN services s
LEFT JOIN base_data bd ON
date_trunc('day', bd.timestamp) = ts.slot
AND bd.service_id = s.id
GROUP BY s.id, ts.slot
),
day_agg AS (
SELECT
service_id,
json_agg(
json_build_object(
'timestamp', timestamp,
'status', CASE
WHEN ratio = 3 THEN 3 -- Aucune donnée
WHEN ratio >= 0.98 THEN 1 -- Seuil d'excellence journalier
WHEN ratio >= 0.5 THEN 2 -- Journée instable
ELSE 0 -- Service majoritairement HS ce jour-là
END
) ORDER BY timestamp DESC
) as data
FROM filled_days_data
GROUP BY service_id
)
SELECT
n.id as id, n.name, n.address, n.status, n.last_seen,
COALESCE(
jsonb_agg(
json_build_object(
'id', s.id,
'name', s.name,
'command', s.command, -- La virgule ici est cruciale
'history', json_build_object(
'minute', COALESCE(ma.data, '[]'::json),
'hour', COALESCE(ha.data, '[]'::json),
'day', COALESCE(da.data, '[]'::json)
)
)
) FILTER (WHERE s.id IS NOT NULL),
'[]'::jsonb
) as services
FROM nodes n
LEFT JOIN services s ON n.id = s.node_id
LEFT JOIN minute_agg ma ON s.id = ma.service_id
LEFT JOIN hour_agg ha ON s.id = ha.service_id
LEFT JOIN day_agg da ON s.id = da.service_id
GROUP BY n.id;

View File

@ -0,0 +1,3 @@
UPDATE nodes SET
last_seen = $1
WHERE node_id = $2

View File

@ -0,0 +1,2 @@
INSERT INTO status_records (service_id, status, timestamp)
SELECT * FROM UNNEST($1::int[], $2::int[], $3::timestamptz[]);

View File

@ -1,26 +1,47 @@
version: "3.9"
services:
migrate:
image: migrate/migrate
volumes:
- ./backend/migrations:/migrations
networks:
- app-net
# On attend que la DB soit prête pour lancer les migrations
command: -path=/migrations/ -database "postgres://admin:admin@db:5432/monitoring?sslmode=disable" up
depends_on:
db:
condition: service_healthy
backend:
build: ./backend
container_name: backend
ports:
- "8080:8080"
networks:
- app-net
depends_on:
- db
migrate:
condition: service_completed_successfully
frontend:
build: ./frontend
container_name: frontend
ports:
- "3000:80"
networks:
- app-net
depends_on:
- backend
node:
build: ./node
container_name: node
environment:
- HOST_IP=192.168.1.75
ports:
- "8081:8081"
networks:
- app-net
volumes:
- node-data:/app
depends_on:
- backend
restart: unless-stopped
db:
image: postgres:16-alpine
container_name: db
@ -28,13 +49,36 @@ services:
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin
POSTGRES_DB: monitoring
ports:
- "5432:5432"
volumes:
- db-data:/var/lib/postgresql/data
networks:
- app-net
healthcheck:
test: ["CMD-SHELL", "pg_isready -U admin -d monitoring"]
interval: 5s
timeout: 5s
retries: 5
nginx:
image: nginx:alpine
container_name: monitor-proxy
ports:
- "8082:80"
- "444:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- frontend
- backend
networks:
- app-net
networks:
app-net:
driver: bridge
volumes:
db-data:
node-data:

View File

@ -1,33 +1,33 @@
# ===========================
# Build stage
# ===========================
FROM node:20-bullseye AS builder
# --- Étape 1 : Build du frontend ---
FROM node:22-alpine AS builder
# Définir le répertoire de travail
# Création du dossier
WORKDIR /app
# Copier package.json et package-lock.json pour utiliser le cache Docker
COPY package*.json ./
# Installation des dépendances
COPY package.json package-lock.json ./
# Installer les dépendances
RUN npm install
RUN npm install --legacy-peer-deps
# Copier tout le code source
# Copie du code source
COPY . .
# Lancer le build Vite + Tailwind
# Build du projet
RUN npm run build
# ===========================
# Production stage
# ===========================
# --- Étape 2 : Serveur web (Nginx) ---
FROM nginx:alpine
# Copier les fichiers build depuis le stage précédent
# Suppression de la config par défaut
RUN rm -rf /usr/share/nginx/html/*
# Copie du build
COPY --from=builder /app/dist /usr/share/nginx/html
# Exposer le port 80
# Copie (optionnelle) d'une config Nginx personnalisée
# COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
# Lancer Nginx
CMD ["nginx", "-g", "daemon off;"]

73
frontend/README.md Normal file
View File

@ -0,0 +1,73 @@
# Welcome to your Lovable project
## Project info
**URL**: https://lovable.dev/projects/82553482-2764-479c-9fb0-e221a43d5c5b
## How can I edit this code?
There are several ways of editing your application.
**Use Lovable**
Simply visit the [Lovable Project](https://lovable.dev/projects/82553482-2764-479c-9fb0-e221a43d5c5b) and start prompting.
Changes made via Lovable will be committed automatically to this repo.
**Use your preferred IDE**
If you want to work locally using your own IDE, you can clone this repo and push changes. Pushed changes will also be reflected in Lovable.
The only requirement is having Node.js & npm installed - [install with nvm](https://github.com/nvm-sh/nvm#installing-and-updating)
Follow these steps:
```sh
# Step 1: Clone the repository using the project's Git URL.
git clone <YOUR_GIT_URL>
# Step 2: Navigate to the project directory.
cd <YOUR_PROJECT_NAME>
# Step 3: Install the necessary dependencies.
npm i
# Step 4: Start the development server with auto-reloading and an instant preview.
npm run dev
```
**Edit a file directly in GitHub**
- Navigate to the desired file(s).
- Click the "Edit" button (pencil icon) at the top right of the file view.
- Make your changes and commit the changes.
**Use GitHub Codespaces**
- Navigate to the main page of your repository.
- Click on the "Code" button (green button) near the top right.
- Select the "Codespaces" tab.
- Click on "New codespace" to launch a new Codespace environment.
- Edit files directly within the Codespace and commit and push your changes once you're done.
## What technologies are used for this project?
This project is built with:
- Vite
- TypeScript
- React
- shadcn-ui
- Tailwind CSS
## How can I deploy this project?
Simply open [Lovable](https://lovable.dev/projects/82553482-2764-479c-9fb0-e221a43d5c5b) and click on Share -> Publish.
## Can I connect a custom domain to my Lovable project?
Yes, you can!
To connect a domain, navigate to Project > Settings > Domains and click Connect Domain.
Read more here: [Setting up a custom domain](https://docs.lovable.dev/features/custom-domain#custom-domain)

BIN
frontend/bun.lockb Normal file

Binary file not shown.

20
frontend/components.json Normal file
View File

@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/index.css",
"baseColor": "slate",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}

26
frontend/eslint.config.js Normal file
View File

@ -0,0 +1,26 @@
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
export default tseslint.config(
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
"@typescript-eslint/no-unused-vars": "off",
},
},
);

View File

@ -1,3 +0,0 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View File

@ -1,12 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Frontend PWA</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Status Monitor - Surveillance des Services</title>
<meta name="description" content="Dashboard de surveillance en temps réel de vos services et applications. Historique des statuts, gestion des nodes et alertes." />
<meta name="author" content="Status Monitor" />
<!-- PWA Meta Tags -->
<meta name="theme-color" content="#0a0a0b" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="StatusMon" />
<link rel="apple-touch-icon" href="/pwa-192x192.png" />
<!-- Open Graph -->
<meta property="og:title" content="Status Monitor - Surveillance des Services" />
<meta property="og:description" content="Dashboard de surveillance en temps réel de vos services et applications." />
<meta property="og:type" content="website" />
<meta property="og:image" content="https://lovable.dev/opengraph-image-p98pqg.png" />
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@StatusMonitor" />
<meta name="twitter:image" content="https://lovable.dev/opengraph-image-p98pqg.png" />
</head>
<body class="dark">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

View File

@ -1,14 +0,0 @@
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri /index.html;
}
location /api/ {
proxy_pass http://backend:8080;
}
}

1
frontend/node_modules/.bin/acorn generated vendored Symbolic link
View File

@ -0,0 +1 @@
../acorn/bin/acorn

View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../autoprefixer/bin/autoprefixer" "$@"
else
exec node "$basedir/../autoprefixer/bin/autoprefixer" "$@"
fi

1
frontend/node_modules/.bin/autoprefixer generated vendored Symbolic link
View File

@ -0,0 +1 @@
../autoprefixer/bin/autoprefixer

View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\autoprefixer\bin\autoprefixer" %*

View File

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../autoprefixer/bin/autoprefixer" $args
} else {
& "$basedir/node$exe" "$basedir/../autoprefixer/bin/autoprefixer" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../autoprefixer/bin/autoprefixer" $args
} else {
& "node$exe" "$basedir/../autoprefixer/bin/autoprefixer" $args
}
$ret=$LASTEXITCODE
}
exit $ret

1
frontend/node_modules/.bin/baseline-browser-mapping generated vendored Symbolic link
View File

@ -0,0 +1 @@
../baseline-browser-mapping/dist/cli.js

View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../browserslist/cli.js" "$@"
else
exec node "$basedir/../browserslist/cli.js" "$@"
fi

1
frontend/node_modules/.bin/browserslist generated vendored Symbolic link
View File

@ -0,0 +1 @@
../browserslist/cli.js

View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\browserslist\cli.js" %*

View File

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args
} else {
& "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../browserslist/cli.js" $args
} else {
& "node$exe" "$basedir/../browserslist/cli.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

16
frontend/node_modules/.bin/cssesc generated vendored
View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../cssesc/bin/cssesc" "$@"
else
exec node "$basedir/../cssesc/bin/cssesc" "$@"
fi

1
frontend/node_modules/.bin/cssesc generated vendored Symbolic link
View File

@ -0,0 +1 @@
../cssesc/bin/cssesc

View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\cssesc\bin\cssesc" %*

View File

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../cssesc/bin/cssesc" $args
} else {
& "$basedir/node$exe" "$basedir/../cssesc/bin/cssesc" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../cssesc/bin/cssesc" $args
} else {
& "node$exe" "$basedir/../cssesc/bin/cssesc" $args
}
$ret=$LASTEXITCODE
}
exit $ret

1
frontend/node_modules/.bin/ejs generated vendored Symbolic link
View File

@ -0,0 +1 @@
../ejs/bin/cli.js

16
frontend/node_modules/.bin/esbuild generated vendored
View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../esbuild/bin/esbuild" "$@"
else
exec node "$basedir/../esbuild/bin/esbuild" "$@"
fi

1
frontend/node_modules/.bin/esbuild generated vendored Symbolic link
View File

@ -0,0 +1 @@
../esbuild/bin/esbuild

View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esbuild\bin\esbuild" %*

View File

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../esbuild/bin/esbuild" $args
} else {
& "$basedir/node$exe" "$basedir/../esbuild/bin/esbuild" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../esbuild/bin/esbuild" $args
} else {
& "node$exe" "$basedir/../esbuild/bin/esbuild" $args
}
$ret=$LASTEXITCODE
}
exit $ret

1
frontend/node_modules/.bin/eslint generated vendored Symbolic link
View File

@ -0,0 +1 @@
../eslint/bin/eslint.js

16
frontend/node_modules/.bin/glob generated vendored
View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../glob/dist/esm/bin.mjs" "$@"
else
exec node "$basedir/../glob/dist/esm/bin.mjs" "$@"
fi

1
frontend/node_modules/.bin/glob generated vendored Symbolic link
View File

@ -0,0 +1 @@
../glob/dist/esm/bin.mjs

17
frontend/node_modules/.bin/glob.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\glob\dist\esm\bin.mjs" %*

28
frontend/node_modules/.bin/glob.ps1 generated vendored
View File

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../glob/dist/esm/bin.mjs" $args
} else {
& "$basedir/node$exe" "$basedir/../glob/dist/esm/bin.mjs" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../glob/dist/esm/bin.mjs" $args
} else {
& "node$exe" "$basedir/../glob/dist/esm/bin.mjs" $args
}
$ret=$LASTEXITCODE
}
exit $ret

1
frontend/node_modules/.bin/jake generated vendored Symbolic link
View File

@ -0,0 +1 @@
../jake/bin/cli.js

16
frontend/node_modules/.bin/jiti generated vendored
View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../jiti/bin/jiti.js" "$@"
else
exec node "$basedir/../jiti/bin/jiti.js" "$@"
fi

1
frontend/node_modules/.bin/jiti generated vendored Symbolic link
View File

@ -0,0 +1 @@
../jiti/bin/jiti.js

17
frontend/node_modules/.bin/jiti.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\jiti\bin\jiti.js" %*

28
frontend/node_modules/.bin/jiti.ps1 generated vendored
View File

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../jiti/bin/jiti.js" $args
} else {
& "$basedir/node$exe" "$basedir/../jiti/bin/jiti.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../jiti/bin/jiti.js" $args
} else {
& "node$exe" "$basedir/../jiti/bin/jiti.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

1
frontend/node_modules/.bin/js-yaml generated vendored Symbolic link
View File

@ -0,0 +1 @@
../js-yaml/bin/js-yaml.js

16
frontend/node_modules/.bin/jsesc generated vendored
View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../jsesc/bin/jsesc" "$@"
else
exec node "$basedir/../jsesc/bin/jsesc" "$@"
fi

1
frontend/node_modules/.bin/jsesc generated vendored Symbolic link
View File

@ -0,0 +1 @@
../jsesc/bin/jsesc

17
frontend/node_modules/.bin/jsesc.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\jsesc\bin\jsesc" %*

28
frontend/node_modules/.bin/jsesc.ps1 generated vendored
View File

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../jsesc/bin/jsesc" $args
} else {
& "$basedir/node$exe" "$basedir/../jsesc/bin/jsesc" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../jsesc/bin/jsesc" $args
} else {
& "node$exe" "$basedir/../jsesc/bin/jsesc" $args
}
$ret=$LASTEXITCODE
}
exit $ret

16
frontend/node_modules/.bin/json5 generated vendored
View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../json5/lib/cli.js" "$@"
else
exec node "$basedir/../json5/lib/cli.js" "$@"
fi

1
frontend/node_modules/.bin/json5 generated vendored Symbolic link
View File

@ -0,0 +1 @@
../json5/lib/cli.js

17
frontend/node_modules/.bin/json5.cmd generated vendored
View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\json5\lib\cli.js" %*

28
frontend/node_modules/.bin/json5.ps1 generated vendored
View File

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args
} else {
& "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../json5/lib/cli.js" $args
} else {
& "node$exe" "$basedir/../json5/lib/cli.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../loose-envify/cli.js" "$@"
else
exec node "$basedir/../loose-envify/cli.js" "$@"
fi

1
frontend/node_modules/.bin/loose-envify generated vendored Symbolic link
View File

@ -0,0 +1 @@
../loose-envify/cli.js

View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\loose-envify\cli.js" %*

View File

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../loose-envify/cli.js" $args
} else {
& "$basedir/node$exe" "$basedir/../loose-envify/cli.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../loose-envify/cli.js" $args
} else {
& "node$exe" "$basedir/../loose-envify/cli.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

16
frontend/node_modules/.bin/nanoid generated vendored
View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../nanoid/bin/nanoid.cjs" "$@"
else
exec node "$basedir/../nanoid/bin/nanoid.cjs" "$@"
fi

1
frontend/node_modules/.bin/nanoid generated vendored Symbolic link
View File

@ -0,0 +1 @@
../nanoid/bin/nanoid.cjs

View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nanoid\bin\nanoid.cjs" %*

View File

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
} else {
& "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
} else {
& "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
}
$ret=$LASTEXITCODE
}
exit $ret

View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../which/bin/node-which" "$@"
else
exec node "$basedir/../which/bin/node-which" "$@"
fi

1
frontend/node_modules/.bin/node-which generated vendored Symbolic link
View File

@ -0,0 +1 @@
../which/bin/node-which

View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\which\bin\node-which" %*

View File

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../which/bin/node-which" $args
} else {
& "$basedir/node$exe" "$basedir/../which/bin/node-which" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../which/bin/node-which" $args
} else {
& "node$exe" "$basedir/../which/bin/node-which" $args
}
$ret=$LASTEXITCODE
}
exit $ret

16
frontend/node_modules/.bin/parser generated vendored
View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
else
exec node "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
fi

1
frontend/node_modules/.bin/parser generated vendored Symbolic link
View File

@ -0,0 +1 @@
../@babel/parser/bin/babel-parser.js

View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@babel\parser\bin\babel-parser.js" %*

View File

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
} else {
& "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
} else {
& "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

1
frontend/node_modules/.bin/regjsparser generated vendored Symbolic link
View File

@ -0,0 +1 @@
../regjsparser/bin/parser

16
frontend/node_modules/.bin/resolve generated vendored
View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../resolve/bin/resolve" "$@"
else
exec node "$basedir/../resolve/bin/resolve" "$@"
fi

1
frontend/node_modules/.bin/resolve generated vendored Symbolic link
View File

@ -0,0 +1 @@
../resolve/bin/resolve

View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\resolve\bin\resolve" %*

View File

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args
} else {
& "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../resolve/bin/resolve" $args
} else {
& "node$exe" "$basedir/../resolve/bin/resolve" $args
}
$ret=$LASTEXITCODE
}
exit $ret

16
frontend/node_modules/.bin/rollup generated vendored
View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../rollup/dist/bin/rollup" "$@"
else
exec node "$basedir/../rollup/dist/bin/rollup" "$@"
fi

1
frontend/node_modules/.bin/rollup generated vendored Symbolic link
View File

@ -0,0 +1 @@
../rollup/dist/bin/rollup

View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\rollup\dist\bin\rollup" %*

View File

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../rollup/dist/bin/rollup" $args
} else {
& "$basedir/node$exe" "$basedir/../rollup/dist/bin/rollup" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../rollup/dist/bin/rollup" $args
} else {
& "node$exe" "$basedir/../rollup/dist/bin/rollup" $args
}
$ret=$LASTEXITCODE
}
exit $ret

16
frontend/node_modules/.bin/semver generated vendored
View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@"
else
exec node "$basedir/../semver/bin/semver.js" "$@"
fi

1
frontend/node_modules/.bin/semver generated vendored Symbolic link
View File

@ -0,0 +1 @@
../semver/bin/semver.js

View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver.js" %*

View File

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args
} else {
& "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../semver/bin/semver.js" $args
} else {
& "node$exe" "$basedir/../semver/bin/semver.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

16
frontend/node_modules/.bin/sucrase generated vendored
View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../sucrase/bin/sucrase" "$@"
else
exec node "$basedir/../sucrase/bin/sucrase" "$@"
fi

1
frontend/node_modules/.bin/sucrase generated vendored Symbolic link
View File

@ -0,0 +1 @@
../sucrase/bin/sucrase

View File

@ -1,16 +0,0 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*)
if command -v cygpath > /dev/null 2>&1; then
basedir=`cygpath -w "$basedir"`
fi
;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../sucrase/bin/sucrase-node" "$@"
else
exec node "$basedir/../sucrase/bin/sucrase-node" "$@"
fi

1
frontend/node_modules/.bin/sucrase-node generated vendored Symbolic link
View File

@ -0,0 +1 @@
../sucrase/bin/sucrase-node

View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\sucrase\bin\sucrase-node" %*

View File

@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../sucrase/bin/sucrase-node" $args
} else {
& "$basedir/node$exe" "$basedir/../sucrase/bin/sucrase-node" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../sucrase/bin/sucrase-node" $args
} else {
& "node$exe" "$basedir/../sucrase/bin/sucrase-node" $args
}
$ret=$LASTEXITCODE
}
exit $ret

View File

@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\sucrase\bin\sucrase" %*

Some files were not shown because too many files have changed in this diff Show More