瀏覽代碼

Move to demo/

Arjun Barrett 4 年之前
父節點
當前提交
1fb0a30477

+ 2 - 2
src/demo/App.tsx → demo/App.tsx

@@ -53,13 +53,13 @@ const App: FC = () => {
           <br /><br />
           <br /><br />
           You can both pack and expand Zlib, GZIP, DEFLATE, or ZIP files very quickly with just a few lines of code.
           You can both pack and expand Zlib, GZIP, DEFLATE, or ZIP files very quickly with just a few lines of code.
           <br /><br />
           <br /><br />
-          Weighing in at a measly 8kB for basic (de)compression, you don't need to worry about your bundle size ballooning.
+          Weighing in at a measly 8kB for basic compression and decompression, you don't need to worry about your bundle size ballooning.
           <br /><br />
           <br /><br />
           Despite utilizing multiple cores, supporting data streams, and being very memory efficient, fflate is compatible with both Node.js and browsers as old as IE11.
           Despite utilizing multiple cores, supporting data streams, and being very memory efficient, fflate is compatible with both Node.js and browsers as old as IE11.
           <br /><br />
           <br /><br />
           You can read more about fflate on <a href="//github.com/package/fflate">GitHub</a>. Try the demo below to see its performance for yourself. The code boxes are editable; try changing parameters or using a different compression format.
           You can read more about fflate on <a href="//github.com/package/fflate">GitHub</a>. Try the demo below to see its performance for yourself. The code boxes are editable; try changing parameters or using a different compression format.
           <br /><br />
           <br /><br />
-          <span style={{ color: 'gray' }}>Disclaimer: I added a <span style={{ fontStyle: 'italic' }}>lot</span> of sugar (around 4 hundred lines) to the UZIP and Pako APIs to make the demo clean and asynchronous, but the fflate API is unmodified.</span>
+          <span style={{ fontSize: '0.75em' }}>Disclaimer: I added a <span style={{ fontStyle: 'italic' }}>lot</span> of sugar (around 4 hundred lines) to the UZIP and Pako APIs to make the demo clean and asynchronous, but the fflate API is unmodified.</span>
           <br /><br />
           <br /><br />
         </div>
         </div>
         <div style={{
         <div style={{

+ 0 - 0
src/demo/augment.d.ts → demo/augment.d.ts


+ 2 - 1
src/demo/components/code-box/index.tsx → demo/components/code-box/index.tsx

@@ -174,6 +174,7 @@ for (var i = 0; i < files.length; ++i) {
 // If you choose JSZip, make sure to use v3.1.5 for adequate performance
 // If you choose JSZip, make sure to use v3.1.5 for adequate performance
 // (2-3x slower than fflate) instead of the latest version, which is 20-30x
 // (2-3x slower than fflate) instead of the latest version, which is 20-30x
 // slower than fflate.
 // slower than fflate.
+
 var zipObj = pakoWorker.zip();
 var zipObj = pakoWorker.zip();
 var processFile = function(i) {
 var processFile = function(i) {
   var file = files[i];
   var file = files[i];
@@ -215,7 +216,7 @@ callback(new Error('unsupported'));`,
 const file = files[0];
 const file = files[0];
 // In case this wasn't clear already, Pako doesn't actually support this,
 // In case this wasn't clear already, Pako doesn't actually support this,
 // you need to create a custom async stream. I suppose you could copy the
 // you need to create a custom async stream. I suppose you could copy the
-// code used in this demo, which is on GitHub under the src/demo directory.
+// code used in this demo, which is on GitHub under the demo/ directory.
 const gzipStream = pakoWorker.createGzip();
 const gzipStream = pakoWorker.createGzip();
 const fakeResponse = new Response(
 const fakeResponse = new Response(
   file.stream().pipeThrough(toNativeStream(gzipStream))
   file.stream().pipeThrough(toNativeStream(gzipStream))

+ 0 - 0
src/demo/components/code-box/prism.css → demo/components/code-box/prism.css


+ 0 - 0
src/demo/components/code-box/prism.js → demo/components/code-box/prism.js


+ 1 - 1
src/demo/components/code-box/sandbox.ts → demo/components/code-box/sandbox.ts

@@ -1,4 +1,4 @@
-import * as fflate from '../../../../';
+import * as fflate from '../../..';
 import toNativeStream from './stream-adapter';
 import toNativeStream from './stream-adapter';
 
 
 type Callback = (...args: unknown[]) => void;
 type Callback = (...args: unknown[]) => void;

+ 0 - 0
src/demo/components/code-box/stream-adapter.tsx → demo/components/code-box/stream-adapter.tsx


+ 0 - 0
src/demo/components/file-picker/index.tsx → demo/components/file-picker/index.tsx


+ 0 - 0
src/demo/index.css → demo/index.css


+ 1 - 1
src/demo/index.html → demo/index.html

@@ -3,7 +3,7 @@
 <head>
 <head>
   <meta charset="UTF-8">
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  <title>Document</title>
+  <title>fflate demo</title>
   <link rel="stylesheet" href="index.css">
   <link rel="stylesheet" href="index.css">
 </head>
 </head>
 <body>
 <body>

+ 0 - 0
src/demo/index.tsx → demo/index.tsx


+ 0 - 0
src/demo/sw.ts → demo/sw.ts


+ 0 - 0
src/demo/util/workers.ts → demo/util/workers.ts


+ 2 - 2
package.json

@@ -17,7 +17,7 @@
     "browser": false,
     "browser": false,
     "types": false,
     "types": false,
     "demo": {
     "demo": {
-      "distDir": "demo"
+      "distDir": "dist"
     }
     }
   },
   },
   "sideEffects": false,
   "sideEffects": false,
@@ -47,7 +47,7 @@
     "build:lib": "tsc && tsc --project tsconfig.esm.json && yarn build:umd",
     "build:lib": "tsc && tsc --project tsconfig.esm.json && yarn build:umd",
     "build:umd": "SC=buildUMD yarn script",
     "build:umd": "SC=buildUMD yarn script",
     "build:rewrite": "SC=rewriteBuilds yarn script",
     "build:rewrite": "SC=rewriteBuilds yarn script",
-    "build:demo": "tsc --project tsconfig.demo.json && parcel build src/demo/index.html --dist-dir demo",
+    "build:demo": "tsc --project tsconfig.demo.json && parcel build demo/index.html",
     "build:docs": "typedoc --mode library --plugin typedoc-plugin-markdown --hideProjectName --hideBreadcrumbs --readme none --disableSources --excludePrivate --excludeProtected --out docs/ src/index.ts",
     "build:docs": "typedoc --mode library --plugin typedoc-plugin-markdown --hideProjectName --hideBreadcrumbs --readme none --disableSources --excludePrivate --excludeProtected --out docs/ src/index.ts",
     "test": "TS_NODE_PROJECT=test/tsconfig.json uvu -b -r ts-node/register test",
     "test": "TS_NODE_PROJECT=test/tsconfig.json uvu -b -r ts-node/register test",
     "prepack": "yarn build && yarn test"
     "prepack": "yarn build && yarn test"

+ 2 - 2
tsconfig.demo.json

@@ -6,6 +6,6 @@
     "allowSyntheticDefaultImports": true,
     "allowSyntheticDefaultImports": true,
     "moduleResolution": "node"
     "moduleResolution": "node"
   },
   },
-  "include": ["src/demo/**/*.ts", "src/demo/**/*.tsx", "src/demo/augment.d.ts"],
-  "exclude": ["src/demo/sw.ts"]
+  "include": ["demo/**/*.ts", "demo/**/*.tsx", "demo/augment.d.ts"],
+  "exclude": ["demo/sw.ts"]
 }
 }