@locode2/harness 0.1.0-preview.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/README.md +27 -0
- package/THIRD_PARTY_LICENSES.txt +32769 -0
- package/THIRD_PARTY_NOTICES.md +13 -0
- package/apps/host/dist/document-parser-worker.js +215 -0
- package/apps/host/dist/frontend-runtime-worker.js +1755 -0
- package/apps/host/dist/index.js +23380 -0
- package/apps/web/dist/assets/LocalMonacoEditor-CXkKwxiP.css +1 -0
- package/apps/web/dist/assets/LocalMonacoEditor-WKAHQmzG.js +940 -0
- package/apps/web/dist/assets/LogsView-BFFFSFB-.js +1 -0
- package/apps/web/dist/assets/PluginsView-DM_ZnENS.js +1 -0
- package/apps/web/dist/assets/SettingsView-Cb5Q4ile.js +1 -0
- package/apps/web/dist/assets/abap-DLDM7-KI.js +1 -0
- package/apps/web/dist/assets/apex-DNDY2TF8.js +1 -0
- package/apps/web/dist/assets/azcli-Y6nb8tq_.js +1 -0
- package/apps/web/dist/assets/bat-BwHxbl9M.js +1 -0
- package/apps/web/dist/assets/bicep-CFznDFnq.js +2 -0
- package/apps/web/dist/assets/cameligo-Bf6VGUru.js +1 -0
- package/apps/web/dist/assets/clojure-Dnu-v4kV.js +1 -0
- package/apps/web/dist/assets/codicon-Brq4_Ui5.ttf +0 -0
- package/apps/web/dist/assets/coffee-Bd8akH9Z.js +1 -0
- package/apps/web/dist/assets/cpp-BbWJElDN.js +1 -0
- package/apps/web/dist/assets/csharp-Co3qMtFm.js +1 -0
- package/apps/web/dist/assets/csp-D-4FJmMZ.js +1 -0
- package/apps/web/dist/assets/css-DdJfP1eB.js +3 -0
- package/apps/web/dist/assets/css.worker-11mhRRLC.js +97 -0
- package/apps/web/dist/assets/cssMode-L5f5LAEn.js +1 -0
- package/apps/web/dist/assets/cypher-cTPe9QuQ.js +1 -0
- package/apps/web/dist/assets/dart-BOtBlQCF.js +1 -0
- package/apps/web/dist/assets/dockerfile-BG73LgW2.js +1 -0
- package/apps/web/dist/assets/ecl-BEgZUVRK.js +1 -0
- package/apps/web/dist/assets/editor.worker-DysRFSaV.js +30 -0
- package/apps/web/dist/assets/elixir-BkW5O-1t.js +1 -0
- package/apps/web/dist/assets/flow9-BeJ5waoc.js +1 -0
- package/apps/web/dist/assets/freemarker2-UOwftS75.js +3 -0
- package/apps/web/dist/assets/fsharp-PahG7c26.js +1 -0
- package/apps/web/dist/assets/go-acbASCJo.js +1 -0
- package/apps/web/dist/assets/graphql-BxJiqAUM.js +1 -0
- package/apps/web/dist/assets/handlebars-C_E41ffr.js +1 -0
- package/apps/web/dist/assets/hcl-DtV1sZF8.js +1 -0
- package/apps/web/dist/assets/html-HsrixH2x.js +1 -0
- package/apps/web/dist/assets/html.worker-C8Tw8ncf.js +474 -0
- package/apps/web/dist/assets/htmlMode-DipGmEOi.js +1 -0
- package/apps/web/dist/assets/index-COUF63cT.js +213 -0
- package/apps/web/dist/assets/index-SNSmF2-c.css +1 -0
- package/apps/web/dist/assets/ini-Kd9XrMLS.js +1 -0
- package/apps/web/dist/assets/java-CXBNlu9o.js +1 -0
- package/apps/web/dist/assets/javascript-D36WEqF9.js +1 -0
- package/apps/web/dist/assets/json.worker-BzkYZgJ7.js +62 -0
- package/apps/web/dist/assets/jsonMode-D9BrIats.js +7 -0
- package/apps/web/dist/assets/julia-cl7-CwDS.js +1 -0
- package/apps/web/dist/assets/kotlin-s7OhZKlX.js +1 -0
- package/apps/web/dist/assets/less-9HpZscsL.js +2 -0
- package/apps/web/dist/assets/lexon-OrD6JF1K.js +1 -0
- package/apps/web/dist/assets/liquid-DES89Tjc.js +1 -0
- package/apps/web/dist/assets/lock-keyhole-jo-FJcGq.js +1 -0
- package/apps/web/dist/assets/lspLanguageFeatures-YKkgcn4q.js +4 -0
- package/apps/web/dist/assets/lua-Cyyb5UIc.js +1 -0
- package/apps/web/dist/assets/m3-B8OfTtLu.js +1 -0
- package/apps/web/dist/assets/markdown-BFxVWTOG.js +1 -0
- package/apps/web/dist/assets/mdx-D1Bfax8e.js +1 -0
- package/apps/web/dist/assets/mips-CiqrrVzr.js +1 -0
- package/apps/web/dist/assets/msdax-DmeGPVcC.js +1 -0
- package/apps/web/dist/assets/mysql-C_tMU-Nz.js +1 -0
- package/apps/web/dist/assets/objective-c-BDtDVThU.js +1 -0
- package/apps/web/dist/assets/pascal-vHIfCaH5.js +1 -0
- package/apps/web/dist/assets/pascaligo-DtZ0uQbO.js +1 -0
- package/apps/web/dist/assets/perl-Ub6l9XKa.js +1 -0
- package/apps/web/dist/assets/pgsql-BlNEE0v7.js +1 -0
- package/apps/web/dist/assets/php-BBUBE1dy.js +1 -0
- package/apps/web/dist/assets/pla-DSh2-awV.js +1 -0
- package/apps/web/dist/assets/postiats-CocnycG-.js +1 -0
- package/apps/web/dist/assets/powerquery-tScXyioY.js +1 -0
- package/apps/web/dist/assets/powershell-COWaemsV.js +1 -0
- package/apps/web/dist/assets/protobuf-Brw8urJB.js +2 -0
- package/apps/web/dist/assets/pug-8SOpv6rk.js +1 -0
- package/apps/web/dist/assets/python-DKhPhY0N.js +1 -0
- package/apps/web/dist/assets/qsharp-Bw9ernYp.js +1 -0
- package/apps/web/dist/assets/r-j7ic8hl3.js +1 -0
- package/apps/web/dist/assets/razor-Cha8qrI6.js +1 -0
- package/apps/web/dist/assets/redis-Bu5POkcn.js +1 -0
- package/apps/web/dist/assets/redshift-Bs9aos_-.js +1 -0
- package/apps/web/dist/assets/restructuredtext-CqXO7rUv.js +1 -0
- package/apps/web/dist/assets/ruby-zBfavPgS.js +1 -0
- package/apps/web/dist/assets/rust-BzKRNQWT.js +1 -0
- package/apps/web/dist/assets/sb-BBc9UKZt.js +1 -0
- package/apps/web/dist/assets/scala-D9hQfWCl.js +1 -0
- package/apps/web/dist/assets/scheme-BPhDTwHR.js +1 -0
- package/apps/web/dist/assets/scss-CBJaRo0y.js +3 -0
- package/apps/web/dist/assets/shell-DiJ1NA_G.js +1 -0
- package/apps/web/dist/assets/solidity-Db0IVjzk.js +1 -0
- package/apps/web/dist/assets/sophia-CnS9iZB_.js +1 -0
- package/apps/web/dist/assets/sparql-CJmd_6j2.js +1 -0
- package/apps/web/dist/assets/sql-ClhHkBeG.js +1 -0
- package/apps/web/dist/assets/st-CHwy0fLd.js +1 -0
- package/apps/web/dist/assets/swift-CnmFD0ga.js +1 -0
- package/apps/web/dist/assets/systemverilog-Bs9z6M-B.js +1 -0
- package/apps/web/dist/assets/tcl-Dm6ycUr_.js +1 -0
- package/apps/web/dist/assets/ts.worker-Bupg6llt.js +67722 -0
- package/apps/web/dist/assets/tsMode-CEhssXv8.js +11 -0
- package/apps/web/dist/assets/twig-Csy3S7wG.js +1 -0
- package/apps/web/dist/assets/typescript-DWqmw58R.js +1 -0
- package/apps/web/dist/assets/typespec-Btyra-wh.js +1 -0
- package/apps/web/dist/assets/vb-Db0cS2oM.js +1 -0
- package/apps/web/dist/assets/wgsl-DumH7NcR.js +298 -0
- package/apps/web/dist/assets/workers-BmZvNFRq.js +1 -0
- package/apps/web/dist/assets/xml-WQTAFV9b.js +1 -0
- package/apps/web/dist/assets/yaml-Ke2Lf79d.js +1 -0
- package/apps/web/dist/index.html +15 -0
- package/bin/launch.mjs +71 -0
- package/bin/locode-mini.mjs +12 -0
- package/bin/options.mjs +49 -0
- package/bin/restore-assets.mjs +40 -0
- package/bundled-plugins/fast-frontend/.gitignore +2 -0
- package/bundled-plugins/fast-frontend/README.md +29 -0
- package/bundled-plugins/fast-frontend/harness.plugin.json +123 -0
- package/bundled-plugins/fast-frontend/runtimes/antd-admin/PUBLIC_CONTRACT.md +139 -0
- package/bundled-plugins/fast-frontend/runtimes/antd-admin/contracts/app.schema.json +24 -0
- package/bundled-plugins/fast-frontend/runtimes/antd-admin/contracts/route.schema.json +52 -0
- package/bundled-plugins/fast-frontend/runtimes/antd-admin/examples/app.json +9 -0
- package/bundled-plugins/fast-frontend/runtimes/antd-admin/examples/route.json +8 -0
- package/bundled-plugins/fast-frontend/runtimes/antd-admin/index.html +17 -0
- package/bundled-plugins/fast-frontend/runtimes/antd-admin/package.json +31 -0
- package/bundled-plugins/fast-frontend/runtimes/antd-admin/scripts/smoke-build.mjs +40 -0
- package/bundled-plugins/fast-frontend/runtimes/antd-admin/src/inspector/index.ts +612 -0
- package/bundled-plugins/fast-frontend/runtimes/antd-admin/src/main.tsx +17 -0
- package/bundled-plugins/fast-frontend/runtimes/antd-admin/src/sdk/index.ts +1028 -0
- package/bundled-plugins/fast-frontend/runtimes/antd-admin/src/shell/RuntimeApp.tsx +380 -0
- package/bundled-plugins/fast-frontend/runtimes/antd-admin/src/shell/runtime.css +246 -0
- package/bundled-plugins/fast-frontend/runtimes/antd-admin/tsconfig.json +20 -0
- package/bundled-plugins/fast-frontend/runtimes/antd-admin/types/runtime.consumer-smoke.ts +70 -0
- package/bundled-plugins/fast-frontend/runtimes/antd-admin/types/runtime.d.ts +227 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/.gitignore +9 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/.harness/template.json +10 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/index.html +13 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/package.json +34 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/pnpm-lock.yaml +1451 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/pnpm-workspace.yaml +4 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/public/generated/.gitkeep +1 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/scripts/validate-routes.mjs +153 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/src/app/App.tsx +27 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/src/app/NotFoundPage.tsx +15 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/src/features/.gitkeep +1 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/src/layouts/MainLayout.tsx +77 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/src/main.tsx +14 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/src/mocks/dashboard.ts +48 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/src/pages/dashboard/page.tsx +151 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/src/pages/dashboard/route.ts +9 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/src/routes/definition.ts +21 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/src/routes/menu.tsx +44 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/src/routes/registry.ts +48 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/src/routes/router.tsx +34 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/src/shared/components/business/.gitkeep +1 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/src/shared/components/business/BusinessProviders.tsx +9 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/src/styles/global.css +180 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/src/vite-env.d.ts +1 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/tsconfig.app.json +24 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/tsconfig.json +7 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/tsconfig.node.json +17 -0
- package/bundled-plugins/fast-frontend/templates/antd-admin/vite.config.ts +39 -0
- package/npm-shrinkwrap.json +9737 -0
- package/package.json +80 -0
- package/release-integrity.json +168 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
color: #172033;
|
|
3
|
+
background: #f5f7fb;
|
|
4
|
+
font-synthesis: none;
|
|
5
|
+
text-rendering: optimizeLegibility;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
* {
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
html,
|
|
13
|
+
body,
|
|
14
|
+
#root {
|
|
15
|
+
min-width: 320px;
|
|
16
|
+
min-height: 100%;
|
|
17
|
+
margin: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
body {
|
|
21
|
+
min-height: 100vh;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
button,
|
|
25
|
+
input,
|
|
26
|
+
textarea,
|
|
27
|
+
select {
|
|
28
|
+
font: inherit;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.app-shell {
|
|
32
|
+
min-height: 100vh;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.app-sider {
|
|
36
|
+
position: sticky !important;
|
|
37
|
+
top: 0;
|
|
38
|
+
z-index: 2;
|
|
39
|
+
height: 100vh;
|
|
40
|
+
overflow: auto;
|
|
41
|
+
background: #fff !important;
|
|
42
|
+
border-right: 1px solid #eef0f5;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.app-sider .ant-menu {
|
|
46
|
+
border-inline-end: 0 !important;
|
|
47
|
+
padding: 4px 12px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.brand {
|
|
51
|
+
height: 68px;
|
|
52
|
+
padding: 0 18px;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.brand-mark {
|
|
58
|
+
display: grid;
|
|
59
|
+
flex: 0 0 36px;
|
|
60
|
+
width: 36px;
|
|
61
|
+
height: 36px;
|
|
62
|
+
color: #fff;
|
|
63
|
+
font-size: 18px;
|
|
64
|
+
place-items: center;
|
|
65
|
+
background: linear-gradient(135deg, #766df8, #4d7cf8);
|
|
66
|
+
border-radius: 11px;
|
|
67
|
+
box-shadow: 0 8px 20px rgb(99 91 255 / 24%);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.brand-name {
|
|
71
|
+
font-size: 17px;
|
|
72
|
+
font-weight: 700;
|
|
73
|
+
letter-spacing: 0.02em;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.app-header {
|
|
77
|
+
position: sticky;
|
|
78
|
+
top: 0;
|
|
79
|
+
z-index: 1;
|
|
80
|
+
height: 68px;
|
|
81
|
+
padding: 0 24px;
|
|
82
|
+
line-height: 68px;
|
|
83
|
+
border-bottom: 1px solid;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.user-avatar {
|
|
87
|
+
color: #5148d8 !important;
|
|
88
|
+
background: #eeecff !important;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.app-content {
|
|
92
|
+
min-width: 0;
|
|
93
|
+
padding: 28px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.dashboard-page {
|
|
97
|
+
display: grid;
|
|
98
|
+
max-width: 1480px;
|
|
99
|
+
margin: 0 auto;
|
|
100
|
+
gap: 20px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.page-loading {
|
|
104
|
+
display: grid;
|
|
105
|
+
min-height: 45vh;
|
|
106
|
+
color: #7a8296;
|
|
107
|
+
place-items: center;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.page-heading {
|
|
111
|
+
gap: 16px;
|
|
112
|
+
margin-bottom: 4px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.page-heading .ant-typography {
|
|
116
|
+
margin: 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.page-heading h2.ant-typography {
|
|
120
|
+
margin-bottom: 6px;
|
|
121
|
+
font-weight: 700;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.metric-card,
|
|
125
|
+
.work-card,
|
|
126
|
+
.progress-card {
|
|
127
|
+
height: 100%;
|
|
128
|
+
border: 1px solid rgb(224 228 238 / 74%);
|
|
129
|
+
box-shadow: 0 8px 28px rgb(41 50 75 / 5%);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.metric-card .ant-statistic-content {
|
|
133
|
+
margin: 8px 0 12px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.trend-positive {
|
|
137
|
+
color: #16a36a;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.trend-negative {
|
|
141
|
+
color: #ef5261;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.progress-content {
|
|
145
|
+
padding: 12px 10px 6px;
|
|
146
|
+
text-align: center;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.progress-content h4.ant-typography {
|
|
150
|
+
margin: 4px 0 8px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.progress-content .ant-typography {
|
|
154
|
+
max-width: 300px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@media (max-width: 767px) {
|
|
158
|
+
.app-header {
|
|
159
|
+
padding: 0 12px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.app-content {
|
|
163
|
+
padding: 20px 14px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.user-name {
|
|
167
|
+
display: none;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
@media (prefers-reduced-motion: reduce) {
|
|
172
|
+
*,
|
|
173
|
+
*::before,
|
|
174
|
+
*::after {
|
|
175
|
+
scroll-behavior: auto !important;
|
|
176
|
+
animation-duration: 0.01ms !important;
|
|
177
|
+
animation-iteration-count: 1 !important;
|
|
178
|
+
transition-duration: 0.01ms !important;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
+
"target": "ES2023",
|
|
5
|
+
"useDefineForClassFields": true,
|
|
6
|
+
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
|
7
|
+
"allowJs": false,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"noUncheckedIndexedAccess": true,
|
|
13
|
+
"exactOptionalPropertyTypes": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"module": "ESNext",
|
|
16
|
+
"moduleResolution": "Bundler",
|
|
17
|
+
"resolveJsonModule": true,
|
|
18
|
+
"isolatedModules": true,
|
|
19
|
+
"noEmit": true,
|
|
20
|
+
"jsx": "react-jsx",
|
|
21
|
+
"types": ["vite/client"]
|
|
22
|
+
},
|
|
23
|
+
"include": ["src"]
|
|
24
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "ES2023",
|
|
5
|
+
"lib": ["ES2023"],
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"module": "ESNext",
|
|
9
|
+
"moduleResolution": "Bundler",
|
|
10
|
+
"allowImportingTsExtensions": true,
|
|
11
|
+
"verbatimModuleSyntax": true,
|
|
12
|
+
"moduleDetection": "force",
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"types": ["node"]
|
|
15
|
+
},
|
|
16
|
+
"include": ["vite.config.ts"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import react from "@vitejs/plugin-react";
|
|
2
|
+
import { defineConfig } from "vite";
|
|
3
|
+
|
|
4
|
+
const contentSecurityPolicy = (scriptSource: string) => [
|
|
5
|
+
"default-src 'self'",
|
|
6
|
+
"base-uri 'self'",
|
|
7
|
+
"object-src 'none'",
|
|
8
|
+
"frame-ancestors 'self' http://127.0.0.1:* http://localhost:*",
|
|
9
|
+
scriptSource,
|
|
10
|
+
"style-src 'self' 'unsafe-inline'",
|
|
11
|
+
"img-src 'self' data:",
|
|
12
|
+
"font-src 'self' data:",
|
|
13
|
+
"connect-src 'self' ws://127.0.0.1:* ws://localhost:* wss://127.0.0.1:* wss://localhost:*",
|
|
14
|
+
].join("; ");
|
|
15
|
+
|
|
16
|
+
const securityHeaders = (scriptSource: string) => ({
|
|
17
|
+
"Content-Security-Policy": contentSecurityPolicy(scriptSource),
|
|
18
|
+
"Referrer-Policy": "strict-origin-when-cross-origin",
|
|
19
|
+
"X-Content-Type-Options": "nosniff",
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export default defineConfig({
|
|
23
|
+
plugins: [react()],
|
|
24
|
+
build: {
|
|
25
|
+
target: "es2023",
|
|
26
|
+
sourcemap: true,
|
|
27
|
+
},
|
|
28
|
+
server: {
|
|
29
|
+
// Harness intentionally omits allow-same-origin from the iframe sandbox so
|
|
30
|
+
// the preview cannot read cookies belonging to the Host's loopback name.
|
|
31
|
+
// Module requests therefore carry the opaque Origin header `null`.
|
|
32
|
+
cors: { origin: "null" },
|
|
33
|
+
// Vite React Fast Refresh injects one inline module in development.
|
|
34
|
+
headers: securityHeaders("script-src 'self' 'unsafe-inline'"),
|
|
35
|
+
},
|
|
36
|
+
preview: {
|
|
37
|
+
headers: securityHeaders("script-src 'self'"),
|
|
38
|
+
},
|
|
39
|
+
});
|