@leogps/file-uploader 2.0.0 → 2.0.1
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/.github/workflows/publish.yml +31 -0
- package/Dockerfile +18 -0
- package/README.md +33 -92
- package/package.json +9 -2
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Publish NPM
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
id-token: write
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build-and-publish:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Use Node.js
|
|
19
|
+
uses: actions/setup-node@v6
|
|
20
|
+
with:
|
|
21
|
+
node-version: '24'
|
|
22
|
+
registry-url: 'https://registry.npmjs.org'
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: npm ci --include=dev
|
|
26
|
+
|
|
27
|
+
- name: Build
|
|
28
|
+
run: npm run clean && npm run package
|
|
29
|
+
|
|
30
|
+
- name: Publish
|
|
31
|
+
run: npm publish
|
package/Dockerfile
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
FROM node:24-alpine as build
|
|
2
|
+
|
|
3
|
+
WORKDIR /srv/file-uploader
|
|
4
|
+
|
|
5
|
+
COPY package.json package-lock.json ./
|
|
6
|
+
RUN npm ci --production
|
|
7
|
+
|
|
8
|
+
COPY . .
|
|
9
|
+
RUN npm run clean && npm run package
|
|
10
|
+
|
|
11
|
+
FROM node:24-alpine
|
|
12
|
+
WORKDIR /srv/file-uploader
|
|
13
|
+
VOLUME /public
|
|
14
|
+
|
|
15
|
+
COPY --from=build /srv/file-uploader/dist ./dist
|
|
16
|
+
|
|
17
|
+
EXPOSE 8080
|
|
18
|
+
ENTRYPOINT ["./dist/index.js", "-p", "8080", "-l", "/public"]
|
package/README.md
CHANGED
|
@@ -1,34 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @leogps/file-uploader
|
|
2
2
|
|
|
3
3
|
Zero-config command-line tool to run a file-uploader server. Files can be uploaded typically from a browser.
|
|
4
4
|
|
|
5
5
|
Both Server and Client are written in JS.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
* [Clean](#clean)
|
|
11
|
-
* [Build](#build-prod)
|
|
12
|
-
* [Serve](#serve-prod)
|
|
13
|
-
* [Configuration Options](#configuration-options)
|
|
14
|
-
* [Run in Development Mode](#run-in-development-mode)
|
|
15
|
-
* [Complete list of commands](#complete-list-of-commands-bunnpm)
|
|
9
|
+
#### Running on-demand:
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
Using `npx` you can run the script without installing it first:
|
|
18
12
|
|
|
19
|
-
|
|
13
|
+
npx @leogps/file-uploader [path] [options
|
|
20
14
|
|
|
21
|
-
|
|
15
|
+
#### Globally via `npm`
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
npm install --global @leogps/file-uploader
|
|
24
18
|
|
|
25
|
-
|
|
19
|
+
#### As a dependency in your `npm` package:
|
|
26
20
|
|
|
27
|
-
|
|
21
|
+
npm install @leogps/file-uploader
|
|
28
22
|
|
|
29
|
-
|
|
23
|
+
#### Using Docker
|
|
30
24
|
|
|
31
|
-
|
|
25
|
+
Note: a public image is not provided currently, but you can build one yourself
|
|
26
|
+
with the provided Dockerfile.
|
|
27
|
+
|
|
28
|
+
1. Create an image
|
|
29
|
+
```
|
|
30
|
+
docker build -t my-image .
|
|
31
|
+
```
|
|
32
|
+
2. Run a container
|
|
33
|
+
```
|
|
34
|
+
docker run -p 8080:8080 -v "${pwd}:/public" my-image
|
|
35
|
+
```
|
|
36
|
+
In the example above we're serving the directory `./` (working directory).
|
|
37
|
+
If you wanted to serve `./test` you'd replace `${pwd}` with `${pwd}/test`.
|
|
38
|
+
|
|
39
|
+
### Usage
|
|
40
|
+
|
|
41
|
+
file-uploader [path] [options]
|
|
32
42
|
|
|
33
43
|
--version Show version number [boolean]
|
|
34
44
|
-l, --upload_location upload location
|
|
@@ -36,80 +46,11 @@ Both Server and Client are written in JS.
|
|
|
36
46
|
-p, --port server port [number]
|
|
37
47
|
--help Show help [boolean]
|
|
38
48
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
npm run start # or bun start
|
|
42
|
-
|
|
43
|
-
## Complete list of commands (bun|npm)
|
|
44
|
-
|
|
45
|
-
* `bun|npm run clean`
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
rimraf dist
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
* `bun|npm run precompile`
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
eslint -c .eslintrc.js --fix --ext .ts src src-client
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
* `bun|npm run compile-server`
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
./node_modules/webpack-cli/bin/cli.js --config webpack.config.js
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
* `bun|npm run compile-client-dev`
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
./node_modules/webpack-cli/bin/cli.js --config webpack-client.dev.js
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
* `bun|npm run compile-client-prod`
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
./node_modules/webpack-cli/bin/cli.js --config webpack-client.prod.js
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
* `bun|npm run compile-dev`
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
npm run precompile && npm run compile-server && npm run compile-client-dev
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
* `bun|npm run build-dev`
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
npm run compile-dev
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
* `bun|npm run compile-prod`
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
npm run precompile && npm run compile-server && npm run compile-client-prod
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
* `bun|npm run build-prod`
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
npm run compile-prod
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
* `bun|npm run dev:server`
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
npm run build:server:once && npm-run-all --parallel nodemon:prod watch:client
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
* `bun|npm run start`
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
npm run build-dev && node dist/index.js
|
|
109
|
-
```
|
|
49
|
+
# Development
|
|
110
50
|
|
|
111
|
-
|
|
51
|
+
Checkout this repository locally, then:
|
|
112
52
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
53
|
+
```sh
|
|
54
|
+
$ npm i
|
|
55
|
+
$ npm start
|
|
56
|
+
```
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leogps/file-uploader",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Facilitates file uploader server.",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/leogps/file-uploader"
|
|
9
|
+
},
|
|
6
10
|
"bin": {
|
|
7
11
|
"file-uploader": "./dist/index.js"
|
|
8
12
|
},
|
|
@@ -42,7 +46,10 @@
|
|
|
42
46
|
"client"
|
|
43
47
|
],
|
|
44
48
|
"author": "Paul Gundarapu",
|
|
45
|
-
"
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/leogps/file-uploader/issues"
|
|
51
|
+
},
|
|
52
|
+
"license": "MIT",
|
|
46
53
|
"dependencies": {
|
|
47
54
|
"@fortawesome/fontawesome-free": "^5.15.4",
|
|
48
55
|
"bulma": "^1.0.4",
|