r2-explorer 0.2.1 → 0.2.3
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 +76 -0
- package/bin/r2-explorer.js +1 -1
- package/dist/index.js +311 -195
- package/package.json +71 -15
- package/.eslintrc.yml +0 -31
- package/rollup.config.js +0 -40
- package/spa/favicon.png +0 -0
- package/spa/index.html +0 -1
- package/spa/js/app.js +0 -127
- package/spa/js/app.js.map +0 -1
- package/src/api/core.js +0 -12
- package/src/api/createFolder.js +0 -13
- package/src/api/deleteObject.js +0 -15
- package/src/api/downloadFile.js +0 -23
- package/src/api/listContents.js +0 -27
- package/src/api/listDisks.js +0 -15
- package/src/api/renameObject.js +0 -24
- package/src/api/uploadFiles.js +0 -23
- package/src/index.js +0 -60
- package/wrangler.toml +0 -15
package/package.json
CHANGED
|
@@ -1,29 +1,85 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "r2-explorer",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
|
+
"description": "A Google Drive Interface for your Cloudflare R2 Buckets",
|
|
5
|
+
"main": "dist/umd/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"_postinstall": "husky install",
|
|
8
|
+
"prepublishOnly": "pinst --disable",
|
|
9
|
+
"postpublish": "pinst --enable",
|
|
10
|
+
"build": "npm run build:umd",
|
|
11
|
+
"build:umd": "node tools/cleanup umd && rollup --config rollup.config.js",
|
|
12
|
+
"clean": "node tools/cleanup",
|
|
13
|
+
"package": "npm run build && npm pack",
|
|
14
|
+
"test": "jest --no-cache --runInBand",
|
|
15
|
+
"test:cov": "jest --coverage --no-cache --runInBand",
|
|
16
|
+
"addscope": "node tools/packagejson name @g4brym/workers-qb",
|
|
17
|
+
"prettify": "prettier . --write --ignore-unknown",
|
|
18
|
+
"prepare": "husky install"
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"keywords": [
|
|
27
|
+
"cloudflare",
|
|
28
|
+
"worker",
|
|
29
|
+
"workers",
|
|
30
|
+
"serverless",
|
|
31
|
+
"cloudflare r2",
|
|
32
|
+
"r2",
|
|
33
|
+
"r2 storage",
|
|
34
|
+
"drive",
|
|
35
|
+
"google drive",
|
|
36
|
+
"ui",
|
|
37
|
+
"cf",
|
|
38
|
+
"typescript",
|
|
39
|
+
"npm",
|
|
40
|
+
"package",
|
|
41
|
+
"cjs",
|
|
42
|
+
"esm",
|
|
43
|
+
"umd",
|
|
44
|
+
"typed"
|
|
45
|
+
],
|
|
46
|
+
"author": "Gabriel Massadas",
|
|
47
|
+
"license": "MIT",
|
|
48
|
+
"homepage": "https://github.com/G4brym/R2-Explorer",
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git@github.com:G4brym/R2-Explorer.git"
|
|
52
|
+
},
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "https://github.com/G4brym/R2-Explorer/issues"
|
|
55
|
+
},
|
|
4
56
|
"devDependencies": {
|
|
57
|
+
"@commitlint/cli": "^13.1.0",
|
|
58
|
+
"@commitlint/config-conventional": "^13.1.0",
|
|
5
59
|
"@rollup/plugin-commonjs": "^17.0.0",
|
|
6
|
-
"@rollup/plugin-
|
|
7
|
-
"@rollup/plugin-html": "^1.0.1",
|
|
8
|
-
"@rollup/plugin-json": "^4.1.0",
|
|
60
|
+
"@rollup/plugin-json": "^5.0.1",
|
|
9
61
|
"@rollup/plugin-node-resolve": "^11.1.0",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
62
|
+
"@types/jest": "^27.0.1",
|
|
63
|
+
"@typescript-eslint/eslint-plugin": "^4.31.1",
|
|
64
|
+
"@typescript-eslint/parser": "^4.31.1",
|
|
65
|
+
"eslint": "^7.32.0",
|
|
66
|
+
"eslint-config-prettier": "^8.3.0",
|
|
67
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
68
|
+
"husky": "^7.0.2",
|
|
69
|
+
"jest": "^28.1.2",
|
|
70
|
+
"pinst": "^2.1.6",
|
|
71
|
+
"prettier": "^2.4.0",
|
|
12
72
|
"rollup": "^2.36.1",
|
|
13
|
-
"rollup-plugin-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
73
|
+
"rollup-plugin-ts": "^3.0.2",
|
|
74
|
+
"ts-jest": "^28.0.5",
|
|
75
|
+
"ts-loader": "^9.2.5",
|
|
76
|
+
"typescript": "^4.4.3",
|
|
18
77
|
"wrangler": "^2.4.2"
|
|
19
78
|
},
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "rollup --config rollup.config.js"
|
|
22
|
-
},
|
|
23
79
|
"dependencies": {
|
|
24
80
|
"itty-router": "^2.6.1"
|
|
25
81
|
},
|
|
26
82
|
"bin": {
|
|
27
|
-
|
|
83
|
+
"r2-explorer": "bin/r2-explorer.js"
|
|
28
84
|
}
|
|
29
85
|
}
|
package/.eslintrc.yml
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
env:
|
|
2
|
-
browser: true
|
|
3
|
-
es6: true
|
|
4
|
-
|
|
5
|
-
extends: 'eslint:recommended'
|
|
6
|
-
|
|
7
|
-
parserOptions:
|
|
8
|
-
ecmaVersion: 9
|
|
9
|
-
sourceType: module
|
|
10
|
-
|
|
11
|
-
rules:
|
|
12
|
-
indent:
|
|
13
|
-
- error
|
|
14
|
-
- 2
|
|
15
|
-
linebreak-style:
|
|
16
|
-
- error
|
|
17
|
-
- unix
|
|
18
|
-
quotes:
|
|
19
|
-
- error
|
|
20
|
-
- single
|
|
21
|
-
semi:
|
|
22
|
-
- off
|
|
23
|
-
no-unused-vars:
|
|
24
|
-
- warn
|
|
25
|
-
- args: none
|
|
26
|
-
no-empty:
|
|
27
|
-
- warn
|
|
28
|
-
no-trailing-spaces:
|
|
29
|
-
- error
|
|
30
|
-
|
|
31
|
-
root: true
|
package/rollup.config.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import {nodeResolve} from '@rollup/plugin-node-resolve'
|
|
2
|
-
import commonjs from '@rollup/plugin-commonjs'
|
|
3
|
-
import json from '@rollup/plugin-json'
|
|
4
|
-
import {readFileSync} from 'fs';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function r2ExplorerPlugin() {
|
|
8
|
-
return {
|
|
9
|
-
name: 'custom',
|
|
10
|
-
resolveId: (id) => {
|
|
11
|
-
if (id.startsWith('explorer:')) {
|
|
12
|
-
return id
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
load: async (id) => {
|
|
16
|
-
if (id.startsWith('explorer:')) {
|
|
17
|
-
const path = id.replace('explorer:', '')
|
|
18
|
-
|
|
19
|
-
const fileData = readFileSync(`./spa/${path}`);
|
|
20
|
-
return `export default "${fileData.toString('base64')}";`
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export default {
|
|
27
|
-
input: 'src/index.js',
|
|
28
|
-
cache: false,
|
|
29
|
-
output: {
|
|
30
|
-
format: 'cjs',
|
|
31
|
-
file: 'dist/index.js',
|
|
32
|
-
sourcemap: false
|
|
33
|
-
},
|
|
34
|
-
plugins: [
|
|
35
|
-
r2ExplorerPlugin(),
|
|
36
|
-
commonjs(),
|
|
37
|
-
json(),
|
|
38
|
-
nodeResolve({browser: true}),
|
|
39
|
-
]
|
|
40
|
-
}
|
package/spa/favicon.png
DELETED
|
Binary file
|
package/spa/index.html
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" type="image/png" href="/favicon.png"/><title>r2-explorer-spa</title><script defer="defer" src="/js/app.js"></script></head><body><noscript><strong>We're sorry but r2-explorer-spa doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|