cuenti-dna 0.1.1-beta.2 → 0.1.1-beta.3
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/README.md +6 -2
- package/package.json +1 -1
- package/scripts/cli/constants.cjs +4 -0
- package/scripts/cli/workflows.cjs +47 -3
package/README.md
CHANGED
|
@@ -23,9 +23,13 @@ pnpm add cuenti-dna@beta
|
|
|
23
23
|
|
|
24
24
|
Cuando publiques una version estable, podras instalar con `@latest`.
|
|
25
25
|
|
|
26
|
-
### Inicializacion
|
|
26
|
+
### Inicializacion de estilos
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Durante la instalacion (`postinstall`):
|
|
29
|
+
|
|
30
|
+
- En terminal interactiva, se abre automaticamente un asistente (wizard) para configurar estilos.
|
|
31
|
+
- En entorno no interactivo, se intenta configurar automaticamente el primer archivo CSS detectado (por ejemplo `app/globals.css`, `src/index.css`, `src/main.css`, etc.).
|
|
32
|
+
- Si no se detecta un archivo CSS conocido, se muestra un mensaje de fallback para importar `cuenti-dna/styles.css` o ejecutar `init` manualmente.
|
|
29
33
|
|
|
30
34
|
Tambien puedes ejecutarlo manualmente cuando quieras:
|
|
31
35
|
|
package/package.json
CHANGED
|
@@ -186,6 +186,17 @@ const runInit = async (rawFlags) => {
|
|
|
186
186
|
})
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
+
const runInitFromPostinstall = async (flags) => {
|
|
190
|
+
try {
|
|
191
|
+
await runInit(flags)
|
|
192
|
+
return true
|
|
193
|
+
} catch (error) {
|
|
194
|
+
const details = error instanceof Error ? error.message : String(error)
|
|
195
|
+
log(`Setup skipped: ${details}`)
|
|
196
|
+
return false
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
189
200
|
const runPostinstall = async () => {
|
|
190
201
|
const packageRoot = path.resolve(__dirname, '..', '..')
|
|
191
202
|
const projectRoot = process.env.INIT_CWD
|
|
@@ -205,19 +216,52 @@ const runPostinstall = async () => {
|
|
|
205
216
|
}
|
|
206
217
|
|
|
207
218
|
if (!isInteractiveSession()) {
|
|
208
|
-
|
|
209
|
-
|
|
219
|
+
const existingCandidates = listExistingCssCandidates(projectRoot)
|
|
220
|
+
|
|
221
|
+
if (existingCandidates.length === 0) {
|
|
222
|
+
log(
|
|
223
|
+
'Skipped automatic CSS setup (non-interactive environment and no known CSS entry file found).'
|
|
224
|
+
)
|
|
225
|
+
log(
|
|
226
|
+
'Import "cuenti-dna/styles.css" once in your app entrypoint, or run "npx cuenti-dna@beta init --css <your-css-file>".'
|
|
227
|
+
)
|
|
228
|
+
return
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const targetCssFile = existingCandidates[0]
|
|
232
|
+
log(
|
|
233
|
+
`Detected non-interactive environment. Applying setup to ${targetCssFile}.`
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
const applied = await runInitFromPostinstall({
|
|
237
|
+
project: projectRoot,
|
|
238
|
+
css: targetCssFile,
|
|
239
|
+
yes: true,
|
|
240
|
+
overwrite: null,
|
|
241
|
+
help: false
|
|
242
|
+
})
|
|
243
|
+
|
|
244
|
+
if (!applied) {
|
|
245
|
+
log(
|
|
246
|
+
'Import "cuenti-dna/styles.css" once in your app entrypoint, or run "npx cuenti-dna@beta init" manually.'
|
|
247
|
+
)
|
|
248
|
+
}
|
|
249
|
+
|
|
210
250
|
return
|
|
211
251
|
}
|
|
212
252
|
|
|
213
253
|
log('Launching setup wizard...')
|
|
214
|
-
await
|
|
254
|
+
const applied = await runInitFromPostinstall({
|
|
215
255
|
project: projectRoot,
|
|
216
256
|
css: null,
|
|
217
257
|
yes: false,
|
|
218
258
|
overwrite: null,
|
|
219
259
|
help: false
|
|
220
260
|
})
|
|
261
|
+
|
|
262
|
+
if (!applied) {
|
|
263
|
+
log('Run "npx cuenti-dna@beta init" later to configure CSS tokens.')
|
|
264
|
+
}
|
|
221
265
|
}
|
|
222
266
|
|
|
223
267
|
module.exports = {
|