mirror of
https://github.com/SamEyeBam/animate.git
synced 2025-09-27 22:45:25 +00:00
larry babby and threejs for glsl
This commit is contained in:
21
webGl/my-threejs-test/node_modules/@parcel/reporter-tracer/LICENSE
generated
vendored
Normal file
21
webGl/my-threejs-test/node_modules/@parcel/reporter-tracer/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.
|
112
webGl/my-threejs-test/node_modules/@parcel/reporter-tracer/lib/TracerReporter.js
generated
vendored
Normal file
112
webGl/my-threejs-test/node_modules/@parcel/reporter-tracer/lib/TracerReporter.js
generated
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
function _assert() {
|
||||
const data = _interopRequireDefault(require("assert"));
|
||||
_assert = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _nullthrows() {
|
||||
const data = _interopRequireDefault(require("nullthrows"));
|
||||
_nullthrows = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require("path"));
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _plugin() {
|
||||
const data = require("@parcel/plugin");
|
||||
_plugin = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _chromeTraceEvent() {
|
||||
const data = require("chrome-trace-event");
|
||||
_chromeTraceEvent = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
// We need to maintain some state here to ensure we write to the same output, there should only be one
|
||||
// instance of this reporter (this gets asserted below)
|
||||
let tracer;
|
||||
let writeStream = null;
|
||||
function millisecondsToMicroseconds(milliseconds) {
|
||||
return Math.floor(milliseconds * 1000);
|
||||
}
|
||||
|
||||
// TODO: extract this to utils as it's also used in packages/core/workers/src/WorkerFarm.js
|
||||
function getTimeId() {
|
||||
let now = new Date();
|
||||
return String(now.getFullYear()) + String(now.getMonth() + 1).padStart(2, '0') + String(now.getDate()).padStart(2, '0') + '-' + String(now.getHours()).padStart(2, '0') + String(now.getMinutes()).padStart(2, '0') + String(now.getSeconds()).padStart(2, '0');
|
||||
}
|
||||
var _default = exports.default = new (_plugin().Reporter)({
|
||||
report({
|
||||
event,
|
||||
options,
|
||||
logger
|
||||
}) {
|
||||
let filename;
|
||||
let filePath;
|
||||
switch (event.type) {
|
||||
case 'buildStart':
|
||||
(0, _assert().default)(tracer == null, 'Tracer multiple initialisation');
|
||||
tracer = new (_chromeTraceEvent().Tracer)();
|
||||
filename = `parcel-trace-${getTimeId()}.json`;
|
||||
filePath = _path().default.join(options.projectRoot, filename);
|
||||
(0, _assert().default)(writeStream == null, 'Trace write stream multiple initialisation');
|
||||
logger.info({
|
||||
message: `Writing trace to ${filename}. See https://parceljs.org/features/profiling/#analysing-traces for more information on working with traces.`
|
||||
});
|
||||
writeStream = options.outputFS.createWriteStream(filePath);
|
||||
(0, _nullthrows().default)(tracer).pipe((0, _nullthrows().default)(writeStream));
|
||||
break;
|
||||
case 'trace':
|
||||
// Due to potential race conditions at the end of the build, we ignore any trace events that occur
|
||||
// after we've closed the write stream.
|
||||
if (tracer === null) return;
|
||||
tracer.completeEvent({
|
||||
name: event.name,
|
||||
cat: event.categories,
|
||||
args: event.args,
|
||||
ts: millisecondsToMicroseconds(event.ts),
|
||||
dur: millisecondsToMicroseconds(event.duration),
|
||||
tid: event.tid,
|
||||
pid: event.pid
|
||||
});
|
||||
break;
|
||||
case 'buildSuccess':
|
||||
case 'buildFailure':
|
||||
(0, _nullthrows().default)(tracer).flush();
|
||||
// We explicitly trigger `end` on the writeStream for the trace, then we need to wait for
|
||||
// the `close` event before resolving the promise this report function returns to ensure
|
||||
// that the file has been properly closed and moved from it's temp location before Parcel
|
||||
// shuts down.
|
||||
return new Promise((resolve, reject) => {
|
||||
(0, _nullthrows().default)(writeStream).once('close', err => {
|
||||
writeStream = null;
|
||||
tracer = null;
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
(0, _nullthrows().default)(writeStream).end();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
29
webGl/my-threejs-test/node_modules/@parcel/reporter-tracer/package.json
generated
vendored
Normal file
29
webGl/my-threejs-test/node_modules/@parcel/reporter-tracer/package.json
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "@parcel/reporter-tracer",
|
||||
"version": "2.12.0",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/parcel"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/parcel-bundler/parcel.git"
|
||||
},
|
||||
"main": "lib/TracerReporter.js",
|
||||
"source": "src/TracerReporter.js",
|
||||
"engines": {
|
||||
"node": ">= 12.0.0",
|
||||
"parcel": "^2.12.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@parcel/plugin": "2.12.0",
|
||||
"@parcel/utils": "2.12.0",
|
||||
"chrome-trace-event": "^1.0.3",
|
||||
"nullthrows": "^1.1.1"
|
||||
},
|
||||
"gitHead": "2059029ee91e5f03a273b0954d3e629d7375f986"
|
||||
}
|
87
webGl/my-threejs-test/node_modules/@parcel/reporter-tracer/src/TracerReporter.js
generated
vendored
Normal file
87
webGl/my-threejs-test/node_modules/@parcel/reporter-tracer/src/TracerReporter.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
// @flow
|
||||
import invariant from 'assert';
|
||||
import nullthrows from 'nullthrows';
|
||||
import path from 'path';
|
||||
import {Reporter} from '@parcel/plugin';
|
||||
import {Tracer} from 'chrome-trace-event';
|
||||
|
||||
// We need to maintain some state here to ensure we write to the same output, there should only be one
|
||||
// instance of this reporter (this gets asserted below)
|
||||
let tracer;
|
||||
let writeStream = null;
|
||||
|
||||
function millisecondsToMicroseconds(milliseconds: number) {
|
||||
return Math.floor(milliseconds * 1000);
|
||||
}
|
||||
|
||||
// TODO: extract this to utils as it's also used in packages/core/workers/src/WorkerFarm.js
|
||||
function getTimeId() {
|
||||
let now = new Date();
|
||||
return (
|
||||
String(now.getFullYear()) +
|
||||
String(now.getMonth() + 1).padStart(2, '0') +
|
||||
String(now.getDate()).padStart(2, '0') +
|
||||
'-' +
|
||||
String(now.getHours()).padStart(2, '0') +
|
||||
String(now.getMinutes()).padStart(2, '0') +
|
||||
String(now.getSeconds()).padStart(2, '0')
|
||||
);
|
||||
}
|
||||
|
||||
export default (new Reporter({
|
||||
report({event, options, logger}) {
|
||||
let filename;
|
||||
let filePath;
|
||||
switch (event.type) {
|
||||
case 'buildStart':
|
||||
invariant(tracer == null, 'Tracer multiple initialisation');
|
||||
tracer = new Tracer();
|
||||
filename = `parcel-trace-${getTimeId()}.json`;
|
||||
filePath = path.join(options.projectRoot, filename);
|
||||
invariant(
|
||||
writeStream == null,
|
||||
'Trace write stream multiple initialisation',
|
||||
);
|
||||
logger.info({
|
||||
message: `Writing trace to ${filename}. See https://parceljs.org/features/profiling/#analysing-traces for more information on working with traces.`,
|
||||
});
|
||||
writeStream = options.outputFS.createWriteStream(filePath);
|
||||
nullthrows(tracer).pipe(nullthrows(writeStream));
|
||||
break;
|
||||
case 'trace':
|
||||
// Due to potential race conditions at the end of the build, we ignore any trace events that occur
|
||||
// after we've closed the write stream.
|
||||
if (tracer === null) return;
|
||||
|
||||
tracer.completeEvent({
|
||||
name: event.name,
|
||||
cat: event.categories,
|
||||
args: event.args,
|
||||
ts: millisecondsToMicroseconds(event.ts),
|
||||
dur: millisecondsToMicroseconds(event.duration),
|
||||
tid: event.tid,
|
||||
pid: event.pid,
|
||||
});
|
||||
break;
|
||||
case 'buildSuccess':
|
||||
case 'buildFailure':
|
||||
nullthrows(tracer).flush();
|
||||
// We explicitly trigger `end` on the writeStream for the trace, then we need to wait for
|
||||
// the `close` event before resolving the promise this report function returns to ensure
|
||||
// that the file has been properly closed and moved from it's temp location before Parcel
|
||||
// shuts down.
|
||||
return new Promise((resolve, reject) => {
|
||||
nullthrows(writeStream).once('close', err => {
|
||||
writeStream = null;
|
||||
tracer = null;
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
nullthrows(writeStream).end();
|
||||
});
|
||||
}
|
||||
},
|
||||
}): Reporter);
|
Reference in New Issue
Block a user