Skip to content

Commit b1374e2

Browse files
committed
initial indexedDB & FSA implementation
1 parent dbde339 commit b1374e2

File tree

12 files changed

+3418
-0
lines changed

12 files changed

+3418
-0
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
.eslintrc.js
3+
lib
4+
examples
5+
dist

.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['eslint:recommended', 'airbnb-base'],
4+
plugins: ['import'],
5+
parserOptions: {
6+
project: './tsconfig.eslint.json',
7+
},
8+
};

package.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "files-multitool",
3+
"version": "0.0.1",
4+
"description": "Files Multitool",
5+
"main": "dist/index.js",
6+
"module": "dist/index.min.mjs",
7+
"unpkg": "dist/index.umd.min.js",
8+
"types": "dist/index.d.ts",
9+
"files": [
10+
"dist"
11+
],
12+
"scripts": {
13+
"test": "mocha -r ts-node/register test/**/*.ts test/*.ts",
14+
"lint": "eslint",
15+
"clean": "rm -fr dist",
16+
"build": "yarn clean && yarn lint && yarn build:tsc && yarn bundle && yarn bundle:esm:min && yarn bundle:umd:min && yarn build:stats",
17+
"build:tsc": "tsc",
18+
"build:stats": "(echo '\\033[35;3m' ; cd dist && ls -lh index*js index*gz | tail -n +2 | awk '{print $5,$9}')",
19+
"bundle": "rollup --config rollup.config.js",
20+
"bundle:esm:min": "terser --ecma 6 --compress --mangle --module -o dist/index.min.mjs -- dist/index.mjs && gzip -9 -c dist/index.min.mjs > dist/index.min.mjs.gz",
21+
"bundle:umd:min": "terser --ecma 6 --compress --mangle -o dist/index.umd.min.js -- dist/index.umd.js && gzip -9 -c dist/index.umd.min.js > dist/index.umd.min.js.gz"
22+
},
23+
"author": "Fraser Bullock",
24+
"license": "MIT",
25+
"repository": {
26+
"type": "git",
27+
"url": "git://github.com/duinoapp/files-multitool.git"
28+
},
29+
"devDependencies": {
30+
"@rollup/plugin-commonjs": "^23.0.2",
31+
"@rollup/plugin-json": "^5.0.1",
32+
"@rollup/plugin-node-resolve": "^15.0.1",
33+
"@types/chai": "^4.3.1",
34+
"@types/mocha": "^9.1.1",
35+
"@types/node": "^18.0.6",
36+
"@types/wicg-file-system-access": "^2020.9.6",
37+
"@typescript-eslint/eslint-plugin": "^5.23.0",
38+
"@typescript-eslint/parser": "^5.23.0",
39+
"chai": "^4.3.6",
40+
"eslint": "^8.15.0",
41+
"eslint-config-airbnb-base": "^15.0.0",
42+
"eslint-config-airbnb-typescript": "^17.0.0",
43+
"eslint-plugin-import": "^2.26.0",
44+
"mocha": "^10.0.0",
45+
"rollup": "^3.2.3",
46+
"rollup-plugin-node-polyfills": "^0.2.1",
47+
"terser": "^5.15.1",
48+
"ts-node": "^10.8.0",
49+
"typescript": "^4.6.4"
50+
},
51+
"dependencies": {
52+
"node-fetch": "^3.3.1"
53+
}
54+
}

rollup.config.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
const { nodeResolve } = require('@rollup/plugin-node-resolve');
2+
const commonjs = require('@rollup/plugin-commonjs');
3+
const json = require('@rollup/plugin-json');
4+
const nodePolyfills = require('rollup-plugin-node-polyfills');
5+
6+
module.exports = [{
7+
input: 'dist/index.js',
8+
output: [
9+
{
10+
file: 'dist/index.cjs',
11+
format: 'cjs',
12+
},
13+
{
14+
file: 'dist/index.mjs',
15+
format: 'esm',
16+
},
17+
{
18+
file: 'dist/index.umd.js',
19+
format: 'umd',
20+
name: 'filesMultitool',
21+
globals: {
22+
'node-fetch': 'node-fetch',
23+
},
24+
},
25+
],
26+
context: 'this',
27+
external: ['node-fetch'],
28+
plugins: [
29+
commonjs({
30+
ignoreGlobal: true,
31+
}),
32+
nodePolyfills({ include: ['buffer'] }),
33+
nodeResolve({ preferBuiltins: false }),
34+
json(),
35+
],
36+
}];

0 commit comments

Comments
 (0)