@massimo-cassandro/minimo 1.21.9 → 1.21.10
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.
|
@@ -141,21 +141,22 @@ safe_cat "${TEMPLATES_DIR}/_prettierrc" .prettierrc new
|
|
|
141
141
|
safe_cat "${TEMPLATES_DIR}/_root_htaccess" _root_htaccess
|
|
142
142
|
safe_cat "${TEMPLATES_DIR}/_root_robots.txt" _root_robots.txt
|
|
143
143
|
|
|
144
|
-
# jsconfig.json:
|
|
145
|
-
#
|
|
146
|
-
#
|
|
144
|
+
# jsconfig.json: sta SEMPRE nella root del progetto (è anche il file di
|
|
145
|
+
# riferimento di vscode). I suoi path sono quindi relativi alla root: il
|
|
146
|
+
# placeholder __FRONTEND__ viene risolto in base alla posizione scelta.
|
|
147
|
+
# NB: webpack.config.mjs lo cerca in root anche quando è in una sottodirectory
|
|
147
148
|
if [ "$FRONTEND_INSTALL_PATH" = "." ]; then
|
|
148
|
-
|
|
149
|
+
FRONTEND_REL="./"
|
|
149
150
|
else
|
|
150
|
-
|
|
151
|
+
FRONTEND_REL="./frontend/"
|
|
151
152
|
fi
|
|
152
153
|
JSCONFIG_TPL="${TEMPLATES_DIR}/jsconfig.json"
|
|
153
154
|
if [ ! -f "$JSCONFIG_TPL" ]; then
|
|
154
155
|
echo -e "${RED}Sorgente mancante: ${JSCONFIG_TPL}${NC}"
|
|
155
156
|
else
|
|
156
157
|
JSCONFIG_TMP="$(mktemp)"
|
|
157
|
-
sed "s|
|
|
158
|
-
safe_cat "$JSCONFIG_TMP"
|
|
158
|
+
sed "s|__FRONTEND__|${FRONTEND_REL}|g" "$JSCONFIG_TPL" >| "$JSCONFIG_TMP"
|
|
159
|
+
safe_cat "$JSCONFIG_TMP" jsconfig.json new
|
|
159
160
|
rm -f "$JSCONFIG_TMP"
|
|
160
161
|
fi
|
|
161
162
|
|
|
@@ -247,17 +248,34 @@ mkdir -p \
|
|
|
247
248
|
# template html di webpack (HtmlWebpackPlugin: `./src/tpl/index.ejs`)
|
|
248
249
|
safe_cat "${WEBPACK_SOURCE_DIR}/webpack-template.ejs" "${FRONTEND_INSTALL_PATH}/src/tpl/index.ejs"
|
|
249
250
|
|
|
250
|
-
#
|
|
251
|
-
#
|
|
252
|
-
#
|
|
253
|
-
|
|
254
|
-
for
|
|
255
|
-
|
|
251
|
+
# Sorgenti di minimo da copiare nel progetto: si usa il pacchetto appena
|
|
252
|
+
# installato in node_modules (stessa versione che userà il progetto) e, in
|
|
253
|
+
# fallback, la dir da cui è lanciato questo script (repo o pacchetto estratto)
|
|
254
|
+
MINIMO_PKG_DIR=""
|
|
255
|
+
for CANDIDATE in "./node_modules/@massimo-cassandro/minimo" "${BASE_URL}/../.."; do
|
|
256
|
+
if [ -f "${CANDIDATE}/src/custom-properties.css" ]; then
|
|
257
|
+
MINIMO_PKG_DIR="$CANDIDATE"
|
|
258
|
+
break
|
|
259
|
+
fi
|
|
256
260
|
done
|
|
257
261
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
262
|
+
if [ -z "$MINIMO_PKG_DIR" ]; then
|
|
263
|
+
echo -e "${RED}Sorgenti di minimo non trovati (né in ./node_modules/@massimo-cassandro/minimo né in ${BASE_URL}/../..): css di base e tokens-config non copiati${NC}"
|
|
264
|
+
BLOCKED_FILES+=("css di base + tokens-config.mjs → sorgenti minimo non trovati")
|
|
265
|
+
else
|
|
266
|
+
echo "sorgenti minimo: ${MINIMO_PKG_DIR}"
|
|
267
|
+
|
|
268
|
+
# css di partenza del progetto: solo i file destinati a essere personalizzati.
|
|
269
|
+
# minimo.css NON viene copiato: i moduli css del framework vanno importati dal
|
|
270
|
+
# pacchetto (`@import '@minimo/css/...'`, vedi entry-tpl.css)
|
|
271
|
+
for FILE in custom-properties.css custom-media.css fonts.css; do
|
|
272
|
+
safe_cat "${MINIMO_PKG_DIR}/src/${FILE}" "${FRONTEND_INSTALL_PATH}/src/css/${FILE}"
|
|
273
|
+
done
|
|
274
|
+
|
|
275
|
+
# config di build-tokens: collocato accanto al css generato (custom-properties.css).
|
|
276
|
+
# NB: i percorsi relativi nel file vanno adattati alla sua posizione effettiva
|
|
277
|
+
safe_cat "${MINIMO_PKG_DIR}/design-tokens/tokens-config-sample.mjs" "${FRONTEND_INSTALL_PATH}/src/css/tokens-config.mjs"
|
|
278
|
+
fi
|
|
261
279
|
|
|
262
280
|
# template delle entry css (globale/di pagina e critical): ogni entry deve
|
|
263
281
|
# importare direttamente custom-properties.css (vedi commenti nei file stessi)
|