Skip to content

Commit 55c258c

Browse files
committed
Initial commit
0 parents  commit 55c258c

File tree

15 files changed

+1119
-0
lines changed

15 files changed

+1119
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
dist
3+
package-lock.json
4+
coverage
5+
junit
6+
*-0.0.0.tgz

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"printWidth": 120,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"trailingComma": "es5",
7+
"bracketSpacing": true
8+
}

LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2018 wmhilton
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# isomorphic-pgp
2+
3+
A lightweight library for creating and verifying OpenPGP signatures
4+
5+
## Motivation
6+
7+
PGP is the cryptographic standard used to sign git commits, and I wanted to provide `isomorphic-git` users a way
8+
to tap into that power without sacrificing bundle size or worrying about LGPL restrictions.
9+
So I wrote an entirely new JavaScript library with that narrow use case in mind.
10+
11+
## IMPORTANT!!!
12+
13+
Please read and understand the limitations of the [`sign-and-verify`](https://github.com/wmhilton/isomorphic-pgp/tree/master/src/sign-and-verify) module before using it.
14+
15+
## Comparison with other libraries
16+
17+
This library does not implement encryption or decryption - only signing and verifying signatures.
18+
19+
| | Size | License | Sign | Verify | Encrypt | Decrypt |
20+
|---|------|---------|------|--------|---------|---------|
21+
| isomorphic-pgp | [~17 kb](https://bundlephobia.com/result?p=@isomorphic-git/[email protected]) | MIT | 🗹 | 🗹 |||
22+
| OpenPGP.js | [~170 kb](https://bundlephobia.com/[email protected]) | LGPL | 🗹 | 🗹 | 🗹 | 🗹 |
23+
| kbpgp | [~160 kb](https://bundlephobia.com/[email protected]) | BSD | 🗹 | 🗹 | 🗹 | 🗹 |
24+
25+
## Usage
26+
27+
See individual READMEs for each package:
28+
29+
- [parser](https://github.com/wmhilton/isomorphic-pgp/tree/master/src/parser)
30+
- [util](https://github.com/wmhilton/isomorphic-pgp/tree/master/src/util)
31+
- [sign-and-verify](https://github.com/wmhilton/isomorphic-pgp/tree/master/src/sign-and-verify)
32+
- [generate](https://github.com/wmhilton/isomorphic-pgp/tree/master/src/generate)
33+
34+
## License
35+
36+
MIT

azure-pipelines.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Node.js
2+
# Build a general Node.js application with npm.
3+
# Add steps that analyze code, save build artifacts, deploy, and more:
4+
# https://docs.microsoft.com/vsts/pipelines/languages/javascript
5+
jobs:
6+
- job: Linux
7+
8+
pool:
9+
vmImage: 'Ubuntu 16.04'
10+
11+
steps:
12+
- task: NodeTool@0
13+
inputs:
14+
versionSpec: '8.x'
15+
displayName: 'Install Node.js'
16+
17+
- script: npm ci
18+
displayName: 'Install dependencies'
19+
20+
- script: npm test
21+
displayName: 'Run tests'
22+
env:
23+
BROWSER_STACK_ACCESS_KEY: $(BROWSER_STACK_ACCESS_KEY)
24+
BROWSER_STACK_USERNAME: $(BROWSER_STACK_USERNAME)
25+
BUNDLESIZE_GITHUB_TOKEN: $(BUNDLESIZE_GITHUB_TOKEN)
26+
SAUCE_ACCESS_KEY: $(SAUCE_ACCESS_KEY)
27+
SAUCE_USERNAME: $(SAUCE_USERNAME)
28+
TEST_BROWSERS: 'ChromeHeadlessNoSandbox,FirefoxHeadless,sl_edge,sl_safari,sl_ios_safari,sl_android_chrome'
29+
30+
- task: PublishTestResults@2
31+
displayName: 'Save test results'
32+
condition: succeededOrFailed()
33+
inputs:
34+
testResultsFormat: JUnit
35+
testResultsFiles: '$(System.DefaultWorkingDirectory)/junit/*.xml'
36+
37+
- task: PublishCodeCoverageResults@1
38+
displayName: 'Save code coverage'
39+
condition: and(succeededOrFailed(), ne(variables['system.pullrequest.isfork'], true))
40+
inputs:
41+
codeCoverageTool: Cobertura
42+
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml'
43+
reportDirectory: '$(System.DefaultWorkingDirectory)/coverage/lcov-report'
44+
45+
- script: npm pack
46+
displayName: 'Prepare installable tarball'
47+
condition: succeededOrFailed()
48+
49+
- task: PublishBuildArtifacts@1
50+
displayName: 'Save npm-tarball.tgz'
51+
condition: and(succeededOrFailed(), ne(variables['system.pullrequest.isfork'], true))
52+
inputs:
53+
artifactName: 'npm-tarball.tgz'
54+
PathtoPublish: '$(System.DefaultWorkingDirectory)/isomorphic-git-0.0.0-development.tgz'
55+
56+
- task: PublishBuildArtifacts@1
57+
displayName: 'Save bundle.umd.min.js'
58+
condition: and(succeededOrFailed(), ne(variables['system.pullrequest.isfork'], true))
59+
inputs:
60+
artifactName: 'bundle.umd.min.js'
61+
PathtoPublish: '$(System.DefaultWorkingDirectory)/dist/bundle.umd.min.js'
62+
63+
- script: npm run semantic-release
64+
displayName: 'Publish to npm'
65+
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
66+
env:
67+
GH_TOKEN: $(GITHUB_TOKEN)
68+
NPM_TOKEN: $(Npm.Token)
69+
TWITTER_ACCESS_TOKEN_SECRET: $(TWITTER_ACCESS_TOKEN_SECRET)
70+
TWITTER_CONSUMER_SECRET: $(TWITTER_CONSUMER_SECRET)

karma.conf.js

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
// Karma configuration
2+
process.env.CHROME_BIN = require('puppeteer').executablePath()
3+
const path = require('path')
4+
const webpack = require('webpack')
5+
6+
const REPO = process.env.BUILD_REPOSITORY_NAME
7+
const ISSUE =
8+
process.env.SYSTEM_PULLREQUEST_PULLREQUESTNUMBER ||
9+
process.env.SYSTEM_PULLREQUEST_PULLREQUESTID
10+
const COMMIT = process.env.BUILD_SOURCEVERSION
11+
12+
module.exports = function (config) {
13+
const options = {
14+
// start these browsers
15+
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
16+
browsers: [],
17+
// base path that will be used to resolve all patterns (eg. files, exclude)
18+
basePath: '',
19+
// frameworks to use
20+
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
21+
frameworks: ['jasmine'],
22+
// list of files / patterns to load in the browser
23+
files: [
24+
'src/**/*.spec.js'
25+
],
26+
// list of files to exclude
27+
// exclude: [
28+
// '**/node_modules/**',
29+
// ],
30+
// preprocess matching files before serving them to the browser
31+
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
32+
preprocessors: {
33+
'src/**/*.spec.js': ['webpack']
34+
},
35+
// web server port
36+
port: 9876,
37+
// enable / disable colors in the output (reporters and logs)
38+
colors: true,
39+
// Increase timeouts since some actions take quite a while.
40+
browserNoActivityTimeout: 4 * 60 * 1000, // default 10000
41+
// https://support.saucelabs.com/hc/en-us/articles/225104707-Karma-Tests-Disconnect-Particularly-When-Running-Tests-on-Safari
42+
browserDisconnectTimeout: 10000, // default 2000
43+
browserDisconnectTolerance: 0, // default 0
44+
captureTimeout: 4 * 60 * 1000, // default 60000
45+
// SauceLabs browsers
46+
customLaunchers: {
47+
XXXsl_chrome: {
48+
base: 'SauceLabs',
49+
browserName: 'chrome',
50+
extendedDebugging: true
51+
},
52+
sl_firefox: {
53+
base: 'SauceLabs',
54+
browserName: 'firefox'
55+
},
56+
sl_edge: {
57+
base: 'SauceLabs',
58+
browserName: 'MicrosoftEdge'
59+
},
60+
sl_safari: {
61+
base: 'SauceLabs',
62+
browserName: 'safari'
63+
},
64+
sl_ios_safari: {
65+
base: 'SauceLabs',
66+
deviceName: 'iPhone X Simulator',
67+
platformName: 'iOS',
68+
platformVersion: '11.2',
69+
browserName: 'Safari',
70+
appiumVersion: '1.7.2'
71+
},
72+
sl_android_chrome: {
73+
base: 'SauceLabs',
74+
deviceName: 'Android GoogleAPI Emulator',
75+
platformName: 'Android',
76+
platformVersion: '7.1',
77+
browserName: 'Chrome',
78+
appiumVersion: '1.7.2'
79+
},
80+
FirefoxHeadless: {
81+
base: 'Firefox',
82+
flags: ['-headless']
83+
},
84+
ChromeHeadlessNoSandbox: {
85+
base: 'ChromeHeadless',
86+
flags: ['--no-sandbox']
87+
}
88+
},
89+
sauceLabs: {
90+
// Since tags aren't being sent correctly, I'm going to stick the branch name in here.
91+
testName: `${REPO} / ${ISSUE} / ${COMMIT}`,
92+
// Note: I added the Date.now() bit so that when I can click "Restart" on a Travis job,
93+
// Sauce Labs does not simply append new test results to the old set that failed, which
94+
// convinces karma that it failed again and always.
95+
build: process.env.BUILD_BUILDID + '-' + Date.now(),
96+
// Note: it does not appear that tags are being sent correctly.
97+
tags: [ISSUE],
98+
recordScreenshots: false,
99+
recordVideo: false,
100+
public: 'public restricted'
101+
},
102+
concurrency: 5,
103+
// Continuous Integration mode
104+
// if true, Karma captures browsers, runs the tests and exits
105+
singleRun: true,
106+
// test results reporter to use
107+
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
108+
reporters: ['verbose', 'junit'],
109+
junitReporter: {
110+
outputDir: './junit'
111+
},
112+
webpack: {
113+
mode: 'development',
114+
devtool: 'inline-source-map',
115+
},
116+
plugins: [
117+
'karma-chrome-launcher',
118+
'karma-edge-launcher',
119+
'karma-safari-launcher',
120+
'karma-firefox-launcher',
121+
'karma-jasmine',
122+
'karma-junit-reporter',
123+
'karma-sauce-launcher',
124+
'karma-verbose-reporter',
125+
'karma-webpack',
126+
]
127+
}
128+
129+
if (!process.env.SAUCE_USERNAME) {
130+
console.log(
131+
'Skipping SauceLabs tests because SAUCE_USERNAME environment variable is not set.'
132+
)
133+
} else if (!process.env.SAUCE_ACCESS_KEY) {
134+
console.log(
135+
'Skipping SauceLabs tests because SAUCE_ACCESS_KEY environment variable is not set.'
136+
)
137+
} else {
138+
options.reporters.push('saucelabs')
139+
}
140+
141+
if (process.env.TEST_BROWSERS) {
142+
options.browsers = process.env.TEST_BROWSERS.split(',')
143+
} else {
144+
options.browsers.push('ChromeHeadlessNoSandbox')
145+
options.browsers.push('FirefoxHeadless')
146+
options.browsers.push('Edge')
147+
}
148+
149+
console.log('running with browsers:', options.browsers)
150+
151+
if (!process.env.CI) {
152+
// Continuous Integration mode
153+
// if true, Karma captures browsers, runs the tests and exits
154+
options.singleRun = false
155+
// enable / disable watching file and executing tests whenever any file changes
156+
options.autoWatch = true
157+
}
158+
159+
config.set(options)
160+
}

package.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"publishConfig": {
3+
"access": "public"
4+
},
5+
"name": "@isomorphic-git/idb-fs",
6+
"version": "0.0.0",
7+
"description": "A lean and fast 'fs' for the browser",
8+
"main": "index.js",
9+
"scripts": {
10+
"test": "karma start --single-run"
11+
},
12+
"dependencies": {
13+
"idb-keyval": "3.1.0",
14+
"isomorphic-textencoder": "1.0.1",
15+
"just-debounce-it": "1.1.0",
16+
"just-once": "1.1.0",
17+
"print-tree": "0.1.5"
18+
},
19+
"devDependencies": {
20+
"karma": "^3.1.1",
21+
"karma-chrome-launcher": "^2.2.0",
22+
"karma-edge-launcher": "^0.4.2",
23+
"karma-firefox-launcher": "^1.1.0",
24+
"karma-jasmine": "^2.0.1",
25+
"karma-junit-reporter": "^1.2.0",
26+
"karma-safari-launcher": "^1.0.0",
27+
"karma-sauce-launcher": "^1.2.0",
28+
"karma-verbose-reporter": "0.0.6",
29+
"karma-webpack": "^3.0.5",
30+
"prettier": "^1.15.3",
31+
"puppeteer": "^1.10.0",
32+
"webpack": "^4.26.0"
33+
},
34+
"repository": {
35+
"type": "git",
36+
"url": "git+https://github.com/isomorphic-git/idb-fs.git"
37+
},
38+
"files": [
39+
"**/*.js",
40+
"!__tests__",
41+
"!coverage"
42+
],
43+
"keywords": [
44+
"browser",
45+
"fs",
46+
"indexeddb",
47+
"idb"
48+
],
49+
"author": "William Hilton <[email protected]>",
50+
"license": "MIT",
51+
"bugs": {
52+
"url": "https://github.com/isomorphic-git/idb-fs/issues"
53+
},
54+
"homepage": "https://github.com/isomorphic-git/idb-fs#readme"
55+
}

0 commit comments

Comments
 (0)