thecore-auth 0.0.177 → 0.0.178
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deploy-scripts/setupDeploy.js +200 -0
- package/deploy-scripts/templates/.gitlab-ci.yml +130 -0
- package/deploy-scripts/templates/Dockerfile +5 -0
- package/deploy-scripts/templates/docker-compose.net.yml +13 -0
- package/deploy-scripts/templates/docker-compose.yml +15 -0
- package/deploy-scripts/templates/docker.env +3 -0
- package/deploy-scripts/templates/docker_host +1 -0
- package/dist/thecore-auth.cjs.js +1 -1
- package/dist/thecore-auth.esm.js +1 -1
- package/package.json +9 -3
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
console.log("Script di deploy eseguito! 🚀");
|
|
4
|
+
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
import readline from 'readline';
|
|
9
|
+
|
|
10
|
+
// Percorso corrente in ES Module
|
|
11
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
+
const __dirname = path.dirname(__filename);
|
|
13
|
+
|
|
14
|
+
// Cartella installations nella root
|
|
15
|
+
const installationsDir = path.join(__dirname, '..', 'installations');
|
|
16
|
+
|
|
17
|
+
// -------------------- FUNZIONI -------------------- //
|
|
18
|
+
|
|
19
|
+
// Controlla e crea la cartella installations
|
|
20
|
+
const checkAndCreateDir = () => {
|
|
21
|
+
if (fs.existsSync(installationsDir)) {
|
|
22
|
+
console.log('La cartella "installations" esiste già ✅');
|
|
23
|
+
} else {
|
|
24
|
+
fs.mkdirSync(installationsDir, { recursive: true });
|
|
25
|
+
console.log('Cartella "installations" creata con successo 🚀');
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// Controlla e crea i file Docker dentro installations
|
|
30
|
+
const checkAndCreateFiles = () => {
|
|
31
|
+
const files = ['docker-compose.net.yml', 'docker-compose.yml', 'Dockerfile'];
|
|
32
|
+
|
|
33
|
+
files.forEach(fileName => {
|
|
34
|
+
const filePath = path.join(installationsDir, fileName);
|
|
35
|
+
if (fs.existsSync(filePath)) {
|
|
36
|
+
console.log(`File "${fileName}" esiste ✅`);
|
|
37
|
+
} else {
|
|
38
|
+
let content = '';
|
|
39
|
+
if (fileName.endsWith('.yml')) content = '# Placeholder YAML\n';
|
|
40
|
+
if (fileName === 'Dockerfile') content = '# Placeholder Dockerfile\n';
|
|
41
|
+
fs.writeFileSync(filePath, content);
|
|
42
|
+
console.log(`File "${fileName}" creato 🚀`);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Controlla e crea la cartella abslabs_dev
|
|
48
|
+
const checkAndCreateAbslabsDev = () => {
|
|
49
|
+
const devDir = path.join(installationsDir, 'abslabs_dev');
|
|
50
|
+
if (fs.existsSync(devDir)) {
|
|
51
|
+
console.log('La cartella "abslabs_dev" esiste già ✅');
|
|
52
|
+
} else {
|
|
53
|
+
fs.mkdirSync(devDir, { recursive: true });
|
|
54
|
+
console.log('Cartella "abslabs_dev" creata con successo 🚀');
|
|
55
|
+
}
|
|
56
|
+
return devDir;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// Controlla e crea i file dentro abslabs_dev tranne docker.env
|
|
60
|
+
const checkAndCreateDevFiles = (devDir) => {
|
|
61
|
+
const devFiles = ['docker_host']; // docker.env gestito a parte
|
|
62
|
+
|
|
63
|
+
devFiles.forEach(fileName => {
|
|
64
|
+
const filePath = path.join(devDir, fileName);
|
|
65
|
+
if (fs.existsSync(filePath)) {
|
|
66
|
+
console.log(`File "${fileName}" esiste ✅`);
|
|
67
|
+
} else {
|
|
68
|
+
fs.writeFileSync(filePath, `# Placeholder ${fileName}\n`);
|
|
69
|
+
console.log(`File "${fileName}" creato 🚀`);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// Controlla e crea .gitlab-ci.yml nella root
|
|
75
|
+
const checkAndCreateGitlabCI = () => {
|
|
76
|
+
const gitlabFile = path.join(__dirname, '..', '.gitlab-ci.yml');
|
|
77
|
+
if (fs.existsSync(gitlabFile)) {
|
|
78
|
+
console.log('File ".gitlab-ci.yml" esiste già ✅');
|
|
79
|
+
} else {
|
|
80
|
+
const content = `# Placeholder GitLab CI\nstages:\n - deploy\n`;
|
|
81
|
+
fs.writeFileSync(gitlabFile, content);
|
|
82
|
+
console.log('File ".gitlab-ci.yml" creato 🚀');
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// Legge e logga il contenuto dei file Docker dentro installations
|
|
87
|
+
const readDockerFiles = () => {
|
|
88
|
+
const dockerFiles = ['docker-compose.net.yml', 'docker-compose.yml', 'Dockerfile'];
|
|
89
|
+
|
|
90
|
+
dockerFiles.forEach(fileName => {
|
|
91
|
+
const filePath = path.join(installationsDir, fileName);
|
|
92
|
+
if (fs.existsSync(filePath)) {
|
|
93
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
94
|
+
// console.log(`\nContenuto di "${fileName}":\n${content}`);
|
|
95
|
+
} else {
|
|
96
|
+
console.log(`File "${fileName}" non trovato ❌`);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// Funzione per chiedere in console il nome dell'app
|
|
102
|
+
const askAppName = () => {
|
|
103
|
+
const rl = readline.createInterface({
|
|
104
|
+
input: process.stdin,
|
|
105
|
+
output: process.stdout
|
|
106
|
+
});
|
|
107
|
+
return new Promise(resolve => {
|
|
108
|
+
rl.question('Inserisci il nome dell\'app per docker.env: ', (answer) => {
|
|
109
|
+
rl.close();
|
|
110
|
+
resolve(answer.trim());
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
// Sincronizza un singolo file con il template
|
|
116
|
+
const syncFileWithDefault = (sourcePath, targetPath) => {
|
|
117
|
+
const defaultContent = fs.readFileSync(sourcePath, 'utf-8');
|
|
118
|
+
|
|
119
|
+
let needsUpdate = false;
|
|
120
|
+
|
|
121
|
+
if (fs.existsSync(targetPath)) {
|
|
122
|
+
const currentContent = fs.readFileSync(targetPath, 'utf-8');
|
|
123
|
+
if (currentContent !== defaultContent) {
|
|
124
|
+
needsUpdate = true;
|
|
125
|
+
}
|
|
126
|
+
} else {
|
|
127
|
+
needsUpdate = true;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (needsUpdate) {
|
|
131
|
+
fs.writeFileSync(targetPath, defaultContent);
|
|
132
|
+
console.log(`File "${targetPath}" aggiornato con contenuto default 🚀`);
|
|
133
|
+
} else {
|
|
134
|
+
console.log(`File "${targetPath}" è già corretto ✅`);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// Sincronizza più file da templates
|
|
139
|
+
const syncFilesFromTemplates = (files, targetDir) => {
|
|
140
|
+
const templatesDir = path.join(__dirname, 'templates');
|
|
141
|
+
|
|
142
|
+
files.forEach(fileName => {
|
|
143
|
+
const source = path.join(templatesDir, fileName);
|
|
144
|
+
const target = path.join(targetDir, fileName);
|
|
145
|
+
syncFileWithDefault(source, target);
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
// Sincronizza docker.env sostituendo {{APP_NAME}} solo se necessario
|
|
150
|
+
const syncDockerEnvWithAppName = async (templatePath, targetPath) => {
|
|
151
|
+
let currentContent = '';
|
|
152
|
+
if (fs.existsSync(targetPath)) {
|
|
153
|
+
currentContent = fs.readFileSync(targetPath, 'utf-8');
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Controlla se il file contiene già un valore per APP_NAME
|
|
157
|
+
const appNameMatch = currentContent.match(/APP_NAME=(.+)/);
|
|
158
|
+
if (appNameMatch && appNameMatch[1].trim() !== '') {
|
|
159
|
+
console.log(`docker.env già contiene il nome dell'app: "${appNameMatch[1].trim()}" ✅`);
|
|
160
|
+
return; // non serve fare nulla
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Se non c'è o è vuoto, chiediamo il nome all'utente
|
|
164
|
+
const appName = await askAppName();
|
|
165
|
+
let content = fs.readFileSync(templatePath, 'utf-8');
|
|
166
|
+
content = content.replace(/{{APP_NAME}}/g, appName);
|
|
167
|
+
|
|
168
|
+
fs.writeFileSync(targetPath, content);
|
|
169
|
+
console.log(`File "${targetPath}" aggiornato con nome app "${appName}" 🚀`);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// -------------------- ESECUZIONE PRINCIPALE -------------------- //
|
|
173
|
+
|
|
174
|
+
const main = async () => {
|
|
175
|
+
checkAndCreateDir();
|
|
176
|
+
checkAndCreateFiles();
|
|
177
|
+
|
|
178
|
+
const devDir = checkAndCreateAbslabsDev();
|
|
179
|
+
checkAndCreateDevFiles(devDir);
|
|
180
|
+
|
|
181
|
+
checkAndCreateGitlabCI();
|
|
182
|
+
|
|
183
|
+
readDockerFiles();
|
|
184
|
+
|
|
185
|
+
// Sincronizzazione con template
|
|
186
|
+
const installationsFiles = ['docker-compose.net.yml', 'docker-compose.yml', 'Dockerfile'];
|
|
187
|
+
const abslabsDevFiles = ['docker_host']; // docker.env lo gestiamo a parte
|
|
188
|
+
const rootFiles = ['.gitlab-ci.yml'];
|
|
189
|
+
|
|
190
|
+
syncFilesFromTemplates(installationsFiles, installationsDir);
|
|
191
|
+
syncFilesFromTemplates(abslabsDevFiles, devDir);
|
|
192
|
+
syncFilesFromTemplates(rootFiles, path.join(__dirname, '..'));
|
|
193
|
+
|
|
194
|
+
// docker.env dinamico
|
|
195
|
+
const dockerEnvTemplate = path.join(__dirname, 'templates', 'docker.env');
|
|
196
|
+
const dockerEnvTarget = path.join(devDir, 'docker.env');
|
|
197
|
+
await syncDockerEnvWithAppName(dockerEnvTemplate, dockerEnvTarget);
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
main();
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
default:
|
|
2
|
+
# Defines the Docker image used for the CI/CD pipeline.
|
|
3
|
+
# This is a Node.js development container from Microsoft's devcontainers registry.
|
|
4
|
+
# The tag "1-22-bookworm" specifies the Node.js version (22) and the Debian base image (Bookworm).
|
|
5
|
+
image: docker:28.0.4
|
|
6
|
+
services:
|
|
7
|
+
- docker:28.0.4-dind # Abilita Docker-in-Docker
|
|
8
|
+
# mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm
|
|
9
|
+
|
|
10
|
+
# Defines the stages of the pipeline.
|
|
11
|
+
# In this case, only a "build" stage is defined.
|
|
12
|
+
stages:
|
|
13
|
+
- build
|
|
14
|
+
- deploy
|
|
15
|
+
|
|
16
|
+
# Defines CI/CD environment variables available during the job execution.
|
|
17
|
+
variables:
|
|
18
|
+
NODE_ENV: development # Sets the Node.js environment to "development" by default.
|
|
19
|
+
|
|
20
|
+
before_script:
|
|
21
|
+
# Installa Node.js 22 e npm
|
|
22
|
+
- apk add --no-cache nodejs npm
|
|
23
|
+
|
|
24
|
+
# Verifica che Node.js e npm siano installati
|
|
25
|
+
- node -v
|
|
26
|
+
- npm -v
|
|
27
|
+
# Get the version from the package.json file
|
|
28
|
+
- export VERSION=$(node -p -e "require('./package.json').version")
|
|
29
|
+
- export NAME=$(node -p -e "require('./package.json').name")
|
|
30
|
+
- export IMAGE_TAG_FRONTEND=${CI_REGISTRY_IMAGE}/frontend:$VERSION
|
|
31
|
+
|
|
32
|
+
# Defines a job named "build" that runs during the "build" stage.
|
|
33
|
+
build:
|
|
34
|
+
stage: build
|
|
35
|
+
only:
|
|
36
|
+
refs:
|
|
37
|
+
- release/3 # Ensures this job runs only on the "release/3" branch.
|
|
38
|
+
changes:
|
|
39
|
+
- package.json # Runs this job only if "package.json" is modified in a commit.
|
|
40
|
+
|
|
41
|
+
script:
|
|
42
|
+
# Cleans up previous build artifacts and dependencies to ensure a fresh installation.
|
|
43
|
+
- rm -rf dist node_modules package-lock.json
|
|
44
|
+
|
|
45
|
+
# Configures npm authentication for the GitLab package registry.
|
|
46
|
+
# This writes an authentication token to the ".npmrc" file, allowing npm to publish the package.
|
|
47
|
+
- echo "//devops.bancolini.com/api/v4/packages/npm/:_authToken=${CI_JOB_TOKEN}" > .npmrc
|
|
48
|
+
- echo "@dev:registry=https://devops.bancolini.com/api/v4/packages/npm/" >> .npmrc
|
|
49
|
+
# DHTMLX npm registry configuration
|
|
50
|
+
- echo "@dhx:registry=https://npm.dhtmlx.com/" >> .npmrc
|
|
51
|
+
- echo "//npm.dhtmlx.com/:_authToken=\"${DHTMLX_AUTH_TOKEN}\"" >> .npmrc
|
|
52
|
+
|
|
53
|
+
# Installs project dependencies based on package.json.
|
|
54
|
+
- npm install
|
|
55
|
+
|
|
56
|
+
# Runs the build script defined in package.json (e.g., transpiling TypeScript, bundling files, etc.).
|
|
57
|
+
- npm run build
|
|
58
|
+
|
|
59
|
+
# After generating the dist folder, the Dockerfile is used to build the frontend image.
|
|
60
|
+
- cp installations/Dockerfile .
|
|
61
|
+
- docker version
|
|
62
|
+
- docker build --no-cache --pull -t "${IMAGE_TAG_FRONTEND}" .
|
|
63
|
+
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
|
|
64
|
+
- docker image push "${IMAGE_TAG_FRONTEND}"
|
|
65
|
+
|
|
66
|
+
deploy:
|
|
67
|
+
stage: deploy # Specifies that this job belongs to the "deploy" stage.
|
|
68
|
+
|
|
69
|
+
# This job must run only if thw build one is successful
|
|
70
|
+
dependencies:
|
|
71
|
+
- build
|
|
72
|
+
|
|
73
|
+
only:
|
|
74
|
+
refs:
|
|
75
|
+
- release/3 # Ensures this job runs only on the "release/3" branch.
|
|
76
|
+
changes:
|
|
77
|
+
- package.json # Runs this job only if "package.json" is modified in a commit.
|
|
78
|
+
|
|
79
|
+
script:
|
|
80
|
+
# Install rsync and ssh to alpine
|
|
81
|
+
- apk add --no-cache rsync openssh-client
|
|
82
|
+
# Image correctly pushed to the registry, now we can send the image to the Labs
|
|
83
|
+
- export UUID=$(cat /proc/sys/kernel/random/uuid)
|
|
84
|
+
- export RELATIVE_DIR="/installers/$UUID"
|
|
85
|
+
- export TARGET_DIR="/tmp$RELATIVE_DIR"
|
|
86
|
+
|
|
87
|
+
# SSH setup
|
|
88
|
+
- mkdir -p ~/.ssh
|
|
89
|
+
- chmod 700 ~/.ssh
|
|
90
|
+
- echo -e "Host *\n\tStrictHostKeyChecking no\n\tControlMaster auto\n\tControlPath ~/.ssh/socket-%C\n\tControlPersist 1\n\n" > ~/.ssh/config
|
|
91
|
+
- chmod 600 ~/.ssh/config
|
|
92
|
+
- echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
|
|
93
|
+
- chmod 600 ~/.ssh/id_rsa
|
|
94
|
+
|
|
95
|
+
# cycle into the installations folder for all the folders containing the docker_host file
|
|
96
|
+
- |
|
|
97
|
+
for i in $(ls -d installations/*/); do
|
|
98
|
+
if [ -f "$i/docker_host" ]; then
|
|
99
|
+
export INSTALLATION_DIR=$i
|
|
100
|
+
DOCKER_HOST="$(cat "$i/docker_host")"
|
|
101
|
+
export DOCKER_HOST
|
|
102
|
+
echo "HOST $DOCKER_HOST"
|
|
103
|
+
DOCKER_HOST_DOMAIN="$(echo "$DOCKER_HOST" | cut -d'/' -f3 | cut -d':' -f1)"
|
|
104
|
+
export DOCKER_HOST_DOMAIN
|
|
105
|
+
echo "DOMAIN $DOCKER_HOST_DOMAIN"
|
|
106
|
+
DOCKER_HOST_PORT="$(echo "$DOCKER_HOST" | cut -d'/' -f3 | cut -d':' -f2)"
|
|
107
|
+
export DOCKER_HOST_PORT
|
|
108
|
+
echo "PORT $DOCKER_HOST_PORT"
|
|
109
|
+
|
|
110
|
+
echo "Preparing target installer dir and rsync needed files into it"
|
|
111
|
+
rsync -arvz -e "ssh -p $DOCKER_HOST_PORT" --rsync-path "mkdir -p $TARGET_DIR && /usr/bin/rsync" --progress --delete installations/docker-compose.yml installations/docker-compose.net.yml "$i/docker.env" "${DOCKER_HOST_DOMAIN}:$TARGET_DIR"
|
|
112
|
+
export IMAGE_TAG_FRONTEND
|
|
113
|
+
echo "IMAGE TAG FRONTEND $IMAGE_TAG_FRONTEND"
|
|
114
|
+
ssh -n "$DOCKER_HOST_DOMAIN" -p "$DOCKER_HOST_PORT" "
|
|
115
|
+
echo Login to $CI_REGISTRY
|
|
116
|
+
echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY || exit 1
|
|
117
|
+
export IMAGE_TAG_FRONTEND=$IMAGE_TAG_FRONTEND
|
|
118
|
+
echo CD into $TARGET_DIR
|
|
119
|
+
cd $TARGET_DIR
|
|
120
|
+
echo Testing Config
|
|
121
|
+
docker compose -f docker-compose.yml -f docker-compose.net.yml --env-file docker.env config || exit 2
|
|
122
|
+
echo Compose up
|
|
123
|
+
docker compose -f docker-compose.yml -f docker-compose.net.yml --env-file docker.env up -d --remove-orphans --no-build || exit 3
|
|
124
|
+
echo Cleaning Docker system
|
|
125
|
+
docker system prune -f
|
|
126
|
+
docker logout $CI_REGISTRY
|
|
127
|
+
cd ..
|
|
128
|
+
rm -rf $TARGET_DIR"
|
|
129
|
+
fi
|
|
130
|
+
done
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
services:
|
|
2
|
+
frontend:
|
|
3
|
+
networks:
|
|
4
|
+
- webproxy
|
|
5
|
+
|
|
6
|
+
# This network is fixed to webproxy since is the name used in
|
|
7
|
+
# our production environments for the nginx-proxy docker image
|
|
8
|
+
# this way it can pickup the new rails app automatically and proxy it
|
|
9
|
+
# via http(s)
|
|
10
|
+
networks:
|
|
11
|
+
webproxy:
|
|
12
|
+
name: webproxy
|
|
13
|
+
external: true
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
services:
|
|
2
|
+
frontend:
|
|
3
|
+
image: ${IMAGE_TAG_FRONTEND}
|
|
4
|
+
restart: unless-stopped
|
|
5
|
+
environment:
|
|
6
|
+
VIRTUAL_HOST: ${FRONTEND_DOMAIN}
|
|
7
|
+
LETSENCRYPT_HOST: ${FRONTEND_DOMAIN}
|
|
8
|
+
FRONTEND_DOMAIN: ${FRONTEND_DOMAIN}
|
|
9
|
+
COMPOSE_PROJECT_NAME: ${COMPOSE_PROJECT_NAME}
|
|
10
|
+
CUSTOMER_FOLDER: ${COMPOSE_PROJECT_NAME}
|
|
11
|
+
healthcheck:
|
|
12
|
+
test: "${DOCKER_HEALTHCHECK_TEST:-curl --fail http://localhost:80/}"
|
|
13
|
+
interval: "60s"
|
|
14
|
+
timeout: "3s"
|
|
15
|
+
retries: 3
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ssh://root@45.79.250.152:22
|
package/dist/thecore-auth.cjs.js
CHANGED
|
@@ -28,7 +28,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
28
28
|
|
|
29
29
|
Check the render method of \``+j+"`."),O||(g=e(g))&&(O=`
|
|
30
30
|
|
|
31
|
-
Check the top-level render call using <`+g+">."),O}var T=p,M=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),B=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),he=Symbol.for("react.suspense"),Se=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),ye=Symbol.for("react.offscreen"),q=Symbol.iterator,G=Symbol.for("react.client.reference"),se=T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=Object.prototype.hasOwnProperty,pe=Object.assign,Nt=Symbol.for("react.client.reference"),qe=Array.isArray,Ye=0,re,ee,W,oe,Y,Pe,Ke;i.__reactDisabledLog=!0;var Xe,Ze,dt=!1,Bt=new(typeof WeakMap=="function"?WeakMap:Map),$n=Symbol.for("react.client.reference"),Je,ft={},ht={},_e={};mn.Fragment=R,mn.jsx=function(g,O,j,H,le){return y(g,O,j,!1,H,le)},mn.jsxs=function(g,O,j,H,le){return y(g,O,j,!0,H,le)}}()),mn}var xr;function $c(){return xr||(xr=1,process.env.NODE_ENV==="production"?Wn.exports=_c():Wn.exports=Fc()),Wn.exports}var h=$c();const la=p.createContext(),zc=({children:e,defaultComponent:t})=>{const[n,i]=p.useState(!1),[s,o]=p.useState({}),[r,a]=p.useState(t),c={isLoading:n,setIsLoading:i,loadingProps:s,setLoadingProps:o,loadingComponent:r,setLoadingComponent:a,showLoadingFor:(u=2e3,d={})=>{o(d),i(!0),setTimeout(()=>{i(!1)},u)}};return h.jsx(la.Provider,{value:c,children:e})},It=()=>{const e=p.useContext(la);if(e===void 0)throw new Error("Non puoi settare il loading");return e},Uc="0.0.
|
|
31
|
+
Check the top-level render call using <`+g+">."),O}var T=p,M=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),B=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),he=Symbol.for("react.suspense"),Se=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),ye=Symbol.for("react.offscreen"),q=Symbol.iterator,G=Symbol.for("react.client.reference"),se=T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=Object.prototype.hasOwnProperty,pe=Object.assign,Nt=Symbol.for("react.client.reference"),qe=Array.isArray,Ye=0,re,ee,W,oe,Y,Pe,Ke;i.__reactDisabledLog=!0;var Xe,Ze,dt=!1,Bt=new(typeof WeakMap=="function"?WeakMap:Map),$n=Symbol.for("react.client.reference"),Je,ft={},ht={},_e={};mn.Fragment=R,mn.jsx=function(g,O,j,H,le){return y(g,O,j,!1,H,le)},mn.jsxs=function(g,O,j,H,le){return y(g,O,j,!0,H,le)}}()),mn}var xr;function $c(){return xr||(xr=1,process.env.NODE_ENV==="production"?Wn.exports=_c():Wn.exports=Fc()),Wn.exports}var h=$c();const la=p.createContext(),zc=({children:e,defaultComponent:t})=>{const[n,i]=p.useState(!1),[s,o]=p.useState({}),[r,a]=p.useState(t),c={isLoading:n,setIsLoading:i,loadingProps:s,setLoadingProps:o,loadingComponent:r,setLoadingComponent:a,showLoadingFor:(u=2e3,d={})=>{o(d),i(!0),setTimeout(()=>{i(!1)},u)}};return h.jsx(la.Provider,{value:c,children:e})},It=()=>{const e=p.useContext(la);if(e===void 0)throw new Error("Non puoi settare il loading");return e},Uc="0.0.178",ca=({errorMessage:e,errorShow:t})=>h.jsx("section",{className:t?"":"hidden",children:h.jsxs("div",{className:"container mx-auto",children:[h.jsx("h1",{className:"text-center text-8xl my-12",children:"Errore"}),h.jsx("pre",{className:"text-xl",children:e})]})}),ua=p.createContext(),Hc=({children:e})=>{const[t,n]=p.useState({}),[i,s]=p.useState(!1),o=p.useRef(!1),r=`Creare un file config.json in public per il corretto funzionamento
|
|
32
32
|
Esempio di config.json:
|
|
33
33
|
|
|
34
34
|
{
|
package/dist/thecore-auth.esm.js
CHANGED
|
@@ -459,7 +459,7 @@ const xa = Nt(), g0 = ({ children: t, defaultComponent: e }) => {
|
|
|
459
459
|
const t = ct(xa);
|
|
460
460
|
if (t === void 0) throw new Error("Non puoi settare il loading");
|
|
461
461
|
return t;
|
|
462
|
-
}, Xc = "0.0.
|
|
462
|
+
}, Xc = "0.0.178", Zc = ({ errorMessage: t, errorShow: e }) => /* @__PURE__ */ h.jsx("section", { className: e ? "" : "hidden", children: /* @__PURE__ */ h.jsxs("div", { className: "container mx-auto", children: [
|
|
463
463
|
/* @__PURE__ */ h.jsx("h1", { className: "text-center text-8xl my-12", children: "Errore" }),
|
|
464
464
|
/* @__PURE__ */ h.jsx("pre", { className: "text-xl", children: t })
|
|
465
465
|
] }) }), wa = Nt(), y0 = ({ children: t }) => {
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thecore-auth",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.178",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/thecore-auth.cjs.js",
|
|
7
7
|
"style": "dist/thecore-auth.css",
|
|
8
8
|
"module": "dist/thecore-auth.esm.js",
|
|
9
|
+
"bin": {
|
|
10
|
+
"setup-deploy": "./deploy-scripts/setupDeploy.js"
|
|
11
|
+
},
|
|
9
12
|
"exports": {
|
|
10
13
|
".": {
|
|
11
14
|
"import": "./dist/thecore-auth.esm.js",
|
|
@@ -17,7 +20,8 @@
|
|
|
17
20
|
"build": "vite build",
|
|
18
21
|
"lint": "eslint .",
|
|
19
22
|
"preview": "vite preview",
|
|
20
|
-
"increment-version": "npm version patch && git push"
|
|
23
|
+
"increment-version": "npm version patch && git push",
|
|
24
|
+
"setup-deploy": "node ./deploy-scripts/setupDeploy.js"
|
|
21
25
|
},
|
|
22
26
|
"peerDependencies": {
|
|
23
27
|
"react": "^19.0.0",
|
|
@@ -57,7 +61,9 @@
|
|
|
57
61
|
"dist",
|
|
58
62
|
"README.md",
|
|
59
63
|
"CSS variables documentation.md",
|
|
60
|
-
"!dist/config.json"
|
|
64
|
+
"!dist/config.json",
|
|
65
|
+
"deploy-scripts",
|
|
66
|
+
"deploy-scripts/templates"
|
|
61
67
|
],
|
|
62
68
|
"repository": {
|
|
63
69
|
"type": "git",
|