~repos /edge-city

#react#js#ssr

git clone https://pyrossh.dev/repos/edge-city.git

edge-city is a next level meta-framework for react that runs only on edge runtimes


2075bb6d Peter John

2 years ago
bundle css
packages/cli/index.js CHANGED
@@ -9,7 +9,6 @@ import postcss from "postcss"
9
9
  import autoprefixer from "autoprefixer";
10
10
  import postcssCustomMedia from "postcss-custom-media";
11
11
  import postcssNesting from "postcss-nesting";
12
- import mimeTypes from "mime-types";
13
12
  import bytes from 'bytes';
14
13
  import pc from 'picocolors';
15
14
  import ms from 'ms';
@@ -206,6 +205,15 @@ const buildServer = async (src, type) => {
206
205
  // }
207
206
  // }
208
207
 
208
+ const bundleCss = async () => {
209
+ const result = await postcss([
210
+ autoprefixer(),
211
+ postcssCustomMedia(),
212
+ postcssNesting,
213
+ ]).process(generatedCss, { from: "app.css", to: "app.css" });
214
+ fs.writeFileSync(`${process.cwd()}/build/static/app.css`, result.toString());
215
+ }
216
+
209
217
  const main = async () => {
210
218
  createDirs();
211
219
  buildImportMap();
@@ -216,32 +224,11 @@ const main = async () => {
216
224
  for (const s of services) {
217
225
  await buildServer(s, "service");
218
226
  }
219
- fs.writeFileSync(`${process.cwd()}/build/static/app.css`, generatedCss);
227
+ bundleCss();
220
228
  }
221
229
 
222
230
  main();
223
231
 
224
- // const renderCss = async (src) => {
225
- // try {
226
- // const cssText = await Bun.file(src).text();
227
- // const result = await postcss([
228
- // autoprefixer(),
229
- // postcssCustomMedia(),
230
- // // postcssNormalize({ browsers: 'last 2 versions' }),
231
- // postcssNesting,
232
- // ]).process(cssText, { from: src, to: src });
233
- // return new Response(result.css, {
234
- // headers: { 'Content-Type': 'text/css' },
235
- // status: 200,
236
- // });
237
- // } catch (err) {
238
- // return new Response(`Not Found`, {
239
- // headers: { 'Content-Type': 'text/html' },
240
- // status: 404,
241
- // });
242
- // }
243
- // }
244
-
245
232
  // const renderJs = async (srcFile) => {
246
233
  // try {
247
234
  // const jsText = await Bun.file(srcFile).text();
packages/example/components/Layout/Layout.jsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Link } from "parotta-runtime";
3
- import "normalize.css";
3
+ import "modern-normalize";
4
4
  import "nprogress/nprogress.css"
5
5
  import "./Layout.css";
6
6
 
packages/example/package.json CHANGED
@@ -11,8 +11,10 @@
11
11
  "dependencies": {
12
12
  "@neondatabase/serverless": "^0.2.9",
13
13
  "drizzle-orm": "0.26.0",
14
+ "modern-normalize": "^2.0.0",
14
15
  "normalize.css": "^8.0.1",
15
16
  "nprogress": "0.2.0",
17
+ "parotta-runtime": "workspace:*",
16
18
  "react": "18.2.0",
17
19
  "react-aria-components": "1.0.0-alpha.3",
18
20
  "react-dom": "18.2.0",
@@ -20,20 +22,16 @@
20
22
  "react-helmet-async": "1.3.0",
21
23
  "react-hook-form": "7.43.9",
22
24
  "sql-highlight": "^4.3.2",
23
- "zod": "^3.21.4",
25
+ "zod": "^3.21.4"
24
- "parotta-runtime": "workspace:*"
25
26
  },
26
27
  "devDependencies": {
27
- "parotta-cli": "workspace:*",
28
28
  "@playwright/test": "^1.31.2",
29
29
  "eslint": "^8.35.0",
30
- "eslint-config-react-app": "^7.0.1"
30
+ "eslint-config-react-app": "^7.0.1",
31
+ "parotta-cli": "workspace:*"
31
32
  },
32
33
  "parotta": {
33
- "hydrate": true,
34
+ "hydrate": true
34
- "css": [
35
- "node_modules/normalize.css/normalize.css"
36
- ]
37
35
  },
38
36
  "prettier": {
39
37
  "printWidth": 120
pnpm-lock.yaml CHANGED
@@ -58,6 +58,9 @@ importers:
58
58
  drizzle-orm:
59
59
  specifier: 0.26.0
60
60
  version: 0.26.0(@neondatabase/serverless@0.2.9)
61
+ modern-normalize:
62
+ specifier: ^2.0.0
63
+ version: 2.0.0
61
64
  normalize.css:
62
65
  specifier: ^8.0.1
63
66
  version: 8.0.1
@@ -4974,6 +4977,11 @@ packages:
4974
4977
  resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
4975
4978
  dev: true
4976
4979
 
4980
+ /modern-normalize@2.0.0:
4981
+ resolution: {integrity: sha512-CxBoEVKh5U4DH3XuNbc5ONLF6dQBc8dSc7pdZ1957FGbIO5JBqGqqchhET9dTexri8/pk9xBL6+5ceOtCIp1QA==}
4982
+ engines: {node: '>=6'}
4983
+ dev: false
4984
+
4977
4985
  /ms@2.1.2:
4978
4986
  resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
4979
4987
  dev: true