@ng-native/tailwind 0.12.0 → 0.14.0
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/config.cjs +20 -0
- package/package.json +3 -3
package/config.cjs
CHANGED
|
@@ -29,6 +29,7 @@ const {
|
|
|
29
29
|
} = require('node:fs');
|
|
30
30
|
const path = require('node:path');
|
|
31
31
|
const { compileCss } = require('@ng-native/metro/css/compile.cjs');
|
|
32
|
+
const { nameFaces } = require('@ng-native/metro/css/font-names.cjs');
|
|
32
33
|
const { flattenTailwind } = require('./flatten.cjs');
|
|
33
34
|
|
|
34
35
|
/** Where the generated module goes if the app does not say. */
|
|
@@ -176,6 +177,8 @@ function compileSheetModule(css, context = 'tailwind', paths) {
|
|
|
176
177
|
// and native cannot express, which is worth saying while it is still being written.
|
|
177
178
|
if (!message.includes("dropped '--")) console.warn(`[angular-native] ${message}`);
|
|
178
179
|
}
|
|
180
|
+
// Before the sources are re-pointed at the module: a face's file is named from the entry.
|
|
181
|
+
if (paths) nameEntryFaces(sheet, paths.input);
|
|
179
182
|
for (const face of sheet.fonts ?? []) {
|
|
180
183
|
if (paths && /^\.\.?\//.test(face.source.asset)) {
|
|
181
184
|
const file = path.resolve(path.dirname(paths.input), face.source.asset);
|
|
@@ -194,6 +197,23 @@ function compileSheetModule(css, context = 'tailwind', paths) {
|
|
|
194
197
|
return `// Generated from ${path.basename(context)}. Edit the Tailwind entry, not this.\n${imports.join('')}export default ${literal};\n`;
|
|
195
198
|
}
|
|
196
199
|
|
|
200
|
+
/** Faces already reported unreadable, once a process: the sheet is rebuilt on every class written. */
|
|
201
|
+
const warnedFaces = new Set();
|
|
202
|
+
|
|
203
|
+
/** Gives each face the entry declares the PostScript name its file says: see `font-names.cjs`. */
|
|
204
|
+
function nameEntryFaces(sheet, input) {
|
|
205
|
+
nameFaces(
|
|
206
|
+
sheet,
|
|
207
|
+
path.dirname(input),
|
|
208
|
+
() => {},
|
|
209
|
+
(message) => {
|
|
210
|
+
if (warnedFaces.has(message)) return;
|
|
211
|
+
warnedFaces.add(message);
|
|
212
|
+
console.warn(`[angular-native] ${message}`);
|
|
213
|
+
},
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
|
|
197
217
|
/**
|
|
198
218
|
* The entry's own `@import`s that live in this repository, resolved past any symlink.
|
|
199
219
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-native/tailwind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Tailwind CSS preset for Angular Native: Tailwind 4 and Tailwind 3, on native and on the web.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"type": "commonjs",
|
|
18
18
|
"main": "flatten.cjs",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ng-native/metro": "0.
|
|
20
|
+
"@ng-native/metro": "0.14.0",
|
|
21
21
|
"lightningcss": "^1.30.2"
|
|
22
22
|
},
|
|
23
23
|
"nx": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"url": "https://github.com/ng-native/ng-native/issues"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@ng-native/metro": "0.
|
|
35
|
+
"@ng-native/metro": "0.14.0",
|
|
36
36
|
"@tailwindcss/cli": "^4.3.3",
|
|
37
37
|
"tailwindcss": "^3.4.1 || ^4.3.3"
|
|
38
38
|
},
|