Sfoglia il codice sorgente

chore: Remove support for deprecated Excalidraw for Desktop (#2465)

vanilla_orig
Lipis 4 anni fa
parent
commit
10e07e434c
Nessun account collegato all'indirizzo email del committer
4 ha cambiato i file con 21 aggiunte e 40 eliminazioni
  1. 0
    27
      package-lock.json
  2. 2
    3
      package.json
  3. 2
    0
      public/index.html
  4. 17
    10
      scripts/build-version.js

+ 0
- 27
package-lock.json Vedi File

4276
       "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
4276
       "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
4277
       "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY="
4277
       "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY="
4278
     },
4278
     },
4279
-    "asar": {
4280
-      "version": "3.0.3",
4281
-      "resolved": "https://registry.npmjs.org/asar/-/asar-3.0.3.tgz",
4282
-      "integrity": "sha512-k7zd+KoR+n8pl71PvgElcoKHrVNiSXtw7odKbyNpmgKe7EGRF9Pnu3uLOukD37EvavKwVFxOUpqXTIZC5B5Pmw==",
4283
-      "dev": true,
4284
-      "requires": {
4285
-        "@types/glob": "^7.1.1",
4286
-        "chromium-pickle-js": "^0.2.0",
4287
-        "commander": "^5.0.0",
4288
-        "glob": "^7.1.6",
4289
-        "minimatch": "^3.0.4"
4290
-      },
4291
-      "dependencies": {
4292
-        "commander": {
4293
-          "version": "5.0.0",
4294
-          "resolved": "https://registry.npmjs.org/commander/-/commander-5.0.0.tgz",
4295
-          "integrity": "sha512-JrDGPAKjMGSP1G0DUoaceEJ3DZgAfr/q6X7FVk4+U5KxUSKviYGM2k6zWkfyyBHy5rAtzgYJFa1ro2O9PtoxwQ==",
4296
-          "dev": true
4297
-        }
4298
-      }
4299
-    },
4300
     "asn1": {
4279
     "asn1": {
4301
       "version": "0.2.4",
4280
       "version": "0.2.4",
4302
       "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
4281
       "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
5699
         "tslib": "^1.9.0"
5678
         "tslib": "^1.9.0"
5700
       }
5679
       }
5701
     },
5680
     },
5702
-    "chromium-pickle-js": {
5703
-      "version": "0.2.0",
5704
-      "resolved": "https://registry.npmjs.org/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz",
5705
-      "integrity": "sha1-BKEGZywYsIWrd02YPfo+oTjyIgU=",
5706
-      "dev": true
5707
-    },
5708
     "ci-info": {
5681
     "ci-info": {
5709
       "version": "2.0.0",
5682
       "version": "2.0.0",
5710
       "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz",
5683
       "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz",

+ 2
- 3
package.json Vedi File

52
   "devDependencies": {
52
   "devDependencies": {
53
     "@types/lodash.throttle": "4.1.6",
53
     "@types/lodash.throttle": "4.1.6",
54
     "@types/pako": "1.0.1",
54
     "@types/pako": "1.0.1",
55
-    "asar": "3.0.3",
56
     "eslint-config-prettier": "7.0.0",
55
     "eslint-config-prettier": "7.0.0",
57
     "eslint-plugin-prettier": "3.3.0",
56
     "eslint-plugin-prettier": "3.3.0",
58
     "firebase-tools": "8.19.0",
57
     "firebase-tools": "8.19.0",
84
     "build-node": "node ./scripts/build-node.js",
83
     "build-node": "node ./scripts/build-node.js",
85
     "build:app:docker": "REACT_APP_INCLUDE_GTAG=false REACT_APP_DISABLE_SENTRY=true react-scripts build",
84
     "build:app:docker": "REACT_APP_INCLUDE_GTAG=false REACT_APP_DISABLE_SENTRY=true react-scripts build",
86
     "build:app": "REACT_APP_INCLUDE_GTAG=true REACT_APP_GIT_SHA=$NOW_GITHUB_COMMIT_SHA react-scripts build",
85
     "build:app": "REACT_APP_INCLUDE_GTAG=true REACT_APP_GIT_SHA=$NOW_GITHUB_COMMIT_SHA react-scripts build",
87
-    "build:zip": "node ./scripts/build-version.js",
88
-    "build": "npm run build:app && npm run build:zip",
86
+    "build:version": "node ./scripts/build-version.js",
87
+    "build": "npm run build:app && npm run build:version",
89
     "eject": "react-scripts eject",
88
     "eject": "react-scripts eject",
90
     "fix:code": "npm run test:code -- --fix",
89
     "fix:code": "npm run test:code -- --fix",
91
     "fix:other": "npm run prettier -- --write",
90
     "fix:other": "npm run prettier -- --write",

+ 2
- 0
public/index.html Vedi File

55
     <meta name="twitter:image" content="https://excalidraw.com/og-image.png" />
55
     <meta name="twitter:image" content="https://excalidraw.com/og-image.png" />
56
     <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
56
     <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
57
 
57
 
58
+    <!-- Excalidraw version -->
59
+    <meta name="version" content="{version}" />
58
     <link
60
     <link
59
       rel="preload"
61
       rel="preload"
60
       href="FG_Virgil.woff2"
62
       href="FG_Virgil.woff2"

+ 17
- 10
scripts/build-version.js Vedi File

2
 
2
 
3
 const fs = require("fs");
3
 const fs = require("fs");
4
 const path = require("path");
4
 const path = require("path");
5
-const asar = require("asar");
5
+const versionFile = path.join("build", "version.json");
6
+const indexFile = path.join("build", "index.html");
6
 
7
 
7
 const zero = (digit) => `0${digit}`.slice(-2);
8
 const zero = (digit) => `0${digit}`.slice(-2);
8
 
9
 
20
 
21
 
21
 const data = JSON.stringify(
22
 const data = JSON.stringify(
22
   {
23
   {
23
-    asar: "excalidraw.asar",
24
     version: versionDate(now),
24
     version: versionDate(now),
25
   },
25
   },
26
   undefined,
26
   undefined,
27
   2,
27
   2,
28
 );
28
 );
29
 
29
 
30
-fs.writeFileSync(path.join("build", "version.json"), data);
31
-
32
-(async () => {
33
-  const src = "build/";
34
-  const dest = path.join("build", `excalidraw.asar`);
35
-
36
-  await asar.createPackage(src, dest);
37
-})();
30
+fs.writeFileSync(versionFile, data);
31
+
32
+// https://stackoverflow.com/a/14181136/8418
33
+fs.readFile(indexFile, "utf8", (error, data) => {
34
+  if (error) {
35
+    return console.error(error);
36
+  }
37
+  const result = data.replace(/{version}/g, versionDate(now));
38
+
39
+  fs.writeFile(indexFile, result, "utf8", (error) => {
40
+    if (error) {
41
+      return console.error(error);
42
+    }
43
+  });
44
+});

Loading…
Annulla
Salva