WIP - add extractor, generate snippet_data

This commit is contained in:
Stefan Fejes
2019-08-20 15:52:05 +02:00
parent 88084d3d30
commit cc8f1d8a7a
37396 changed files with 4588842 additions and 133 deletions

32
node_modules/find-cache-dir/index.js generated vendored Normal file
View File

@ -0,0 +1,32 @@
'use strict';
const path = require('path');
const commonDir = require('commondir');
const pkgDir = require('pkg-dir');
const makeDir = require('make-dir');
module.exports = (options = {}) => {
const {name} = options;
let directory = options.cwd;
if (options.files) {
directory = commonDir(directory, options.files);
} else {
directory = directory || process.cwd();
}
directory = pkgDir.sync(directory);
if (directory) {
directory = path.join(directory, 'node_modules', '.cache', name);
if (directory && options.create) {
makeDir.sync(directory);
}
if (options.thunk) {
return (...arguments_) => path.join(directory, ...arguments_);
}
}
return directory;
};

9
node_modules/find-cache-dir/license generated vendored Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) James Talmage <james@talmage.io> (github.com/jamestalmage)
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.

75
node_modules/find-cache-dir/package.json generated vendored Normal file
View File

@ -0,0 +1,75 @@
{
"_from": "find-cache-dir@^2.0.0",
"_id": "find-cache-dir@2.1.0",
"_inBundle": false,
"_integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==",
"_location": "/find-cache-dir",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "find-cache-dir@^2.0.0",
"name": "find-cache-dir",
"escapedName": "find-cache-dir",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/babel-loader",
"/terser-webpack-plugin"
],
"_resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz",
"_shasum": "8d0f94cd13fe43c6c7c261a0d86115ca918c05f7",
"_spec": "find-cache-dir@^2.0.0",
"_where": "/Users/stefanfejes/Projects/30-seconds-of-python-code/node_modules/babel-loader",
"bugs": {
"url": "https://github.com/avajs/find-cache-dir/issues"
},
"bundleDependencies": false,
"dependencies": {
"commondir": "^1.0.1",
"make-dir": "^2.0.0",
"pkg-dir": "^3.0.0"
},
"deprecated": false,
"description": "Finds the common standard cache directory",
"devDependencies": {
"ava": "^1.3.1",
"coveralls": "^3.0.3",
"del": "^4.0.0",
"nyc": "^13.3.0",
"xo": "^0.24.0"
},
"engines": {
"node": ">=6"
},
"files": [
"index.js"
],
"homepage": "https://github.com/avajs/find-cache-dir#readme",
"keywords": [
"cache",
"directory",
"dir",
"caching",
"find",
"search"
],
"license": "MIT",
"name": "find-cache-dir",
"nyc": {
"reporter": [
"lcov",
"text"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/avajs/find-cache-dir.git"
},
"scripts": {
"test": "xo && nyc ava"
},
"version": "2.1.0"
}

116
node_modules/find-cache-dir/readme.md generated vendored Normal file
View File

@ -0,0 +1,116 @@
# find-cache-dir [![Build Status](https://travis-ci.org/avajs/find-cache-dir.svg?branch=master)](https://travis-ci.org/avajs/find-cache-dir) [![Coverage Status](https://coveralls.io/repos/github/avajs/find-cache-dir/badge.svg?branch=master)](https://coveralls.io/github/avajs/find-cache-dir?branch=master)
> Finds the common standard cache directory
The [`nyc`](https://github.com/istanbuljs/nyc) and [`AVA`](https://ava.li) projects decided to standardize on a common directory structure for storing cache information:
```sh
# nyc
./node_modules/.cache/nyc
# ava
./node_modules/.cache/ava
# your-module
./node_modules/.cache/your-module
```
This module makes it easy to correctly locate the cache directory according to this shared spec. If this pattern becomes ubiquitous, clearing the cache for multiple dependencies becomes easy and consistent:
```
rm -rf ./node_modules/.cache
```
If you decide to adopt this pattern, please file a PR adding your name to the list of adopters below.
## Install
```
$ npm install find-cache-dir
```
## Usage
```js
const findCacheDir = require('find-cache-dir');
findCacheDir({name: 'unicorns'});
//=> '/user/path/node-modules/.cache/unicorns'
```
## API
### findCacheDir([options])
Finds the cache directory using the supplied options. The algorithm tries to find a `package.json` file, searching every parent directory of the `cwd` specified (or implied from other options). It returns a `string` containing the absolute path to the cache directory, or `null` if `package.json` was never found.
#### options
Type: `Object`
##### name
*Required*<br>
Type: `string`
Should be the same as your project name in `package.json`.
##### files
Type: `string[]` `string`
An array of files that will be searched for a common parent directory. This common parent directory will be used in lieu of the `cwd` option below.
##### cwd
Type: `string`<br>
Default `process.cwd()`
Directory to start searching for a `package.json` from.
##### create
Type: `boolean`<br>
Default `false`
If `true`, the directory will be created synchronously before returning.
##### thunk
Type: `boolean`<br>
Default `false`
If `true`, this modifies the return type to be a function that is a thunk for `path.join(theFoundCacheDirectory)`.
```js
const thunk = findCacheDir({name: 'foo', thunk: true});
thunk();
//=> '/some/path/node_modules/.cache/foo'
thunk('bar.js')
//=> '/some/path/node_modules/.cache/foo/bar.js'
thunk('baz', 'quz.js')
//=> '/some/path/node_modules/.cache/foo/baz/quz.js'
```
This is helpful for actually putting actual files in the cache!
## Adopters
- [`AVA`](https://ava.li)
- [`nyc`](https://github.com/istanbuljs/nyc)
- [`babel-loader`](https://github.com/babel/babel-loader)
- [`eslint-loader`](https://github.com/MoOx/eslint-loader)
- [`Phenomic`](https://phenomic.io)
- [`javascripthon-loader`](https://github.com/Beg-in/javascripthon-loader)
## License
MIT