@newlogic-digital/core 3.1.0 → 4.0.0-next.1
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 +32 -12
- package/package.json +14 -15
- package/types/index.d.ts +7 -7
package/index.js
CHANGED
|
@@ -20,7 +20,7 @@ const defaultOptions = {
|
|
|
20
20
|
mode: null,
|
|
21
21
|
cert: 'localhost',
|
|
22
22
|
format: ['latte'],
|
|
23
|
-
|
|
23
|
+
advancedChunks: {},
|
|
24
24
|
input: {
|
|
25
25
|
assets: [
|
|
26
26
|
'./src/styles/*.{css,pcss,scss,sass,less,styl,stylus}',
|
|
@@ -102,10 +102,14 @@ const plugin = async (options = {}) => {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
if (options.css.transformer === 'lightningcss') {
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
if (!fs.existsSync(resolve(process.cwd(), 'src/+.css'))) {
|
|
106
|
+
fs.writeFileSync(resolve(process.cwd(), 'src/+.css'), '@import "./styles/main.css";')
|
|
107
|
+
}
|
|
107
108
|
|
|
108
|
-
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
// const tailwindcss = (await import('@tailwindcss/vite')).default
|
|
111
|
+
//
|
|
112
|
+
// tailwindcssPlugin.push(tailwindcss(options.tailwindcss))
|
|
109
113
|
}
|
|
110
114
|
|
|
111
115
|
const plugins = [
|
|
@@ -119,7 +123,12 @@ const plugin = async (options = {}) => {
|
|
|
119
123
|
return [{
|
|
120
124
|
name,
|
|
121
125
|
enforce: 'pre',
|
|
126
|
+
/**
|
|
127
|
+
* @param {import('vite').UserConfig} userConfig
|
|
128
|
+
* @param {import('vite').ConfigEnv} userEnv
|
|
129
|
+
*/
|
|
122
130
|
config(userConfig, userEnv) {
|
|
131
|
+
// @ts-ignore
|
|
123
132
|
const isHttps = userConfig?.server?.https !== false
|
|
124
133
|
&& fs.existsSync(join(os.homedir(), `.ssh/${options.cert}.pem`))
|
|
125
134
|
&& fs.existsSync(join(os.homedir(), `.ssh/${options.cert}-key.pem`))
|
|
@@ -181,23 +190,34 @@ const plugin = async (options = {}) => {
|
|
|
181
190
|
...(options?.input?.emails ?? [])
|
|
182
191
|
]
|
|
183
192
|
|
|
184
|
-
userConfig.build.
|
|
193
|
+
userConfig.build.rolldownOptions = Object.assign({
|
|
185
194
|
input: defaultInput,
|
|
186
195
|
output: {
|
|
187
196
|
assetFileNames: 'assets/email/[name].[ext]'
|
|
188
197
|
}
|
|
189
|
-
}, userConfig.build.
|
|
198
|
+
}, userConfig.build.rolldownOptions ?? {})
|
|
190
199
|
} else {
|
|
191
|
-
userConfig.build.
|
|
200
|
+
userConfig.build.rolldownOptions = Object.assign({
|
|
192
201
|
input: defaultInput,
|
|
193
202
|
output: {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
203
|
+
advancedChunks: options.advancedChunks ?? {
|
|
204
|
+
groups: [
|
|
205
|
+
{
|
|
206
|
+
name: 'swup',
|
|
207
|
+
test: /swup/
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: '@hotwired/stimulus',
|
|
211
|
+
test: /@hotwired\/stimulus/
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: 'naja',
|
|
215
|
+
test: /naja/
|
|
216
|
+
}
|
|
217
|
+
]
|
|
198
218
|
}
|
|
199
219
|
}
|
|
200
|
-
}, userConfig.build.
|
|
220
|
+
}, userConfig.build.rolldownOptions ?? {})
|
|
201
221
|
}
|
|
202
222
|
|
|
203
223
|
userConfig.server = Object.assign({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newlogic-digital/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0-next.1",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "New Logic Studio s.r.o.",
|
|
7
7
|
"description": "Set of tools that can be used to create modern web applications",
|
|
@@ -12,30 +12,29 @@
|
|
|
12
12
|
"publish-next": "npm publish --tag next"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@
|
|
16
|
-
"@vituum/vite-plugin-
|
|
17
|
-
"@vituum/vite-plugin-
|
|
18
|
-
"@vituum/vite-plugin-
|
|
19
|
-
"
|
|
20
|
-
"browserslist": "^4.24.4",
|
|
15
|
+
"@vituum/vite-plugin-juice": "^2.0.0-next.1",
|
|
16
|
+
"@vituum/vite-plugin-latte": "^2.0.0-next.2",
|
|
17
|
+
"@vituum/vite-plugin-posthtml": "^2.0.0-next.1",
|
|
18
|
+
"@vituum/vite-plugin-send": "^2.0.0-next.1",
|
|
19
|
+
"browserslist": "^4.28.1",
|
|
21
20
|
"browserslist-to-esbuild": "^2.1.1",
|
|
22
21
|
"fast-glob": "^3.3.3",
|
|
23
|
-
"fs-extra": "^11.3.
|
|
22
|
+
"fs-extra": "^11.3.2",
|
|
24
23
|
"html-minifier-terser": "^7.2.0",
|
|
25
|
-
"lightningcss": "^1.
|
|
24
|
+
"lightningcss": "^1.30.2",
|
|
26
25
|
"lodash": "^4.17.21",
|
|
27
26
|
"picocolors": "^1.1.1",
|
|
28
|
-
"posthtml": "^0.16.
|
|
27
|
+
"posthtml": "^0.16.7",
|
|
29
28
|
"posthtml-prism": "^2.0.1",
|
|
30
29
|
"prismjs": "^1.30.0",
|
|
31
|
-
"vituum": "^
|
|
30
|
+
"vituum": "^2.0.0-next.3"
|
|
32
31
|
},
|
|
33
32
|
"devDependencies": {
|
|
34
|
-
"@types/node": "^
|
|
35
|
-
"eslint": "^9.
|
|
36
|
-
"
|
|
33
|
+
"@types/node": "^25.0.3",
|
|
34
|
+
"eslint": "^9.39.2",
|
|
35
|
+
"rolldown": "^1.0.0-beta.55",
|
|
37
36
|
"typescript": "^5",
|
|
38
|
-
"vite": "^
|
|
37
|
+
"vite": "^8.0.0-beta.3",
|
|
39
38
|
"@vituum/vite-plugin-tailwindcss": "^1.2.0",
|
|
40
39
|
"@vituum/vite-plugin-twig": "^1.1.0"
|
|
41
40
|
},
|
package/types/index.d.ts
CHANGED
|
@@ -9,13 +9,13 @@ export interface PluginUserConfig {
|
|
|
9
9
|
format?: string[]
|
|
10
10
|
input?: Input
|
|
11
11
|
cert?: string
|
|
12
|
-
|
|
12
|
+
advancedChunks?: import('rolldown').OutputOptions['advancedChunks']
|
|
13
13
|
vituum?: import('vituum').UserConfig,
|
|
14
14
|
css?: import('vite').CSSOptions
|
|
15
|
-
posthtml?: import('@vituum/vite-plugin-posthtml
|
|
16
|
-
juice?: import('@vituum/vite-plugin-juice
|
|
17
|
-
send?: import('@vituum/vite-plugin-send
|
|
18
|
-
tailwindcss?: import('@vituum/vite-plugin-tailwindcss
|
|
19
|
-
latte?: import('@vituum/vite-plugin-latte
|
|
20
|
-
twig?: import('@vituum/vite-plugin-twig
|
|
15
|
+
posthtml?: import('@vituum/vite-plugin-posthtml').PluginUserConfig
|
|
16
|
+
juice?: import('@vituum/vite-plugin-juice').PluginUserConfig
|
|
17
|
+
send?: import('@vituum/vite-plugin-send').PluginUserConfig
|
|
18
|
+
tailwindcss?: import('@vituum/vite-plugin-tailwindcss').PluginUserConfig
|
|
19
|
+
latte?: import('@vituum/vite-plugin-latte').PluginUserConfig
|
|
20
|
+
twig?: import('@vituum/vite-plugin-twig').PluginUserConfig
|
|
21
21
|
}
|