Skip to content

Commit 52d14f2

Browse files
Merge pull request #2 from mayflower-tech/publish
refactor
2 parents 438b02f + 16fe3b8 commit 52d14f2

21 files changed

+851
-433
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Node.js Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
packages: write
12+
contents: read
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: 16
18+
cache: yarn
19+
registry-url: 'https://registry.npmjs.org'
20+
- run: yarn install --immutable
21+
- run: yarn build
22+
- run: yarn npm publish --tag alpha
23+
env:
24+
YARN_NPM_AUTH_TOKEN: ${{secrets.YARN_NPM_AUTH_TOKEN}}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
.DS_Store
66
node_modules
77
.idea
8+
dist
89

910
# yarn
1011
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@mayflower-tech:registry=https://npm.pkg.github.com

.prettierrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"printWidth": 120
4+
}

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Release
2+
3+
- Change the version in the package.json
4+
- Commit the changes
5+
- Tag last commit with tag `v${version}`
6+
- Push changes and tags
7+
- Create release on github releases with this tag
8+
- Publish it
9+
- Publish workflow should trigger and publish new version

certify.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fi
1919

2020
# Generate Certificate Authority
2121
openssl genrsa -out "tmp/${name}CA.key" 2048 &>/dev/null
22-
openssl req -x509 -config utils/ca.conf -new -nodes -key "tmp/${name}CA.key" -sha256 -days 1825 -out "${name}CA.pem" &>/dev/null
22+
openssl req -x509 -config utils/ca.conf -new -nodes -key "tmp/${name}CA.key" -sha256 -days 825 -out "${name}CA.pem" &>/dev/null
2323

2424
# This is the part that demands root privileges
2525
if [ "$EUID" -eq 0 ] ; then
@@ -36,7 +36,7 @@ openssl genrsa -out "${name}.key" 2048 &>/dev/null
3636
openssl req -new -config utils/ca.conf -key "${name}.key" -out "tmp/${name}.csr" &>/dev/null
3737

3838
# Generate SSL Certificate
39-
openssl x509 -req -in "tmp/${name}.csr" -CA "${name}CA.pem" -CAkey "tmp/${name}CA.key" -CAcreateserial -out "${name}.crt" -days 1825 -sha256 -extfile utils/ssl.conf &>/dev/null
39+
openssl x509 -req -in "tmp/${name}.csr" -CA "${name}CA.pem" -CAkey "tmp/${name}CA.key" -CAcreateserial -out "${name}.crt" -days 825 -sha256 -extfile utils/ssl.conf &>/dev/null
4040

4141
# Cleanup files
4242
rm servorCA.pem servorCA.srl

cli.js

Lines changed: 0 additions & 101 deletions
This file was deleted.

package.json

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,51 @@
11
{
2-
"name": "servor",
3-
"version": "4.0.3",
4-
"description": "A dependency free dev server for single page app development",
5-
"repository": "lukejacksonn/servor",
6-
"main": "./servor.js",
7-
"bin": "./cli.js",
2+
"name": "@mayflower-tech/servor",
3+
"version": "5.0.0-alpha.7",
4+
"description": "A dev server for single page app development",
5+
"repository": "@mayflower-tech/servor",
6+
"publishConfig": {
7+
"access": "public"
8+
},
9+
"type": "commonjs",
10+
"main": "./dist/servor.js",
11+
"bin": "./dist/cli.js",
812
"keywords": [
913
"server",
1014
"https",
1115
"livereload",
1216
"spa"
1317
],
18+
"files": [
19+
"dist/**/*",
20+
"src/**/*"
21+
],
1422
"scripts": {
15-
"start": "sudo node cli tests/example --reload --browse --secure --static --module",
23+
"start": "SWC_NODE_PROJECT=./tsconfig.json node -r @swc-node/register src/cli.ts tests/example index.html 8081 --reload --browse",
24+
"build": "tsc",
1625
"cleanup": "rm -f servor.key servor.crt",
1726
"test": "npm run cleanup && cd tests && node index.js"
1827
},
1928
"author": "Luke Jackson <[email protected]>",
2029
"license": "MIT",
2130
"devDependencies": {
22-
"puppeteer": "^3.0.4"
31+
"@swc-node/register": "^1.6.4",
32+
"@swc/core": "^1.3.53",
33+
"@types/http-proxy": "^1.17.10",
34+
"@types/node": "^18.14.6",
35+
"prettier": "^2.8.7",
36+
"puppeteer": "^3.0.4",
37+
"typescript": "^4.9.5"
2338
},
2439
"dependencies": {
2540
"chokidar": "^3.5.3",
41+
"commander": "^10.0.1",
2642
"http-proxy": "^1.18.1"
2743
},
28-
"packageManager": "[email protected]"
44+
"packageManager": "[email protected]",
45+
"prettier": {
46+
"printWidth": 120,
47+
"singleQuote": true,
48+
"trailingComma": "es5",
49+
"endOfLine": "auto"
50+
}
2951
}

0 commit comments

Comments
 (0)