@newlogic-digital/core 4.1.2 → 4.1.4
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/index.js +51 -5
- package/package.json +6 -6
- package/src/+.css +1 -0
package/index.js
CHANGED
|
@@ -11,9 +11,31 @@ import process from 'node:process'
|
|
|
11
11
|
import heroicons from '@newlogic-digital/vite-plugin-heroicons'
|
|
12
12
|
import { fileURLToPath } from 'node:url'
|
|
13
13
|
import { processPostcssCustomProperties } from './src/postcssCustomProperties.js'
|
|
14
|
+
import { createLogger } from 'vite'
|
|
15
|
+
import console from 'node:console'
|
|
14
16
|
|
|
15
17
|
const { name } = getPackageInfo(import.meta.url)
|
|
16
18
|
|
|
19
|
+
const logger = createLogger()
|
|
20
|
+
const consoleWarn = console.warn.bind(console)
|
|
21
|
+
const ignoredPseudoClasses = [
|
|
22
|
+
'interest-source',
|
|
23
|
+
'interest-target',
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
const isUnknownPseudoClassWarning = (/** @type {string | string[]} */ message) => (
|
|
27
|
+
message.includes('is not recognized as a valid pseudo-class')
|
|
28
|
+
&& ignoredPseudoClasses.some(pseudoClass => message.includes(pseudoClass))
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
console.warn = (...messages) => {
|
|
32
|
+
if (messages.some(message => isUnknownPseudoClassWarning(String(message)))) {
|
|
33
|
+
return
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
consoleWarn(...messages)
|
|
37
|
+
}
|
|
38
|
+
|
|
17
39
|
/**
|
|
18
40
|
* @type {import('@newlogic-digital/core/types').PluginUserConfig}
|
|
19
41
|
*/
|
|
@@ -21,7 +43,7 @@ const defaultOptions = {
|
|
|
21
43
|
mode: null,
|
|
22
44
|
cert: 'localhost',
|
|
23
45
|
format: ['latte'],
|
|
24
|
-
codeSplitting:
|
|
46
|
+
codeSplitting: undefined,
|
|
25
47
|
input: {
|
|
26
48
|
assets: [
|
|
27
49
|
'./src/styles/*.{css,pcss,scss,sass,less,styl,stylus}',
|
|
@@ -151,6 +173,27 @@ const plugin = async (options = {}) => {
|
|
|
151
173
|
* @param {import('vite').ConfigEnv} userEnv
|
|
152
174
|
*/
|
|
153
175
|
config(userConfig, userEnv) {
|
|
176
|
+
userConfig.customLogger = Object.assign({
|
|
177
|
+
...logger,
|
|
178
|
+
/**
|
|
179
|
+
* @param {string} message
|
|
180
|
+
* @param {import("vite").LogOptions} options
|
|
181
|
+
*/
|
|
182
|
+
warn(message, options) {
|
|
183
|
+
if (
|
|
184
|
+
isUnknownPseudoClassWarning(message)
|
|
185
|
+
&& (
|
|
186
|
+
message.includes('[lightningcss minify]')
|
|
187
|
+
|| message.includes('[vite:css][lightningcss]')
|
|
188
|
+
)
|
|
189
|
+
) {
|
|
190
|
+
return
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
logger.warn(message, options)
|
|
194
|
+
},
|
|
195
|
+
}, userConfig.customLogger)
|
|
196
|
+
|
|
154
197
|
// @ts-ignore
|
|
155
198
|
const isHttps = userConfig?.server?.https !== false
|
|
156
199
|
&& fs.existsSync(join(os.homedir(), `.ssh/${options.cert}.pem`))
|
|
@@ -228,15 +271,18 @@ const plugin = async (options = {}) => {
|
|
|
228
271
|
groups: [
|
|
229
272
|
{
|
|
230
273
|
name: 'swup',
|
|
231
|
-
test: /swup/,
|
|
274
|
+
test: /node_modules[\\/]swup(?:[\\/]|$)/,
|
|
275
|
+
priority: 30,
|
|
232
276
|
},
|
|
233
277
|
{
|
|
234
|
-
name: '
|
|
235
|
-
test:
|
|
278
|
+
name: 'hotwired-stimulus',
|
|
279
|
+
test: /node_modules[\\/]@hotwired[\\/]stimulus(?:[\\/]|$)/,
|
|
280
|
+
priority: 30,
|
|
236
281
|
},
|
|
237
282
|
{
|
|
238
283
|
name: 'naja',
|
|
239
|
-
test: /naja/,
|
|
284
|
+
test: /node_modules[\\/]naja(?:[\\/]|$)/,
|
|
285
|
+
priority: 30,
|
|
240
286
|
},
|
|
241
287
|
],
|
|
242
288
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newlogic-digital/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.4",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"newlogic-core": "./bin/newlogic-core.js"
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"browserslist": "^4.28.2",
|
|
28
28
|
"browserslist-to-esbuild": "^2.1.1",
|
|
29
29
|
"lightningcss": "^1.32.0",
|
|
30
|
-
"npm-check-updates": "^
|
|
31
|
-
"oxlint": "^1.
|
|
30
|
+
"npm-check-updates": "^22.2.0",
|
|
31
|
+
"oxlint": "^1.66.0",
|
|
32
32
|
"postcss-custom-properties": "^15.0.1",
|
|
33
33
|
"stylelint-config-standard": "^40.0.0",
|
|
34
34
|
"vituum": "^2.0.2"
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@tailwindcss/vite": "^4.
|
|
51
|
-
"@types/node": "^25.
|
|
50
|
+
"@tailwindcss/vite": "^4.3.0",
|
|
51
|
+
"@types/node": "^25.9",
|
|
52
52
|
"@vituum/vite-plugin-twig": "^2.0.1",
|
|
53
|
-
"rolldown": "^1.0.
|
|
53
|
+
"rolldown": "^1.0.2",
|
|
54
54
|
"typescript": "^6"
|
|
55
55
|
},
|
|
56
56
|
"files": [
|
package/src/+.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./styles/main.css";
|