nextia 7.0.0 → 7.0.3
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/package.json +9 -13
- package/src/bin.js +4 -62
- package/src/{lib.js → lib/fx.js} +16 -31
- package/src/lib/index.js +32 -0
- package/src/lib/ui.js +121 -0
- package/src/lib/utils.js +107 -0
- package/template/README.md +0 -29
- package/template/_env.dev +0 -4
- package/template/_env.prod +0 -1
- package/template/_env.test +0 -1
- package/template/_gitignore +0 -10
- package/template/package.json +0 -35
- package/template/public/error.html +0 -14
- package/template/public/logo.svg +0 -105
- package/template/src/assets/i18n/index.js +0 -26
- package/template/src/assets/img/image.jpg +0 -0
- package/template/src/components/Counter/index.jsx +0 -34
- package/template/src/components/Counter/style.css +0 -5
- package/template/src/components/Message/index.jsx +0 -12
- package/template/src/components/index.js +0 -10
- package/template/src/components/ui/I18n/index.jsx +0 -23
- package/template/src/components/ui/Icon/index.jsx +0 -50
- package/template/src/components/ui/Link/index.jsx +0 -12
- package/template/src/components/ui/Svg/index.jsx +0 -54
- package/template/src/components/ui/Translate/index.jsx +0 -18
- package/template/src/index.html +0 -18
- package/template/src/index.jsx +0 -4
- package/template/src/pages/counter/functions.js +0 -6
- package/template/src/pages/counter/index.jsx +0 -51
- package/template/src/pages/counter/style.css +0 -2
- package/template/src/pages/env/functions.js +0 -3
- package/template/src/pages/env/index.jsx +0 -27
- package/template/src/pages/env/style.css +0 -2
- package/template/src/pages/functions.js +0 -37
- package/template/src/pages/home/functions.js +0 -43
- package/template/src/pages/home/index.jsx +0 -211
- package/template/src/pages/home/style.css +0 -51
- package/template/src/pages/http/not-found/index.jsx +0 -10
- package/template/src/pages/http/not-found/style.css +0 -2
- package/template/src/pages/icons/functions.js +0 -3
- package/template/src/pages/icons/index.jsx +0 -20
- package/template/src/pages/icons/style.css +0 -5
- package/template/src/pages/images/functions.js +0 -3
- package/template/src/pages/images/index.jsx +0 -20
- package/template/src/pages/images/style.css +0 -8
- package/template/src/pages/index.jsx +0 -114
- package/template/src/pages/mockapi/functions.js +0 -71
- package/template/src/pages/mockapi/index.jsx +0 -101
- package/template/src/pages/mockapi/style.css +0 -57
- package/template/src/pages/my-context/functions.js +0 -7
- package/template/src/pages/my-context/index.jsx +0 -32
- package/template/src/pages/my-context/style.css +0 -2
- package/template/src/pages/resize/functions.js +0 -3
- package/template/src/pages/resize/index.jsx +0 -15
- package/template/src/pages/resize/style.css +0 -2
- package/template/src/pages/search-params/functions.js +0 -3
- package/template/src/pages/search-params/index.jsx +0 -36
- package/template/src/pages/search-params/style.css +0 -2
- package/template/src/pages/subpage/hello/functions.js +0 -3
- package/template/src/pages/subpage/hello/index.jsx +0 -11
- package/template/src/pages/subpage/hello/style.css +0 -2
- package/template/src/pages/translate/functions.js +0 -5
- package/template/src/pages/translate/index.jsx +0 -31
- package/template/src/pages/translate/style.css +0 -12
- package/template/src/services/api.js +0 -9
- package/template/src/services/http.js +0 -40
- package/template/src/theme/animations.css +0 -72
- package/template/src/theme/fonts/Roboto-Regular.ttf +0 -0
- package/template/src/theme/fonts/index.css +0 -7
- package/template/src/theme/icons/exit.svg +0 -69
- package/template/src/theme/icons/icons.svg +0 -126
- package/template/src/theme/index.css +0 -39
- package/template/src/theme/util.css +0 -27
- package/template/src/utils/hooks.js +0 -49
- package/template/src/utils/index.js +0 -19
- package/template/test/index.test.js +0 -12
- package/template/vite.config.js +0 -97
package/template/vite.config.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { execSync } from 'node:child_process'
|
|
2
|
-
import { readFile } from 'node:fs/promises'
|
|
3
|
-
import react from '@vitejs/plugin-react'
|
|
4
|
-
import { defineConfig } from 'vite'
|
|
5
|
-
import { version } from './package.json'
|
|
6
|
-
|
|
7
|
-
export default defineConfig(({ mode }) => {
|
|
8
|
-
const CWD = process.cwd()
|
|
9
|
-
const host = '0.0.0.0'
|
|
10
|
-
const port = 3000
|
|
11
|
-
|
|
12
|
-
return {
|
|
13
|
-
server: {
|
|
14
|
-
host,
|
|
15
|
-
port
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
preview: {
|
|
19
|
-
host,
|
|
20
|
-
port
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
base: '',
|
|
24
|
-
envDir: CWD,
|
|
25
|
-
envPrefix: 'PUBLIC_',
|
|
26
|
-
root: `${CWD}/src`,
|
|
27
|
-
publicDir: `${CWD}/public`,
|
|
28
|
-
|
|
29
|
-
resolve: {
|
|
30
|
-
alias: Object.fromEntries(
|
|
31
|
-
['assets', 'components', 'services', 'theme', 'utils'].map((dir) => [
|
|
32
|
-
dir,
|
|
33
|
-
`${CWD}/src/${dir}`
|
|
34
|
-
])
|
|
35
|
-
)
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
build: {
|
|
39
|
-
outDir: '../out',
|
|
40
|
-
assetsDir: 'assets',
|
|
41
|
-
emptyOutDir: true
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
css: {
|
|
45
|
-
postcss: {}
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
plugins: [
|
|
49
|
-
react(),
|
|
50
|
-
{
|
|
51
|
-
name: 'html',
|
|
52
|
-
transformIndexHtml(html) {
|
|
53
|
-
let gitHash = ''
|
|
54
|
-
try {
|
|
55
|
-
gitHash = execSync('git rev-parse --short HEAD 2> /dev/null')
|
|
56
|
-
.toString()
|
|
57
|
-
.trim()
|
|
58
|
-
} catch {}
|
|
59
|
-
|
|
60
|
-
html.replaceAll(
|
|
61
|
-
'%VERSION%',
|
|
62
|
-
`version=${version}, env=${mode}, release-date=${new Date()}, git-hash=${gitHash}`
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
return html
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
name: 'svg',
|
|
70
|
-
async transform(_src, id) {
|
|
71
|
-
const [path, query] = id.split('?')
|
|
72
|
-
if (query !== 'raw') return
|
|
73
|
-
|
|
74
|
-
let code = await readFile(path, 'utf8')
|
|
75
|
-
code = code
|
|
76
|
-
.replace(/\s{2,}/g, ' ') // multiple spaces to single space
|
|
77
|
-
.replace(/\n/g, '') // remove newlines
|
|
78
|
-
.replace(/\t/g, '') // remove tabs
|
|
79
|
-
.replace(/>\s+</g, '><') // remove space between tags
|
|
80
|
-
.trim()
|
|
81
|
-
return `export default ${JSON.stringify(code)};`
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
],
|
|
85
|
-
|
|
86
|
-
test: {
|
|
87
|
-
root: './',
|
|
88
|
-
environment: 'jsdom',
|
|
89
|
-
include: ['test/**/*.test.{js,jsx,ts,tsx}'],
|
|
90
|
-
coverage: {
|
|
91
|
-
reportsDirectory: '.coverage',
|
|
92
|
-
exclude: ['src/assets', 'src/components/index.js', 'src/index.jsx'],
|
|
93
|
-
include: ['src/**/*.{js,jsx,ts,tsx}']
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
})
|