Deployed the page to Github Pages.
This commit is contained in:
parent
1d79754e93
commit
2c89899458
62797 changed files with 6551425 additions and 15279 deletions
15
node_modules/@schematics/angular/web-worker/files/worker-tsconfig/tsconfig.worker.json.template
generated
vendored
Executable file
15
node_modules/@schematics/angular/web-worker/files/worker-tsconfig/tsconfig.worker.json.template
generated
vendored
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
||||
{
|
||||
"extends": "<%= relativePathToWorkspaceRoot %>/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/worker",
|
||||
"lib": [
|
||||
"es2018",
|
||||
"webworker"
|
||||
],
|
||||
"types": []
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.worker.ts"
|
||||
]
|
||||
}
|
||||
6
node_modules/@schematics/angular/web-worker/files/worker/__name@dasherize__.worker.ts.template
generated
vendored
Executable file
6
node_modules/@schematics/angular/web-worker/files/worker/__name@dasherize__.worker.ts.template
generated
vendored
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
/// <reference lib="webworker" />
|
||||
|
||||
addEventListener('message', ({ data }) => {
|
||||
const response = `worker response to ${data}`;
|
||||
postMessage(response);
|
||||
});
|
||||
10
node_modules/@schematics/angular/web-worker/index.d.ts
generated
vendored
Executable file
10
node_modules/@schematics/angular/web-worker/index.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
import { Rule } from '@angular-devkit/schematics';
|
||||
import { Schema as WebWorkerOptions } from './schema';
|
||||
export default function (options: WebWorkerOptions): Rule;
|
||||
110
node_modules/@schematics/angular/web-worker/index.js
generated
vendored
Executable file
110
node_modules/@schematics/angular/web-worker/index.js
generated
vendored
Executable file
|
|
@ -0,0 +1,110 @@
|
|||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = default_1;
|
||||
const core_1 = require("@angular-devkit/core");
|
||||
const schematics_1 = require("@angular-devkit/schematics");
|
||||
const parse_name_1 = require("../utility/parse-name");
|
||||
const paths_1 = require("../utility/paths");
|
||||
const workspace_1 = require("../utility/workspace");
|
||||
function addSnippet(options) {
|
||||
return (host, context) => {
|
||||
context.logger.debug('Updating appmodule');
|
||||
if (options.path === undefined) {
|
||||
return;
|
||||
}
|
||||
const fileRegExp = new RegExp(`^${options.name}.*\\.ts`);
|
||||
const siblingModules = host
|
||||
.getDir(options.path)
|
||||
.subfiles // Find all files that start with the same name, are ts files,
|
||||
// and aren't spec or module files.
|
||||
.filter((f) => fileRegExp.test(f) && !/(module|spec)\.ts$/.test(f))
|
||||
// Sort alphabetically for consistency.
|
||||
.sort();
|
||||
if (siblingModules.length === 0) {
|
||||
// No module to add in.
|
||||
return;
|
||||
}
|
||||
const siblingModulePath = `${options.path}/${siblingModules[0]}`;
|
||||
const logMessage = 'console.log(`page got message: ${data}`);';
|
||||
const workerCreationSnippet = core_1.tags.stripIndent `
|
||||
if (typeof Worker !== 'undefined') {
|
||||
// Create a new
|
||||
const worker = new Worker(new URL('./${options.name}.worker', import.meta.url));
|
||||
worker.onmessage = ({ data }) => {
|
||||
${logMessage}
|
||||
};
|
||||
worker.postMessage('hello');
|
||||
} else {
|
||||
// Web Workers are not supported in this environment.
|
||||
// You should add a fallback so that your program still executes correctly.
|
||||
}
|
||||
`;
|
||||
// Append the worker creation snippet.
|
||||
const originalContent = host.readText(siblingModulePath);
|
||||
host.overwrite(siblingModulePath, originalContent + '\n' + workerCreationSnippet);
|
||||
return host;
|
||||
};
|
||||
}
|
||||
function default_1(options) {
|
||||
return async (host) => {
|
||||
const workspace = await (0, workspace_1.getWorkspace)(host);
|
||||
if (!options.project) {
|
||||
throw new schematics_1.SchematicsException('Option "project" is required.');
|
||||
}
|
||||
const project = workspace.projects.get(options.project);
|
||||
if (!project) {
|
||||
throw new schematics_1.SchematicsException(`Invalid project name (${options.project})`);
|
||||
}
|
||||
const projectType = project.extensions['projectType'];
|
||||
if (projectType !== 'application') {
|
||||
throw new schematics_1.SchematicsException(`Web Worker requires a project type of "application".`);
|
||||
}
|
||||
if (options.path === undefined) {
|
||||
options.path = (0, workspace_1.buildDefaultPath)(project);
|
||||
}
|
||||
const parsedPath = (0, parse_name_1.parseName)(options.path, options.name);
|
||||
options.name = parsedPath.name;
|
||||
options.path = parsedPath.path;
|
||||
const templateSourceWorkerCode = (0, schematics_1.apply)((0, schematics_1.url)('./files/worker'), [
|
||||
(0, schematics_1.applyTemplates)({ ...options, ...schematics_1.strings }),
|
||||
(0, schematics_1.move)(parsedPath.path),
|
||||
]);
|
||||
const root = project.root || '';
|
||||
const templateSourceWorkerConfig = (0, schematics_1.apply)((0, schematics_1.url)('./files/worker-tsconfig'), [
|
||||
(0, schematics_1.applyTemplates)({
|
||||
...options,
|
||||
relativePathToWorkspaceRoot: (0, paths_1.relativePathToWorkspaceRoot)(root),
|
||||
}),
|
||||
(0, schematics_1.move)(root),
|
||||
]);
|
||||
return (0, schematics_1.chain)([
|
||||
// Add project configuration.
|
||||
(0, workspace_1.updateWorkspace)((workspace) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const project = workspace.projects.get(options.project);
|
||||
const buildTarget = project.targets.get('build');
|
||||
const testTarget = project.targets.get('test');
|
||||
if (!buildTarget) {
|
||||
throw new Error(`Build target is not defined for this project.`);
|
||||
}
|
||||
const workerConfigPath = (0, core_1.join)((0, core_1.normalize)(root), 'tsconfig.worker.json');
|
||||
(buildTarget.options ??= {}).webWorkerTsConfig ??= workerConfigPath;
|
||||
if (testTarget) {
|
||||
(testTarget.options ??= {}).webWorkerTsConfig ??= workerConfigPath;
|
||||
}
|
||||
}),
|
||||
// Create the worker in a sibling module.
|
||||
options.snippet ? addSnippet(options) : (0, schematics_1.noop)(),
|
||||
// Add the worker.
|
||||
(0, schematics_1.mergeWith)(templateSourceWorkerCode),
|
||||
(0, schematics_1.mergeWith)(templateSourceWorkerConfig),
|
||||
]);
|
||||
};
|
||||
}
|
||||
21
node_modules/@schematics/angular/web-worker/schema.d.ts
generated
vendored
Executable file
21
node_modules/@schematics/angular/web-worker/schema.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
/**
|
||||
* Creates a new, generic web worker definition in the given project.
|
||||
*/
|
||||
export interface Schema {
|
||||
/**
|
||||
* The name of the worker.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The path at which to create the worker file, relative to the current workspace.
|
||||
*/
|
||||
path?: string;
|
||||
/**
|
||||
* The name of the project.
|
||||
*/
|
||||
project: string;
|
||||
/**
|
||||
* Add a worker creation snippet in a sibling file of the same name.
|
||||
*/
|
||||
snippet?: boolean;
|
||||
}
|
||||
4
node_modules/@schematics/angular/web-worker/schema.js
generated
vendored
Executable file
4
node_modules/@schematics/angular/web-worker/schema.js
generated
vendored
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
"use strict";
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
|
||||
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
41
node_modules/@schematics/angular/web-worker/schema.json
generated
vendored
Executable file
41
node_modules/@schematics/angular/web-worker/schema.json
generated
vendored
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"$id": "SchematicsAngularWebWorker",
|
||||
"title": "Angular Web Worker Options Schema",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Creates a new, generic web worker definition in the given project.",
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"format": "path",
|
||||
"$default": {
|
||||
"$source": "workingDirectory"
|
||||
},
|
||||
"description": "The path at which to create the worker file, relative to the current workspace.",
|
||||
"visible": false
|
||||
},
|
||||
"project": {
|
||||
"type": "string",
|
||||
"description": "The name of the project.",
|
||||
"$default": {
|
||||
"$source": "projectName"
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the worker.",
|
||||
"$default": {
|
||||
"$source": "argv",
|
||||
"index": 0
|
||||
},
|
||||
"x-prompt": "What name would you like to use for the worker?"
|
||||
},
|
||||
"snippet": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Add a worker creation snippet in a sibling file of the same name."
|
||||
}
|
||||
},
|
||||
"required": ["name", "project"]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue