mirror of
https://github.com/SamEyeBam/animate.git
synced 2025-12-13 09:24:53 +00:00
larry babby and threejs for glsl
This commit is contained in:
21
webGl/my-threejs-test/node_modules/@parcel/watcher/LICENSE
generated
vendored
Normal file
21
webGl/my-threejs-test/node_modules/@parcel/watcher/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-present Devon Govett
|
||||
|
||||
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.
|
||||
135
webGl/my-threejs-test/node_modules/@parcel/watcher/README.md
generated
vendored
Normal file
135
webGl/my-threejs-test/node_modules/@parcel/watcher/README.md
generated
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
# @parcel/watcher
|
||||
|
||||
A native C++ Node module for querying and subscribing to filesystem events. Used by [Parcel 2](https://github.com/parcel-bundler/parcel).
|
||||
|
||||
## Features
|
||||
|
||||
- **Watch** - subscribe to realtime recursive directory change notifications when files or directories are created, updated, or deleted.
|
||||
- **Query** - performantly query for historical change events in a directory, even when your program is not running.
|
||||
- **Native** - implemented in C++ for performance and low-level integration with the operating system.
|
||||
- **Cross platform** - includes backends for macOS, Linux, Windows, FreeBSD, and Watchman.
|
||||
- **Performant** - events are throttled in C++ so the JavaScript thread is not overwhelmed during large filesystem changes (e.g. `git checkout` or `npm install`).
|
||||
- **Scalable** - tens of thousands of files can be watched or queried at once with good performance.
|
||||
|
||||
## Example
|
||||
|
||||
```javascript
|
||||
const watcher = require('@parcel/watcher');
|
||||
const path = require('path');
|
||||
|
||||
// Subscribe to events
|
||||
let subscription = await watcher.subscribe(process.cwd(), (err, events) => {
|
||||
console.log(events);
|
||||
});
|
||||
|
||||
// later on...
|
||||
await subscription.unsubscribe();
|
||||
|
||||
// Get events since some saved snapshot in the past
|
||||
let snapshotPath = path.join(process.cwd(), 'snapshot.txt');
|
||||
let events = await watcher.getEventsSince(process.cwd(), snapshotPath);
|
||||
|
||||
// Save a snapshot for later
|
||||
await watcher.writeSnapshot(process.cwd(), snapshotPath);
|
||||
```
|
||||
|
||||
## Watching
|
||||
|
||||
`@parcel/watcher` supports subscribing to realtime notifications of changes in a directory. It works recursively, so changes in sub-directories will also be emitted.
|
||||
|
||||
Events are throttled and coalesced for performance during large changes like `git checkout` or `npm install`, and a single notification will be emitted with all of the events at the end.
|
||||
|
||||
Only one notification will be emitted per file. For example, if a file was both created and updated since the last event, you'll get only a `create` event. If a file is both created and deleted, you will not be notifed of that file. Renames cause two events: a `delete` for the old name, and a `create` for the new name.
|
||||
|
||||
```javascript
|
||||
let subscription = await watcher.subscribe(process.cwd(), (err, events) => {
|
||||
console.log(events);
|
||||
});
|
||||
```
|
||||
|
||||
Events have two properties:
|
||||
|
||||
- `type` - the event type: `create`, `update`, or `delete`.
|
||||
- `path` - the absolute path to the file or directory.
|
||||
|
||||
To unsubscribe from change notifications, call the `unsubscribe` method on the returned subscription object.
|
||||
|
||||
```javascript
|
||||
await subscription.unsubscribe();
|
||||
```
|
||||
|
||||
`@parcel/watcher` has the following watcher backends, listed in priority order:
|
||||
|
||||
- [FSEvents](https://developer.apple.com/documentation/coreservices/file_system_events) on macOS
|
||||
- [Watchman](https://facebook.github.io/watchman/) if installed
|
||||
- [inotify](http://man7.org/linux/man-pages/man7/inotify.7.html) on Linux
|
||||
- [ReadDirectoryChangesW](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365465%28v%3Dvs.85%29.aspx) on Windows
|
||||
- [kqueue](https://man.freebsd.org/cgi/man.cgi?kqueue) on FreeBSD, or as an alternative to FSEvents on macOS
|
||||
|
||||
You can specify the exact backend you wish to use by passing the `backend` option. If that backend is not available on the current platform, the default backend will be used instead. See below for the list of backend names that can be passed to the options.
|
||||
|
||||
## Querying
|
||||
|
||||
`@parcel/watcher` also supports querying for historical changes made in a directory, even when your program is not running. This makes it easy to invalidate a cache and re-build only the files that have changed, for example. It can be **significantly** faster than traversing the entire filesystem to determine what files changed, depending on the platform.
|
||||
|
||||
In order to query for historical changes, you first need a previous snapshot to compare to. This can be saved to a file with the `writeSnapshot` function, e.g. just before your program exits.
|
||||
|
||||
```javascript
|
||||
await watcher.writeSnapshot(dirPath, snapshotPath);
|
||||
```
|
||||
|
||||
When your program starts up, you can query for changes that have occurred since that snapshot using the `getEventsSince` function.
|
||||
|
||||
```javascript
|
||||
let events = await watcher.getEventsSince(dirPath, snapshotPath);
|
||||
```
|
||||
|
||||
The events returned are exactly the same as the events that would be passed to the `subscribe` callback (see above).
|
||||
|
||||
`@parcel/watcher` has the following watcher backends, listed in priority order:
|
||||
|
||||
- [FSEvents](https://developer.apple.com/documentation/coreservices/file_system_events) on macOS
|
||||
- [Watchman](https://facebook.github.io/watchman/) if installed
|
||||
- [fts](http://man7.org/linux/man-pages/man3/fts.3.html) (brute force) on Linux and FreeBSD
|
||||
- [FindFirstFile](https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-findfirstfilea) (brute force) on Windows
|
||||
|
||||
The FSEvents (macOS) and Watchman backends are significantly more performant than the brute force backends used by default on Linux and Windows, for example returning results in miliseconds instead of seconds for large directory trees. This is because a background daemon monitoring filesystem changes on those platforms allows us to query cached data rather than traversing the filesystem manually (brute force).
|
||||
|
||||
macOS has good performance with FSEvents by default. For the best performance on other platforms, install [Watchman](https://facebook.github.io/watchman/) and it will be used by `@parcel/watcher` automatically.
|
||||
|
||||
You can specify the exact backend you wish to use by passing the `backend` option. If that backend is not available on the current platform, the default backend will be used instead. See below for the list of backend names that can be passed to the options.
|
||||
|
||||
## Options
|
||||
|
||||
All of the APIs in `@parcel/watcher` support the following options, which are passed as an object as the last function argument.
|
||||
|
||||
- `ignore` - an array of paths or glob patterns to ignore. uses [`is-glob`](https://github.com/micromatch/is-glob) to distinguish paths from globs. glob patterns are parsed with [`micromatch`](https://github.com/micromatch/micromatch) (see [features](https://github.com/micromatch/micromatch#matching-features)).
|
||||
- paths can be relative or absolute and can either be files or directories. No events will be emitted about these files or directories or their children.
|
||||
- glob patterns match on relative paths from the root that is watched. No events will be emitted for matching paths.
|
||||
- `backend` - the name of an explicitly chosen backend to use. Allowed options are `"fs-events"`, `"watchman"`, `"inotify"`, `"kqueue"`, `"windows"`, or `"brute-force"` (only for querying). If the specified backend is not available on the current platform, the default backend will be used instead.
|
||||
|
||||
## WASM
|
||||
|
||||
The `@parcel/watcher-wasm` package can be used in place of `@parcel/watcher` on unsupported platforms. It relies on the Node `fs` module, so in non-Node environments such as browsers, an `fs` polyfill will be needed.
|
||||
|
||||
**Note**: the WASM implementation is significantly less efficient than the native implementations because it must crawl the file system to watch each directory individually. Use the native `@parcel/watcher` package wherever possible.
|
||||
|
||||
```js
|
||||
import {subscribe} from '@parcel/watcher-wasm';
|
||||
|
||||
// Use the module as documented above.
|
||||
subscribe(/* ... */);
|
||||
```
|
||||
|
||||
## Who is using this?
|
||||
|
||||
- [Parcel 2](https://parceljs.org/)
|
||||
- [VSCode](https://code.visualstudio.com/updates/v1_62#_file-watching-changes)
|
||||
- [Tailwind CSS Intellisense](https://github.com/tailwindlabs/tailwindcss-intellisense)
|
||||
- [Gatsby Cloud](https://twitter.com/chatsidhartha/status/1435647412828196867)
|
||||
- [Nx](https://nx.dev)
|
||||
- [Nuxt](https://nuxt.com)
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
49
webGl/my-threejs-test/node_modules/@parcel/watcher/index.d.ts
generated
vendored
Normal file
49
webGl/my-threejs-test/node_modules/@parcel/watcher/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
declare type FilePath = string;
|
||||
declare type GlobPattern = string;
|
||||
|
||||
declare namespace ParcelWatcher {
|
||||
export type BackendType =
|
||||
| 'fs-events'
|
||||
| 'watchman'
|
||||
| 'inotify'
|
||||
| 'windows'
|
||||
| 'brute-force';
|
||||
export type EventType = 'create' | 'update' | 'delete';
|
||||
export interface Options {
|
||||
ignore?: (FilePath|GlobPattern)[];
|
||||
backend?: BackendType;
|
||||
}
|
||||
export type SubscribeCallback = (
|
||||
err: Error | null,
|
||||
events: Event[]
|
||||
) => unknown;
|
||||
export interface AsyncSubscription {
|
||||
unsubscribe(): Promise<void>;
|
||||
}
|
||||
export interface Event {
|
||||
path: FilePath;
|
||||
type: EventType;
|
||||
}
|
||||
export function getEventsSince(
|
||||
dir: FilePath,
|
||||
snapshot: FilePath,
|
||||
opts?: Options
|
||||
): Promise<Event[]>;
|
||||
export function subscribe(
|
||||
dir: FilePath,
|
||||
fn: SubscribeCallback,
|
||||
opts?: Options
|
||||
): Promise<AsyncSubscription>;
|
||||
export function unsubscribe(
|
||||
dir: FilePath,
|
||||
fn: SubscribeCallback,
|
||||
opts?: Options
|
||||
): Promise<void>;
|
||||
export function writeSnapshot(
|
||||
dir: FilePath,
|
||||
snapshot: FilePath,
|
||||
opts?: Options
|
||||
): Promise<FilePath>;
|
||||
}
|
||||
|
||||
export = ParcelWatcher;
|
||||
41
webGl/my-threejs-test/node_modules/@parcel/watcher/index.js
generated
vendored
Normal file
41
webGl/my-threejs-test/node_modules/@parcel/watcher/index.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
const {createWrapper} = require('./wrapper');
|
||||
|
||||
let name = `@parcel/watcher-${process.platform}-${process.arch}`;
|
||||
if (process.platform === 'linux') {
|
||||
const { MUSL, family } = require('detect-libc');
|
||||
if (family === MUSL) {
|
||||
name += '-musl';
|
||||
} else {
|
||||
name += '-glibc';
|
||||
}
|
||||
}
|
||||
|
||||
let binding;
|
||||
try {
|
||||
binding = require(name);
|
||||
} catch (err) {
|
||||
handleError(err);
|
||||
try {
|
||||
binding = require('./build/Release/watcher.node');
|
||||
} catch (err) {
|
||||
handleError(err);
|
||||
try {
|
||||
binding = require('./build/Debug/watcher.node');
|
||||
} catch (err) {
|
||||
handleError(err);
|
||||
throw new Error(`No prebuild or local build of @parcel/watcher found. Tried ${name}. Please ensure it is installed (don't use --no-optional when installing with npm). Otherwise it is possible we don't support your platform yet. If this is the case, please report an issue to https://github.com/parcel-bundler/watcher.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleError(err) {
|
||||
if (err?.code !== 'MODULE_NOT_FOUND') {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
const wrapper = createWrapper(binding);
|
||||
exports.writeSnapshot = wrapper.writeSnapshot;
|
||||
exports.getEventsSince = wrapper.getEventsSince;
|
||||
exports.subscribe = wrapper.subscribe;
|
||||
exports.unsubscribe = wrapper.unsubscribe;
|
||||
48
webGl/my-threejs-test/node_modules/@parcel/watcher/index.js.flow
generated
vendored
Normal file
48
webGl/my-threejs-test/node_modules/@parcel/watcher/index.js.flow
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
// @flow
|
||||
declare type FilePath = string;
|
||||
declare type GlobPattern = string;
|
||||
|
||||
export type BackendType =
|
||||
| 'fs-events'
|
||||
| 'watchman'
|
||||
| 'inotify'
|
||||
| 'windows'
|
||||
| 'brute-force';
|
||||
export type EventType = 'create' | 'update' | 'delete';
|
||||
export interface Options {
|
||||
ignore?: Array<FilePath | GlobPattern>,
|
||||
backend?: BackendType
|
||||
}
|
||||
export type SubscribeCallback = (
|
||||
err: ?Error,
|
||||
events: Array<Event>
|
||||
) => mixed;
|
||||
export interface AsyncSubscription {
|
||||
unsubscribe(): Promise<void>
|
||||
}
|
||||
export interface Event {
|
||||
path: FilePath,
|
||||
type: EventType
|
||||
}
|
||||
declare module.exports: {
|
||||
getEventsSince(
|
||||
dir: FilePath,
|
||||
snapshot: FilePath,
|
||||
opts?: Options
|
||||
): Promise<Array<Event>>,
|
||||
subscribe(
|
||||
dir: FilePath,
|
||||
fn: SubscribeCallback,
|
||||
opts?: Options
|
||||
): Promise<AsyncSubscription>,
|
||||
unsubscribe(
|
||||
dir: FilePath,
|
||||
fn: SubscribeCallback,
|
||||
opts?: Options
|
||||
): Promise<void>,
|
||||
writeSnapshot(
|
||||
dir: FilePath,
|
||||
snapshot: FilePath,
|
||||
opts?: Options
|
||||
): Promise<FilePath>
|
||||
}
|
||||
83
webGl/my-threejs-test/node_modules/@parcel/watcher/package.json
generated
vendored
Normal file
83
webGl/my-threejs-test/node_modules/@parcel/watcher/package.json
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"name": "@parcel/watcher",
|
||||
"version": "2.4.1",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/parcel-bundler/watcher.git"
|
||||
},
|
||||
"description": "A native C++ Node module for querying and subscribing to filesystem events. Used by Parcel 2.",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/parcel"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.js.flow",
|
||||
"index.d.ts",
|
||||
"wrapper.js",
|
||||
"package.json",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"scripts": {
|
||||
"prebuild": "prebuildify --napi --strip --tag-libc",
|
||||
"format": "prettier --write \"./**/*.{js,json,md}\"",
|
||||
"build": "node-gyp rebuild -j 8 --debug --verbose",
|
||||
"test": "mocha"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.0.0"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,json,md}": [
|
||||
"prettier --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"detect-libc": "^1.0.3",
|
||||
"is-glob": "^4.0.3",
|
||||
"micromatch": "^4.0.5",
|
||||
"node-addon-api": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"esbuild": "^0.19.8",
|
||||
"fs-extra": "^10.0.0",
|
||||
"husky": "^7.0.2",
|
||||
"lint-staged": "^11.1.2",
|
||||
"mocha": "^9.1.1",
|
||||
"napi-wasm": "^1.1.0",
|
||||
"prebuildify": "^5.0.1",
|
||||
"prettier": "^2.3.2"
|
||||
},
|
||||
"binary": {
|
||||
"napi_versions": [
|
||||
3
|
||||
]
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@parcel/watcher-darwin-x64": "2.4.1",
|
||||
"@parcel/watcher-darwin-arm64": "2.4.1",
|
||||
"@parcel/watcher-win32-x64": "2.4.1",
|
||||
"@parcel/watcher-win32-arm64": "2.4.1",
|
||||
"@parcel/watcher-win32-ia32": "2.4.1",
|
||||
"@parcel/watcher-linux-x64-glibc": "2.4.1",
|
||||
"@parcel/watcher-linux-x64-musl": "2.4.1",
|
||||
"@parcel/watcher-linux-arm64-glibc": "2.4.1",
|
||||
"@parcel/watcher-linux-arm64-musl": "2.4.1",
|
||||
"@parcel/watcher-linux-arm-glibc": "2.4.1",
|
||||
"@parcel/watcher-android-arm64": "2.4.1",
|
||||
"@parcel/watcher-freebsd-x64": "2.4.1"
|
||||
}
|
||||
}
|
||||
77
webGl/my-threejs-test/node_modules/@parcel/watcher/wrapper.js
generated
vendored
Normal file
77
webGl/my-threejs-test/node_modules/@parcel/watcher/wrapper.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
const path = require('path');
|
||||
const micromatch = require('micromatch');
|
||||
const isGlob = require('is-glob');
|
||||
|
||||
function normalizeOptions(dir, opts = {}) {
|
||||
const { ignore, ...rest } = opts;
|
||||
|
||||
if (Array.isArray(ignore)) {
|
||||
opts = { ...rest };
|
||||
|
||||
for (const value of ignore) {
|
||||
if (isGlob(value)) {
|
||||
if (!opts.ignoreGlobs) {
|
||||
opts.ignoreGlobs = [];
|
||||
}
|
||||
|
||||
const regex = micromatch.makeRe(value, {
|
||||
// We set `dot: true` to workaround an issue with the
|
||||
// regular expression on Linux where the resulting
|
||||
// negative lookahead `(?!(\\/|^)` was never matching
|
||||
// in some cases. See also https://bit.ly/3UZlQDm
|
||||
dot: true,
|
||||
// C++ does not support lookbehind regex patterns, they
|
||||
// were only added later to JavaScript engines
|
||||
// (https://bit.ly/3V7S6UL)
|
||||
lookbehinds: false
|
||||
});
|
||||
opts.ignoreGlobs.push(regex.source);
|
||||
} else {
|
||||
if (!opts.ignorePaths) {
|
||||
opts.ignorePaths = [];
|
||||
}
|
||||
|
||||
opts.ignorePaths.push(path.resolve(dir, value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return opts;
|
||||
}
|
||||
|
||||
exports.createWrapper = (binding) => {
|
||||
return {
|
||||
writeSnapshot(dir, snapshot, opts) {
|
||||
return binding.writeSnapshot(
|
||||
path.resolve(dir),
|
||||
path.resolve(snapshot),
|
||||
normalizeOptions(dir, opts),
|
||||
);
|
||||
},
|
||||
getEventsSince(dir, snapshot, opts) {
|
||||
return binding.getEventsSince(
|
||||
path.resolve(dir),
|
||||
path.resolve(snapshot),
|
||||
normalizeOptions(dir, opts),
|
||||
);
|
||||
},
|
||||
async subscribe(dir, fn, opts) {
|
||||
dir = path.resolve(dir);
|
||||
opts = normalizeOptions(dir, opts);
|
||||
await binding.subscribe(dir, fn, opts);
|
||||
|
||||
return {
|
||||
unsubscribe() {
|
||||
return binding.unsubscribe(dir, fn, opts);
|
||||
},
|
||||
};
|
||||
},
|
||||
unsubscribe(dir, fn, opts) {
|
||||
return binding.unsubscribe(
|
||||
path.resolve(dir),
|
||||
fn,
|
||||
normalizeOptions(dir, opts),
|
||||
);
|
||||
}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user