0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

2
web/node_modules/find-root/.npmignore generated vendored Normal file
View file

@ -0,0 +1,2 @@
node_modules
.DS_Store

10
web/node_modules/find-root/.travis.yml generated vendored Normal file
View file

@ -0,0 +1,10 @@
language: node_js
branches:
only:
- master
dist: trusty
node_js:
- 8
- 6
- 4
sudo: false

7
web/node_modules/find-root/LICENSE.md generated vendored Normal file
View file

@ -0,0 +1,7 @@
Copyright © 2017 jsdnxx
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:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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.

69
web/node_modules/find-root/README.md generated vendored Normal file
View file

@ -0,0 +1,69 @@
# find-root
recursively find the closest package.json
[![Build Status](https://travis-ci.org/js-n/find-root.svg?branch=master)](https://travis-ci.org/js-n/find-root)
## usage
Say you want to check if the directory name of a project matches its
module name in package.json:
```js
const path = require('path')
const findRoot = require('find-root')
// from a starting directory, recursively search for the nearest
// directory containing package.json
const root = findRoot('/Users/jsdnxx/Code/find-root/tests')
// => '/Users/jsdnxx/Code/find-root'
const dirname = path.basename(root)
console.log('is it the same?')
console.log(dirname === require(path.join(root, 'package.json')).name)
```
You can also pass in a custom check function (by default, it checks for the
existence of `package.json` in a directory). In this example, we traverse up
to find the root of a git repo:
```js
const fs = require('fs')
const gitRoot = findRoot('/Users/jsdnxx/Code/find-root/tests', function (dir) {
return fs.existsSync(path.resolve(dir, '.git'))
})
```
## api
### `findRoot: (startingPath : string, check?: (dir: string) => boolean) => string`
Returns the path for the nearest directory to `startingPath` containing
a `package.json` file, eg `/foo/module`.
If `check` is provided, returns the path for the closest parent directory
where `check` returns true.
Throws an error if no `package.json` is found at any level in the
`startingPath`.
## installation
```sh
> npm install find-root
```
## running the tests
From package root:
```sh
> npm install
> npm test
```
## contributors
- jsdnxx
## license
MIT. (c) 2017 jsdnxx

31
web/node_modules/find-root/index.js generated vendored Normal file
View file

@ -0,0 +1,31 @@
var path = require('path')
var fs = require('fs')
function defaultCheck (dir) {
return fs.existsSync(path.join(dir, 'package.json'))
}
function findRoot (start, check) {
start = start || module.parent.filename
check = check || defaultCheck
if (typeof start === 'string') {
if (start[start.length - 1] !== path.sep) {
start += path.sep
}
start = start.split(path.sep)
}
if (!start.length) {
throw new Error('package.json not found in path')
}
start.pop()
var dir = start.join(path.sep)
try {
if (check(dir)) {
return dir
}
} catch (e) {}
return findRoot(start, check)
}
module.exports = findRoot

30
web/node_modules/find-root/package.json generated vendored Normal file
View file

@ -0,0 +1,30 @@
{
"name": "find-root",
"author": "jsdnxx",
"version": "1.1.0",
"description": "find the closest package.json",
"keywords": [
"fs",
"get",
"find",
"closest",
"package",
"module",
"base",
"root"
],
"main": "index.js",
"scripts": {
"pretest": "standard",
"test": "mocha"
},
"repository": "git@github.com:js-n/find-root.git",
"license": "MIT",
"readmeFilename": "README.md",
"devDependencies": {
"chai": "^4.0.2",
"mocha": "^3.4.2",
"moquire": "^1.5.5",
"standard": "^10.0.2"
}
}

61
web/node_modules/find-root/test/test.js generated vendored Normal file
View file

@ -0,0 +1,61 @@
/* globals describe, it */
var chai = require('chai')
chai.should()
var expect = chai.expect
var moquire = require('moquire')
var MODULE = '../'
describe('find-root', function () {
it('recursively looks for package.json', function () {
var checked = []
var fs = {
existsSync: function (path) {
checked.push(path)
return path === '/foo/package.json'
}
}
var findRoot = moquire(MODULE, {fs: fs})
findRoot('/foo/bar/baz')
.should.equal('/foo')
checked.should.deep.equal([
'/foo/bar/baz/package.json',
'/foo/bar/package.json',
'/foo/package.json'
])
})
it('can take a custom check argument', function () {
var checked = []
var findRoot = require(MODULE)
findRoot('/foo/bar/baz', function (dir) {
checked.push(dir)
return dir === '/foo/bar'
})
.should.equal('/foo/bar')
checked.should.deep.equal([
'/foo/bar/baz',
'/foo/bar'
])
})
it('throws if not found', function () {
var fs = {
statSync: function (path) {
throw new Error()
}
}
var findRoot = moquire(MODULE, {fs: fs})
expect(function () {
findRoot('/foo/bar/baz/')
}).to.throw('not found')
})
})