@vef-framework/dev 1.0.122 → 1.0.124
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/bin/vef.js +1 -1
- package/cjs/cli.cjs +228 -0
- package/cjs/commitlint-config.cjs +14 -0
- package/cjs/config.cjs +82 -0
- package/cjs/constants.cjs +27 -0
- package/cjs/eslint-config.cjs +413 -0
- package/cjs/index.cjs +16 -0
- package/cjs/json/monaco.nls.json.cjs +7 -0
- package/cjs/json/monaco.theme.github-light.json.cjs +7 -0
- package/cjs/modules.d.cjs +4 -0
- package/cjs/plugin-app-config.cjs +37 -0
- package/cjs/plugin-conventional-config.cjs +116 -0
- package/cjs/plugin-eslint.cjs +23 -0
- package/cjs/plugin-html.cjs +85 -0
- package/cjs/plugin-icons.cjs +21 -0
- package/{lib → cjs}/plugin-initialization.cjs +26 -2
- package/cjs/plugin-injection.cjs +20 -0
- package/cjs/plugin-inspect.cjs +14 -0
- package/{lib → cjs}/plugin-monaco-nls.cjs +59 -2
- package/cjs/plugin-react-swc.cjs +13 -0
- package/cjs/plugin-router.cjs +47 -0
- package/cjs/plugin-stylelint.cjs +23 -0
- package/cjs/plugin-svgr.cjs +58 -0
- package/cjs/plugin-tailwind.cjs +11 -0
- package/cjs/plugin-tailwindcss.cjs +24 -0
- package/cjs/plugin-tsconfig-paths.cjs +13 -0
- package/cjs/plugin-visualizer.cjs +15 -0
- package/cjs/plugin-webfont.cjs +14 -0
- package/cjs/stylelint-config.cjs +67 -0
- package/cjs/tailwind-config.cjs +395 -0
- package/cjs/types.cjs +4 -0
- package/esm/cli.js +226 -0
- package/esm/commitlint-config.js +12 -0
- package/esm/config.js +80 -0
- package/esm/constants.js +15 -0
- package/esm/eslint-config.js +411 -0
- package/esm/index.js +8 -0
- package/esm/json/monaco.nls.json.js +3 -0
- package/esm/json/monaco.theme.github-light.json.js +3 -0
- package/esm/modules.d.js +2 -0
- package/esm/plugin-app-config.js +35 -0
- package/esm/plugin-conventional-config.js +114 -0
- package/esm/plugin-eslint.js +21 -0
- package/esm/plugin-html.js +83 -0
- package/esm/plugin-icons.js +18 -0
- package/{es → esm}/plugin-initialization.js +24 -2
- package/esm/plugin-injection.js +18 -0
- package/esm/plugin-inspect.js +12 -0
- package/{es → esm}/plugin-monaco-nls.js +56 -2
- package/esm/plugin-react-swc.js +11 -0
- package/esm/plugin-router.js +45 -0
- package/esm/plugin-stylelint.js +21 -0
- package/esm/plugin-svgr.js +56 -0
- package/esm/plugin-tailwind.js +9 -0
- package/esm/plugin-tailwindcss.js +22 -0
- package/esm/plugin-tsconfig-paths.js +11 -0
- package/esm/plugin-visualizer.js +13 -0
- package/esm/plugin-webfont.js +12 -0
- package/esm/stylelint-config.js +65 -0
- package/esm/tailwind-config.js +393 -0
- package/esm/types.js +2 -0
- package/package.json +19 -18
- package/template/_package.json +5 -5
- package/es/cli.js +0 -4
- package/es/commitlint-config.js +0 -1
- package/es/config.js +0 -1
- package/es/constants.js +0 -1
- package/es/eslint-config.js +0 -1
- package/es/index.js +0 -1
- package/es/json/monaco.nls.json.js +0 -15920
- package/es/json/monaco.theme.github-light.json.js +0 -349
- package/es/modules.d.js +0 -1
- package/es/plugin-app-config.js +0 -1
- package/es/plugin-conventional-config.js +0 -11
- package/es/plugin-eslint.js +0 -1
- package/es/plugin-html.js +0 -16
- package/es/plugin-icons.js +0 -1
- package/es/plugin-injection.js +0 -2
- package/es/plugin-inspect.js +0 -1
- package/es/plugin-react-swc.js +0 -1
- package/es/plugin-router.js +0 -10
- package/es/plugin-stylelint.js +0 -1
- package/es/plugin-svgr.js +0 -1
- package/es/plugin-tailwind.js +0 -1
- package/es/plugin-tailwindcss.js +0 -2
- package/es/plugin-tsconfig-paths.js +0 -1
- package/es/plugin-visualizer.js +0 -1
- package/es/plugin-webfont.js +0 -1
- package/es/stylelint-config.js +0 -1
- package/es/tailwind-config.js +0 -1
- package/lib/cli.cjs +0 -4
- package/lib/commitlint-config.cjs +0 -1
- package/lib/config.cjs +0 -1
- package/lib/constants.cjs +0 -1
- package/lib/eslint-config.cjs +0 -1
- package/lib/index.cjs +0 -1
- package/lib/json/monaco.nls.json.cjs +0 -15920
- package/lib/json/monaco.theme.github-light.json.cjs +0 -349
- package/lib/modules.d.cjs +0 -1
- package/lib/plugin-app-config.cjs +0 -1
- package/lib/plugin-conventional-config.cjs +0 -11
- package/lib/plugin-eslint.cjs +0 -1
- package/lib/plugin-html.cjs +0 -16
- package/lib/plugin-icons.cjs +0 -1
- package/lib/plugin-injection.cjs +0 -2
- package/lib/plugin-inspect.cjs +0 -1
- package/lib/plugin-react-swc.cjs +0 -1
- package/lib/plugin-router.cjs +0 -10
- package/lib/plugin-stylelint.cjs +0 -1
- package/lib/plugin-svgr.cjs +0 -1
- package/lib/plugin-tailwind.cjs +0 -1
- package/lib/plugin-tailwindcss.cjs +0 -2
- package/lib/plugin-tsconfig-paths.cjs +0 -1
- package/lib/plugin-visualizer.cjs +0 -1
- package/lib/plugin-webfont.cjs +0 -1
- package/lib/stylelint-config.cjs +0 -1
- package/lib/tailwind-config.cjs +0 -1
- package/lib/types.cjs +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var monaco_theme_github_light_default = '{\n "base": "vs",\n "inherit": true,\n "rules": [\n {\n "background": "ffffff",\n "token": ""\n },\n {\n "foreground": "6a737d",\n "token": "comment"\n },\n {\n "foreground": "6a737d",\n "token": "punctuation.definition.comment"\n },\n {\n "foreground": "6a737d",\n "token": "string.comment"\n },\n {\n "foreground": "005cc5",\n "token": "constant"\n },\n {\n "foreground": "005cc5",\n "token": "entity.name.constant"\n },\n {\n "foreground": "005cc5",\n "token": "variable.other.constant"\n },\n {\n "foreground": "005cc5",\n "token": "variable.language"\n },\n {\n "foreground": "6f42c1",\n "token": "entity"\n },\n {\n "foreground": "6f42c1",\n "token": "entity.name"\n },\n {\n "foreground": "24292e",\n "token": "variable.parameter.function"\n },\n {\n "foreground": "22863a",\n "token": "entity.name.tag"\n },\n {\n "foreground": "d73a49",\n "token": "keyword"\n },\n {\n "foreground": "d73a49",\n "token": "storage"\n },\n {\n "foreground": "d73a49",\n "token": "storage.type"\n },\n {\n "foreground": "24292e",\n "token": "storage.modifier.package"\n },\n {\n "foreground": "24292e",\n "token": "storage.modifier.import"\n },\n {\n "foreground": "24292e",\n "token": "storage.type.java"\n },\n {\n "foreground": "032f62",\n "token": "string"\n },\n {\n "foreground": "032f62",\n "token": "punctuation.definition.string"\n },\n {\n "foreground": "032f62",\n "token": "string punctuation.section.embedded source"\n },\n {\n "foreground": "005cc5",\n "token": "support"\n },\n {\n "foreground": "005cc5",\n "token": "meta.property-name"\n },\n {\n "foreground": "e36209",\n "token": "variable"\n },\n {\n "foreground": "24292e",\n "token": "variable.other"\n },\n {\n "foreground": "b31d28",\n "fontStyle": "bold italic underline",\n "token": "invalid.broken"\n },\n {\n "foreground": "b31d28",\n "fontStyle": "bold italic underline",\n "token": "invalid.deprecated"\n },\n {\n "foreground": "fafbfc",\n "background": "b31d28",\n "fontStyle": "italic underline",\n "token": "invalid.illegal"\n },\n {\n "foreground": "fafbfc",\n "background": "d73a49",\n "fontStyle": "italic underline",\n "token": "carriage-return"\n },\n {\n "foreground": "b31d28",\n "fontStyle": "bold italic underline",\n "token": "invalid.unimplemented"\n },\n {\n "foreground": "b31d28",\n "token": "message.error"\n },\n {\n "foreground": "24292e",\n "token": "string source"\n },\n {\n "foreground": "005cc5",\n "token": "string variable"\n },\n {\n "foreground": "032f62",\n "token": "source.regexp"\n },\n {\n "foreground": "032f62",\n "token": "string.regexp"\n },\n {\n "foreground": "032f62",\n "token": "string.regexp.character-class"\n },\n {\n "foreground": "032f62",\n "token": "string.regexp constant.character.escape"\n },\n {\n "foreground": "032f62",\n "token": "string.regexp source.ruby.embedded"\n },\n {\n "foreground": "032f62",\n "token": "string.regexp string.regexp.arbitrary-repitition"\n },\n {\n "foreground": "22863a",\n "fontStyle": "bold",\n "token": "string.regexp constant.character.escape"\n },\n {\n "foreground": "005cc5",\n "token": "support.constant"\n },\n {\n "foreground": "005cc5",\n "token": "support.variable"\n },\n {\n "foreground": "005cc5",\n "token": "meta.module-reference"\n },\n {\n "foreground": "735c0f",\n "token": "markup.list"\n },\n {\n "foreground": "005cc5",\n "fontStyle": "bold",\n "token": "markup.heading"\n },\n {\n "foreground": "005cc5",\n "fontStyle": "bold",\n "token": "markup.heading entity.name"\n },\n {\n "foreground": "22863a",\n "token": "markup.quote"\n },\n {\n "foreground": "24292e",\n "fontStyle": "italic",\n "token": "markup.italic"\n },\n {\n "foreground": "24292e",\n "fontStyle": "bold",\n "token": "markup.bold"\n },\n {\n "foreground": "005cc5",\n "token": "markup.raw"\n },\n {\n "foreground": "b31d28",\n "background": "ffeef0",\n "token": "markup.deleted"\n },\n {\n "foreground": "b31d28",\n "background": "ffeef0",\n "token": "meta.diff.header.from-file"\n },\n {\n "foreground": "b31d28",\n "background": "ffeef0",\n "token": "punctuation.definition.deleted"\n },\n {\n "foreground": "22863a",\n "background": "f0fff4",\n "token": "markup.inserted"\n },\n {\n "foreground": "22863a",\n "background": "f0fff4",\n "token": "meta.diff.header.to-file"\n },\n {\n "foreground": "22863a",\n "background": "f0fff4",\n "token": "punctuation.definition.inserted"\n },\n {\n "foreground": "e36209",\n "background": "ffebda",\n "token": "markup.changed"\n },\n {\n "foreground": "e36209",\n "background": "ffebda",\n "token": "punctuation.definition.changed"\n },\n {\n "foreground": "f6f8fa",\n "background": "005cc5",\n "token": "markup.ignored"\n },\n {\n "foreground": "f6f8fa",\n "background": "005cc5",\n "token": "markup.untracked"\n },\n {\n "foreground": "6f42c1",\n "fontStyle": "bold",\n "token": "meta.diff.range"\n },\n {\n "foreground": "005cc5",\n "token": "meta.diff.header"\n },\n {\n "foreground": "005cc5",\n "fontStyle": "bold",\n "token": "meta.separator"\n },\n {\n "foreground": "005cc5",\n "token": "meta.output"\n },\n {\n "foreground": "586069",\n "token": "brackethighlighter.tag"\n },\n {\n "foreground": "586069",\n "token": "brackethighlighter.curly"\n },\n {\n "foreground": "586069",\n "token": "brackethighlighter.round"\n },\n {\n "foreground": "586069",\n "token": "brackethighlighter.square"\n },\n {\n "foreground": "586069",\n "token": "brackethighlighter.angle"\n },\n {\n "foreground": "586069",\n "token": "brackethighlighter.quote"\n },\n {\n "foreground": "b31d28",\n "token": "brackethighlighter.unmatched"\n },\n {\n "foreground": "b31d28",\n "token": "sublimelinter.mark.error"\n },\n {\n "foreground": "e36209",\n "token": "sublimelinter.mark.warning"\n },\n {\n "foreground": "959da5",\n "token": "sublimelinter.gutter-mark"\n },\n {\n "foreground": "032f62",\n "fontStyle": "underline",\n "token": "constant.other.reference.link"\n },\n {\n "foreground": "032f62",\n "fontStyle": "underline",\n "token": "string.other.link"\n }\n ],\n "colors": {\n "editor.foreground": "#24292e",\n "editor.background": "#fafafa",\n "editor.selectionBackground": "#c8c8fa",\n "editor.inactiveSelectionBackground": "#fafbfc",\n "editor.lineHighlightBackground": "#fafbfc",\n "editorCursor.foreground": "#24292e",\n "editorWhitespace.foreground": "#959da5",\n "editorIndentGuide.background": "#959da5",\n "editorIndentGuide.activeBackground": "#24292e",\n "editor.selectionHighlightBorder": "#fafbfc"\n }\n}\n';
|
|
6
|
+
|
|
7
|
+
exports.default = monaco_theme_github_light_default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var radashi = require('radashi');
|
|
5
|
+
var config = require('unplugin-config/vite');
|
|
6
|
+
var constants = require('./constants.cjs');
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
function constantCase(value) {
|
|
10
|
+
return radashi.snake(value).toUpperCase();
|
|
11
|
+
}
|
|
12
|
+
function createAppConfigPlugin({
|
|
13
|
+
basePublicPath,
|
|
14
|
+
outputDir,
|
|
15
|
+
appName = constants.DEFAULT_APP_NAME
|
|
16
|
+
}) {
|
|
17
|
+
return config({
|
|
18
|
+
appName: `VEF_${constantCase(appName)}`,
|
|
19
|
+
baseDir: basePublicPath,
|
|
20
|
+
configFile: {
|
|
21
|
+
generate: true,
|
|
22
|
+
fileName: "app.config.js",
|
|
23
|
+
outputDir: outputDir ?? constants.DEFAULT_OUTPUT_DIR
|
|
24
|
+
},
|
|
25
|
+
htmlInjection: {
|
|
26
|
+
enable: true,
|
|
27
|
+
position: "head-prepend",
|
|
28
|
+
templates: ["index.html"]
|
|
29
|
+
},
|
|
30
|
+
envVariables: {
|
|
31
|
+
prefix: constants.ENV_APP_PREFIX,
|
|
32
|
+
files: ["env/.env", "env/.env.production"]
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
exports.createAppConfigPlugin = createAppConfigPlugin;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var process = require('node:process');
|
|
5
|
+
var constants = require('./constants.cjs');
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
function createConventionalConfigPlugin({
|
|
9
|
+
appName,
|
|
10
|
+
appVersion,
|
|
11
|
+
basePublicPath,
|
|
12
|
+
projectDir,
|
|
13
|
+
outputDir,
|
|
14
|
+
serverPort,
|
|
15
|
+
proxies
|
|
16
|
+
}) {
|
|
17
|
+
return {
|
|
18
|
+
name: "vef-framework:conventional-config",
|
|
19
|
+
config(_, { command }) {
|
|
20
|
+
const isDev = command === "serve";
|
|
21
|
+
return {
|
|
22
|
+
appType: "spa",
|
|
23
|
+
root: projectDir,
|
|
24
|
+
base: basePublicPath,
|
|
25
|
+
publicDir: "public",
|
|
26
|
+
envDir: constants.ENV_DIR,
|
|
27
|
+
envPrefix: [constants.ENV_BUILD_PREFIX, constants.ENV_APP_PREFIX],
|
|
28
|
+
define: {
|
|
29
|
+
__VEF_FRAMEWORK_VERSION__: `"${process.env.VEF_FRAMEWORK_VERSION}"`,
|
|
30
|
+
__VEF_APP_VERSION__: `"${appVersion}"`,
|
|
31
|
+
__VEF_APP_CONFIG__: isDev ? `
|
|
32
|
+
(function () {
|
|
33
|
+
const env = import.meta.env;
|
|
34
|
+
const config = Object.keys(env).filter(key => key.startsWith(${JSON.stringify(constants.ENV_APP_PREFIX)}))
|
|
35
|
+
.reduce((acc, key) => {
|
|
36
|
+
acc[key] = env[key];
|
|
37
|
+
return acc;
|
|
38
|
+
}, {});
|
|
39
|
+
return Object.freeze(config);
|
|
40
|
+
})()
|
|
41
|
+
` : `window.__PRODUCTION__VEF_${appName ?? constants.DEFAULT_APP_NAME}__CONF__`
|
|
42
|
+
},
|
|
43
|
+
css: {
|
|
44
|
+
modules: {
|
|
45
|
+
scopeBehaviour: "local",
|
|
46
|
+
localsConvention: "camelCase"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
optimizeDeps: {
|
|
50
|
+
exclude: [],
|
|
51
|
+
esbuildOptions: {
|
|
52
|
+
plugins: []
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
esbuild: {
|
|
56
|
+
drop: ["console", "debugger"],
|
|
57
|
+
charset: "utf8",
|
|
58
|
+
minifyIdentifiers: false,
|
|
59
|
+
minifySyntax: true,
|
|
60
|
+
minifyWhitespace: true
|
|
61
|
+
},
|
|
62
|
+
build: {
|
|
63
|
+
outDir: outputDir ?? constants.DEFAULT_OUTPUT_DIR,
|
|
64
|
+
target: "modules",
|
|
65
|
+
assetsDir: constants.ASSETS_DIR,
|
|
66
|
+
assetsInlineLimit: 10240,
|
|
67
|
+
reportCompressedSize: false,
|
|
68
|
+
chunkSizeWarningLimit: 2048,
|
|
69
|
+
minify: true,
|
|
70
|
+
sourcemap: false,
|
|
71
|
+
rollupOptions: {
|
|
72
|
+
input: {
|
|
73
|
+
main: "index.html"
|
|
74
|
+
},
|
|
75
|
+
output: {
|
|
76
|
+
banner: `/*! Powered by VEF Framework v${process.env.VEF_FRAMEWORK_VERSION}.${appVersion ? ` App version v${appVersion}.` : ""} Built at ${(/* @__PURE__ */ new Date()).toISOString()} */`,
|
|
77
|
+
chunkFileNames: `${constants.ASSETS_DIR}/js/[name]-[hash].js`,
|
|
78
|
+
entryFileNames: `${constants.ASSETS_DIR}/js/[name]-[hash].js`,
|
|
79
|
+
assetFileNames: `${constants.ASSETS_DIR}/[ext]/[name]-[hash].[ext]`,
|
|
80
|
+
manualChunks: {
|
|
81
|
+
"react": ["react", "react-dom"],
|
|
82
|
+
"vef-shared": ["@vef-framework/shared"],
|
|
83
|
+
"vef-components": ["@vef-framework/components"],
|
|
84
|
+
"vef-hooks": ["@vef-framework/hooks"],
|
|
85
|
+
"vef-core": ["@vef-framework/core"],
|
|
86
|
+
"vef-starter": ["@vef-framework/starter"],
|
|
87
|
+
"vef-intellisense-code-editor": ["monaco-editor", "@monaco-editor/react"],
|
|
88
|
+
"vef-code-editor": [
|
|
89
|
+
"@uiw/react-codemirror",
|
|
90
|
+
"@uiw/codemirror-extensions-langs",
|
|
91
|
+
"@uiw/codemirror-theme-material",
|
|
92
|
+
"codemirror-json-schema",
|
|
93
|
+
"codemirror-json5",
|
|
94
|
+
"@codemirror/state",
|
|
95
|
+
"@codemirror/view",
|
|
96
|
+
"@codemirror/lint",
|
|
97
|
+
"@codemirror/language",
|
|
98
|
+
"@codemirror/lang-yaml",
|
|
99
|
+
"@codemirror/lang-json"
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
server: {
|
|
106
|
+
port: serverPort || constants.DEFAULT_SERVER_PORT,
|
|
107
|
+
host: true,
|
|
108
|
+
open: true,
|
|
109
|
+
proxy: proxies
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
exports.createConventionalConfigPlugin = createConventionalConfigPlugin;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var eslint = require('vite-plugin-eslint2');
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
function createEslintPlugin() {
|
|
8
|
+
return eslint({
|
|
9
|
+
fix: true,
|
|
10
|
+
test: false,
|
|
11
|
+
dev: true,
|
|
12
|
+
build: false,
|
|
13
|
+
cache: true,
|
|
14
|
+
cacheLocation: "node_modules/.cache/.eslintcache",
|
|
15
|
+
include: ["*.{js,ts,json,jsonc,yaml,toml,md}", "src/**/*.{ts,tsx,json,jsonc,yaml,toml,md}"],
|
|
16
|
+
exclude: ["node_modules", "virtual:", "vef:"],
|
|
17
|
+
emitError: true,
|
|
18
|
+
emitWarning: true,
|
|
19
|
+
emitWarningAsError: true
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.createEslintPlugin = createEslintPlugin;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var htmlMinifierTerser = require('html-minifier-terser');
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
const virtualModuleId = "index.html";
|
|
8
|
+
const htmlContent = `
|
|
9
|
+
<!doctype html>
|
|
10
|
+
<html lang="en">
|
|
11
|
+
<head>
|
|
12
|
+
<meta charset="UTF-8" />
|
|
13
|
+
<link rel="icon" type="image/svg+xml" href="%VEF_APP_FAVICON%" />
|
|
14
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
15
|
+
<meta name="description" content="Powered by VEF Framework" />
|
|
16
|
+
<title>%VEF_APP_TITLE%</title>
|
|
17
|
+
</head>
|
|
18
|
+
<body>
|
|
19
|
+
<div id="root"></div>
|
|
20
|
+
<script type="module" src="src/main.ts"><\/script>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
23
|
+
`;
|
|
24
|
+
function createHtmlPlugin() {
|
|
25
|
+
return [
|
|
26
|
+
{
|
|
27
|
+
name: "vef-framework:html",
|
|
28
|
+
resolveId(source) {
|
|
29
|
+
if (source === virtualModuleId) {
|
|
30
|
+
return virtualModuleId;
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
load(id) {
|
|
34
|
+
if (id === virtualModuleId) {
|
|
35
|
+
return htmlContent;
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
transformIndexHtml: {
|
|
39
|
+
order: "pre",
|
|
40
|
+
handler: () => htmlContent
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "vite-plugin-vef-framework-html-minify",
|
|
45
|
+
enforce: "post",
|
|
46
|
+
async generateBundle(_, bundles) {
|
|
47
|
+
for (const bundle of Object.values(bundles)) {
|
|
48
|
+
if (bundle.type === "asset" && typeof bundle.source === "string" && bundle.fileName === virtualModuleId) {
|
|
49
|
+
bundle.source = await htmlMinifierTerser.minify(
|
|
50
|
+
bundle.source,
|
|
51
|
+
{
|
|
52
|
+
collapseBooleanAttributes: true,
|
|
53
|
+
collapseInlineTagWhitespace: true,
|
|
54
|
+
collapseWhitespace: true,
|
|
55
|
+
conservativeCollapse: false,
|
|
56
|
+
keepClosingSlash: true,
|
|
57
|
+
minifyCSS: true,
|
|
58
|
+
minifyJS: true,
|
|
59
|
+
minifyURLs: true,
|
|
60
|
+
noNewlinesBeforeTagClose: true,
|
|
61
|
+
quoteCharacter: `"`,
|
|
62
|
+
removeAttributeQuotes: false,
|
|
63
|
+
removeComments: true,
|
|
64
|
+
removeEmptyAttributes: true,
|
|
65
|
+
removeOptionalTags: false,
|
|
66
|
+
removeRedundantAttributes: true,
|
|
67
|
+
removeScriptTypeAttributes: false,
|
|
68
|
+
removeTagWhitespace: false,
|
|
69
|
+
removeEmptyElements: false,
|
|
70
|
+
removeStyleLinkTypeAttributes: false,
|
|
71
|
+
sortAttributes: true,
|
|
72
|
+
sortClassName: true,
|
|
73
|
+
trimCustomFragments: true,
|
|
74
|
+
useShortDoctype: true,
|
|
75
|
+
html5: true
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
exports.createHtmlPlugin = createHtmlPlugin;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var node_path = require('node:path');
|
|
5
|
+
var node_url = require('node:url');
|
|
6
|
+
var icons = require('unplugin-icons/vite');
|
|
7
|
+
|
|
8
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
9
|
+
"use strict";
|
|
10
|
+
function createIconsPlugin(projectDir) {
|
|
11
|
+
return icons({
|
|
12
|
+
autoInstall: false,
|
|
13
|
+
compiler: "jsx",
|
|
14
|
+
jsx: "react",
|
|
15
|
+
defaultClass: "inline-block",
|
|
16
|
+
scale: 1.2,
|
|
17
|
+
collectionsNodeResolvePath: [projectDir, node_path.resolve(node_path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('plugin-icons.cjs', document.baseURI).href)))), "..")]
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
exports.createIconsPlugin = createIconsPlugin;
|
|
@@ -1,4 +1,22 @@
|
|
|
1
|
-
"use strict"
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var monaco_theme_githubLight = require('./json/monaco.theme.github-light.json.cjs');
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
const virtualModuleId = "vef:initialization";
|
|
8
|
+
const resolvedVirtualModuleId = `\0${virtualModuleId}`;
|
|
9
|
+
function createInitializationPlugin() {
|
|
10
|
+
return {
|
|
11
|
+
name: "vef-framework:initialization",
|
|
12
|
+
resolveId(id) {
|
|
13
|
+
if (id === virtualModuleId) {
|
|
14
|
+
return resolvedVirtualModuleId;
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
load(id) {
|
|
18
|
+
if (id === resolvedVirtualModuleId) {
|
|
19
|
+
return `import { loader } from "@monaco-editor/react";
|
|
2
20
|
import * as monaco from "monaco-editor";
|
|
3
21
|
import EditorWorker from "monaco-editor/esm/vs/editor/editor.worker?worker";
|
|
4
22
|
import CssWorker from "monaco-editor/esm/vs/language/css/css.worker?worker";
|
|
@@ -131,4 +149,10 @@ export function initializeIntellisenseCodeEditor() {
|
|
|
131
149
|
});
|
|
132
150
|
loader.init();
|
|
133
151
|
}
|
|
134
|
-
|
|
152
|
+
`;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
exports.createInitializationPlugin = createInitializationPlugin;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var node_path = require('node:path');
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
function createInjectionPlugin() {
|
|
8
|
+
return {
|
|
9
|
+
name: "vef-framework:injection",
|
|
10
|
+
transform(code, id) {
|
|
11
|
+
if (node_path.basename(node_path.dirname(id)) === "src" && node_path.basename(id).startsWith("main.ts")) {
|
|
12
|
+
return `import "vef:tailwind.css";
|
|
13
|
+
${code}`;
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
exports.createInjectionPlugin = createInjectionPlugin;
|
|
@@ -1,4 +1,57 @@
|
|
|
1
|
-
"use strict"
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var promises = require('node:fs/promises');
|
|
5
|
+
var monaco_nls = require('./json/monaco.nls.json.cjs');
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
const nlsRegex = /monaco-editor[/\\]esm[/\\]vs[/\\]nls\.js/;
|
|
9
|
+
const nlsPathRegex = /monaco-editor[/\\]esm[/\\](?<path>.+)\.js/;
|
|
10
|
+
const localizeFnInvocationRegex = /localize\(/g;
|
|
11
|
+
function createMonacoNlsEsbuildPlugin() {
|
|
12
|
+
return {
|
|
13
|
+
name: "vef-framework:monaco-editor-nls",
|
|
14
|
+
setup(build) {
|
|
15
|
+
build.onLoad({ filter: nlsRegex }, () => ({
|
|
16
|
+
contents: buildNlsCode(),
|
|
17
|
+
loader: "js"
|
|
18
|
+
}));
|
|
19
|
+
build.onLoad({ filter: nlsPathRegex }, async ({ path }) => ({
|
|
20
|
+
contents: transformLocalizeFnInvocationCode(path, await promises.readFile(path.split("?")[0], "utf8")),
|
|
21
|
+
loader: "js"
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function createMonacoNlsRollupPlugin() {
|
|
27
|
+
return {
|
|
28
|
+
name: "vef-framework:monaco-editor-nls",
|
|
29
|
+
enforce: "pre",
|
|
30
|
+
load(id) {
|
|
31
|
+
if (nlsRegex.test(id)) {
|
|
32
|
+
return buildNlsCode();
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
transform(code, id) {
|
|
36
|
+
if (!nlsRegex.test(id)) {
|
|
37
|
+
return {
|
|
38
|
+
code: transformLocalizeFnInvocationCode(id, code),
|
|
39
|
+
map: null
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function transformLocalizeFnInvocationCode(file, code) {
|
|
46
|
+
const match = nlsPathRegex.exec(file);
|
|
47
|
+
if (match) {
|
|
48
|
+
const path = match.groups.path.replace(/\\/g, "/");
|
|
49
|
+
return code.replace(localizeFnInvocationRegex, `localize('${path}', `);
|
|
50
|
+
}
|
|
51
|
+
return code;
|
|
52
|
+
}
|
|
53
|
+
function buildNlsCode() {
|
|
54
|
+
return `/*---------------------------------------------------------------------------------------------
|
|
2
55
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
56
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
57
|
*--------------------------------------------------------------------------------------------*
|
|
@@ -76,4 +129,8 @@ export function localize2(data /* | number when built */, originalMessage, ...ar
|
|
|
76
129
|
value,
|
|
77
130
|
original: originalMessage === message ? value : _format(originalMessage, args)
|
|
78
131
|
};
|
|
79
|
-
}
|
|
132
|
+
}`;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
exports.createMonacoNlsEsbuildPlugin = createMonacoNlsEsbuildPlugin;
|
|
136
|
+
exports.createMonacoNlsRollupPlugin = createMonacoNlsRollupPlugin;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var vite = require('@tanstack/router-plugin/vite');
|
|
5
|
+
var node_path = require('node:path');
|
|
6
|
+
var constants = require('./constants.cjs');
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
function createRouterPlugin(projectDir, history = "hash", autoCodeSplitting) {
|
|
10
|
+
return vite.TanStackRouterVite({
|
|
11
|
+
routesDirectory: node_path.resolve(projectDir, constants.SRC_DIR, constants.PAGES_DIR),
|
|
12
|
+
generatedRouteTree: node_path.resolve(projectDir, constants.SRC_DIR, constants.ROUTER_DIR, "router.gen.ts"),
|
|
13
|
+
quoteStyle: "double",
|
|
14
|
+
semicolons: true,
|
|
15
|
+
disableTypes: false,
|
|
16
|
+
addExtensions: false,
|
|
17
|
+
disableLogging: false,
|
|
18
|
+
disableManifestGeneration: false,
|
|
19
|
+
routeFileIgnorePattern: "components",
|
|
20
|
+
indexToken: "index",
|
|
21
|
+
routeToken: "route",
|
|
22
|
+
enableRouteGeneration: true,
|
|
23
|
+
autoCodeSplitting,
|
|
24
|
+
routeTreeFileHeader: [
|
|
25
|
+
"/* eslint-disable */",
|
|
26
|
+
"// @ts-nocheck",
|
|
27
|
+
"// noinspection JSUnusedGlobalSymbols",
|
|
28
|
+
`import { createRouter } from "@vef-framework/starter";`
|
|
29
|
+
],
|
|
30
|
+
routeTreeFileFooter: [
|
|
31
|
+
`const router = createRouter({
|
|
32
|
+
routeTree,
|
|
33
|
+
history: "${history}",
|
|
34
|
+
});
|
|
35
|
+
`,
|
|
36
|
+
`declare module "@tanstack/react-router" {
|
|
37
|
+
interface Register {
|
|
38
|
+
router: typeof router;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`,
|
|
42
|
+
`export default router;`
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
exports.createRouterPlugin = createRouterPlugin;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var stylelint = require('vite-plugin-stylelint');
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
function createStylelintPlugin() {
|
|
8
|
+
return stylelint({
|
|
9
|
+
fix: true,
|
|
10
|
+
test: false,
|
|
11
|
+
dev: true,
|
|
12
|
+
build: false,
|
|
13
|
+
cache: true,
|
|
14
|
+
cacheLocation: "node_modules/.cache/.stylelintcache",
|
|
15
|
+
include: ["src/**/*.{scss,css}"],
|
|
16
|
+
exclude: ["node_modules", "virtual:", "vef:"],
|
|
17
|
+
emitError: true,
|
|
18
|
+
emitWarning: true,
|
|
19
|
+
emitWarningAsError: true
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.createStylelintPlugin = createStylelintPlugin;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var svgr = require('vite-plugin-svgr');
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
function createSvgrPlugin() {
|
|
8
|
+
return svgr({
|
|
9
|
+
include: "**/*.svg?react",
|
|
10
|
+
esbuildOptions: {
|
|
11
|
+
platform: "browser",
|
|
12
|
+
minify: true,
|
|
13
|
+
jsx: "automatic"
|
|
14
|
+
},
|
|
15
|
+
svgrOptions: {
|
|
16
|
+
plugins: [
|
|
17
|
+
"@svgr/plugin-svgo",
|
|
18
|
+
"@svgr/plugin-jsx"
|
|
19
|
+
],
|
|
20
|
+
icon: false,
|
|
21
|
+
dimensions: false,
|
|
22
|
+
prettier: true,
|
|
23
|
+
memo: true,
|
|
24
|
+
svgo: true,
|
|
25
|
+
ref: false,
|
|
26
|
+
typescript: true,
|
|
27
|
+
jsxRuntime: "automatic",
|
|
28
|
+
svgoConfig: {
|
|
29
|
+
multipass: true,
|
|
30
|
+
datauri: "base64",
|
|
31
|
+
js2svg: {
|
|
32
|
+
indent: 2,
|
|
33
|
+
pretty: true
|
|
34
|
+
},
|
|
35
|
+
plugins: [
|
|
36
|
+
"preset-default",
|
|
37
|
+
{
|
|
38
|
+
name: "prefixIds",
|
|
39
|
+
params: {
|
|
40
|
+
prefix: "vef"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "cleanupIds",
|
|
45
|
+
params: {
|
|
46
|
+
force: true,
|
|
47
|
+
remove: true,
|
|
48
|
+
minify: true
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
svgProps: {}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
exports.createSvgrPlugin = createSvgrPlugin;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
"use strict";
|
|
5
|
+
const virtualModuleId = "vef:tailwind.css";
|
|
6
|
+
const resolvedVirtualModuleId = `\0${virtualModuleId}`;
|
|
7
|
+
function createTailwindcssPlugin() {
|
|
8
|
+
return {
|
|
9
|
+
name: "vef-framework:tailwindcss",
|
|
10
|
+
resolveId(id) {
|
|
11
|
+
if (id === virtualModuleId) {
|
|
12
|
+
return resolvedVirtualModuleId;
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
load(id) {
|
|
16
|
+
if (id === resolvedVirtualModuleId) {
|
|
17
|
+
return `@import "tailwindcss";
|
|
18
|
+
@config "./tailwind.config.js";`;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports.createTailwindcssPlugin = createTailwindcssPlugin;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var tsconfigPaths = require('vite-tsconfig-paths');
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
function createTsconfigPathsPlugin(projectDir) {
|
|
8
|
+
return tsconfigPaths({
|
|
9
|
+
root: projectDir
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.createTsconfigPathsPlugin = createTsconfigPathsPlugin;
|