v1.0

parents

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

# FormProjectV1
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.3.14.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"FormProjectV1": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/FormProjectV1",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": false,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
],
"scripts": [
"./node_modules/jquery/dist/jquery.min.js",
"./node_modules/bootstrap/dist/js/bootstrap.js"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "FormProjectV1:build"
},
"configurations": {
"production": {
"browserTarget": "FormProjectV1:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "FormProjectV1:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
],
"scripts": [
"./node_modules/jquery/dist/jquery.min.js",
"./node_modules/bootstrap/dist/js/bootstrap.js"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "FormProjectV1:serve"
},
"configurations": {
"production": {
"devServerTarget": "FormProjectV1:serve:production"
}
}
}
}
}},
"defaultProject": "FormProjectV1"
}
const path = require("path");
const express = require("express");
const bodyParser = require("body-parser");
const mongoose = require("mongoose");
const Forms = require('./models/forms');
//const postsRoutes = require("./routes/posts");
//const userRoutes = require("./routes/user");
const app = express();
mongoose
.connect(
"mongodb+srv://Admin:Admin@cluster0-r6z28.mongodb.net/Project?retryWrites=true&w=majority"
)
.then(() => {
console.log("Connected to database!");
})
.catch(() => {
console.log("Connection failed!");
});
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use("/images", express.static(path.join("backend/images")));
app.use((req, res, next) => {
res.setHeader("Access-Control-Allow-Origin", "*");
res.setHeader(
"Access-Control-Allow-Headers",
"Origin, X-Requested-With, Content-Type, Accept, Authorization"
);
res.setHeader(
"Access-Control-Allow-Methods",
"GET, POST, PATCH, PUT, DELETE, OPTIONS"
);
next();
});
//app.use(postsRoutes);
//app.use("/api/user", userRoutes);
//console.log('test');
app.post('/api/form', (req, res, next) => {
console.log('Hello!!!!!');
const form = new Forms(req.body);
console.log(form._id);
form.save(function(err) {
if (err) throw err;
console.log('Form saved successfully');
res.status(201).json({ formId: form._id });
});
/*
res.status(201).json({
message: 'Successful'
});
*/
});
app.use('/formfill/', (req, rs, next) => {
var formId = req.url;
formId = formId.replace('/', '');
Forms.find( {_id: formId})
.then(documents => {
console.log(documents[0]);
});
//console.log(formId);
});
module.exports = app;
const mongoose = require('mongoose');
var Schema = mongoose.Schema;
// set up a mongoose model and pass it using module.exports
module.exports = mongoose.model('Forms', new Schema({}, { strict: false} ));
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# You can see what browsers were selected by your queries by running:
# npx browserslist
> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
\ No newline at end of file
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
\ No newline at end of file
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('FormProjectV1 app is running!');
});
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
import { browser, by, element } from 'protractor';
export class AppPage {
navigateTo() {
return browser.get(browser.baseUrl) as Promise<any>;
}
getTitleText() {
return element(by.css('app-root .content span')).getText() as Promise<string>;
}
}
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, './coverage/FormProjectV1'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
../JSONStream/bin.js
\ No newline at end of file
../acorn/bin/acorn
\ No newline at end of file
../ansi-html/bin/ansi-html
\ No newline at end of file
../atob/bin/atob.js
\ No newline at end of file
../autoprefixer/bin/autoprefixer
\ No newline at end of file
../babylon/bin/babylon.js
\ No newline at end of file
../blocking-proxy/built/lib/bin.js
\ No newline at end of file
../browserslist/cli.js
\ No newline at end of file
../@angular-devkit/build-optimizer/src/build-optimizer/cli.js
\ No newline at end of file
../cssesc/bin/cssesc
\ No newline at end of file
../errno/cli.js
\ No newline at end of file
../esprima/bin/esparse.js
\ No newline at end of file
../esprima/bin/esvalidate.js
\ No newline at end of file
../handlebars/bin/handlebars
\ No newline at end of file
../image-size/bin/image-size.js
\ No newline at end of file
../import-local/fixtures/cli.js
\ No newline at end of file
../@angular/compiler-cli/ngcc/main-ngcc.js
\ No newline at end of file
../jasmine/bin/jasmine.js
\ No newline at end of file
../js-yaml/bin/js-yaml.js
\ No newline at end of file
../jsesc/bin/jsesc
\ No newline at end of file
../json5/lib/cli.js
\ No newline at end of file
../karma/bin/karma
\ No newline at end of file
../less/bin/lessc
\ No newline at end of file
../loose-envify/cli.js
\ No newline at end of file
../miller-rabin/bin/miller-rabin
\ No newline at end of file
../mime/cli.js
\ No newline at end of file
../mkdirp/bin/cmd.js
\ No newline at end of file
../multicast-dns/cli.js
\ No newline at end of file
../@angular/cli/bin/ng
\ No newline at end of file
../@angular/compiler-cli/src/extract_i18n.js
\ No newline at end of file
../@angular/compiler-cli/src/main.js
\ No newline at end of file
../@babel/parser/bin/babel-parser.js
\ No newline at end of file
../protractor/bin/protractor
\ No newline at end of file
../regjsparser/bin/parser
\ No newline at end of file
../rimraf/bin.js
\ No newline at end of file
../sass/sass.js
\ No newline at end of file
../semver/bin/semver.js
\ No newline at end of file
../sha.js/bin.js
\ No newline at end of file
../sshpk/bin/sshpk-conv
\ No newline at end of file
../sshpk/bin/sshpk-sign
\ No newline at end of file
../sshpk/bin/sshpk-verify
\ No newline at end of file
../stylus/bin/stylus
\ No newline at end of file
../terser/bin/terser
\ No newline at end of file
../tree-kill/cli.js
\ No newline at end of file
../ts-node/dist/bin.js
\ No newline at end of file
../typescript/bin/tsc
\ No newline at end of file
../tslint/bin/tslint
\ No newline at end of file
../typescript/bin/tsserver
\ No newline at end of file
../uglify-js/bin/uglifyjs
\ No newline at end of file
../uuid/bin/uuid
\ No newline at end of file
../protractor/bin/webdriver-manager
\ No newline at end of file
../webpack/bin/webpack.js
\ No newline at end of file
../webpack-dev-server/bin/webpack-dev-server.js
\ No newline at end of file
../which/bin/which
\ No newline at end of file
The MIT License
Copyright (c) 2017 Google, Inc.
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.
/**
* @license
* Copyright Google Inc. 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.io/license
*/
import { json } from '@angular-devkit/core';
import { Schema as OperatorSchema } from './operator-schema';
declare const _default: import("../src/internal").Builder<json.JsonObject & OperatorSchema>;
export default _default;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const rxjs_1 = require("rxjs");
const operators_1 = require("rxjs/operators");
const src_1 = require("../src");
exports.default = src_1.createBuilder((options, context) => {
const allRuns = [];
context.reportProgress(0, (options.targets ? options.targets.length : 0)
+ (options.builders ? options.builders.length : 0));
if (options.targets) {
allRuns.push(...options.targets.map(({ target: targetStr, overrides }, i) => {
const [project, target, configuration] = targetStr.split(/:/g, 3);
return context.scheduleTarget({ project, target, configuration }, overrides || {})
.then(run => [i, run]);
}));
}
if (options.builders) {
allRuns.push(...options.builders.map(({ builder, options }, i) => {
return context.scheduleBuilder(builder, options || {})
.then(run => [i, run]);
}));
}
const allResults = allRuns.map(() => null);
let n = 0;
context.reportProgress(n++, allRuns.length);
return rxjs_1.from(allRuns).pipe(operators_1.mergeMap(runPromise => rxjs_1.from(runPromise)), operators_1.mergeMap(([i, run]) => run.output.pipe(operators_1.map(output => [i, output]))), operators_1.mergeMap(([i, output]) => {
allResults[i] = output;
context.reportProgress(n++, allRuns.length);
if (allResults.some(x => x === null)) {
// Some builders aren't done running yet.
return rxjs_1.EMPTY;
}
else {
return rxjs_1.of({
success: allResults.every(x => x ? x.success : false),
});
}
}));
});
{
"$schema": "../src/builders-schema.json",
"builders": {
"true": {
"implementation": "./true",
"schema": "./noop-schema.json",
"description": "Always succeed."
},
"false": {
"implementation": "./false",
"schema": "./noop-schema.json",
"description": "Always fails."
},
"allOf": {
"implementation": "./all-of",
"schema": "./operator-schema.json",
"description": "A builder that executes many builders in parallel, and succeed if both succeeds."
},
"concat": {
"implementation": "./concat",
"schema": "./operator-schema.json",
"description": "A builder that executes many builders one after the other, and stops when one fail. It will succeed if all builders succeeds (and return the last output)"
}
}
}
/**
* @license
* Copyright Google Inc. 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.io/license
*/
import { json } from '@angular-devkit/core';
import { Schema as OperatorSchema } from './operator-schema';
declare const _default: import("../src/internal").Builder<json.JsonObject & OperatorSchema>;
export default _default;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const rxjs_1 = require("rxjs");
const operators_1 = require("rxjs/operators");
const src_1 = require("../src");
exports.default = src_1.createBuilder((options, context) => {
const allRuns = [];
context.reportProgress(0, (options.targets ? options.targets.length : 0)
+ (options.builders ? options.builders.length : 0));
if (options.targets) {
allRuns.push(...options.targets.map(({ target: targetStr, overrides }) => {
const [project, target, configuration] = targetStr.split(/:/g, 3);
return () => context.scheduleTarget({ project, target, configuration }, overrides || {});
}));
}
if (options.builders) {
allRuns.push(...options.builders.map(({ builder, options }) => {
return () => context.scheduleBuilder(builder, options || {});
}));
}
let stop = null;
let i = 0;
context.reportProgress(i++, allRuns.length);
return rxjs_1.from(allRuns).pipe(operators_1.concatMap(fn => stop ? rxjs_1.of(null) : rxjs_1.from(fn()).pipe(operators_1.switchMap(run => run === null ? rxjs_1.of(null) : run.output.pipe(operators_1.first())))), operators_1.map(output => {
context.reportProgress(i++, allRuns.length);
if (output === null || stop !== null) {
return stop || { success: false };
}
else if (output.success === false) {
return stop = output;
}
else {
return output;
}
}), operators_1.last());
});
declare const _default: import("../src/internal").Builder<import("../../core/src/index").JsonObject>;
export default _default;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @license
* Copyright Google Inc. 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.io/license
*/
const src_1 = require("../src");
exports.default = src_1.createBuilder(() => ({
success: false,
error: 'False builder always errors.',
}));
// 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 ...).
// tslint:disable:no-global-tslint-disable
// tslint:disable
{
"$schema": "http://json-schema.org/schema",
"type": "object"
}
\ No newline at end of file
/**
* All input types of builders that perform operations on one or multiple sub-builders.
*/
export interface Schema {
builders?: Builder[];
targets?: Target[];
}
export interface Builder {
builder: string;
options?: {
[key: string]: any;
};
}
export interface Target {
overrides?: {
[key: string]: any;
};
target: string;
}
"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 });
{
"$schema": "http://json-schema.org/schema",
"description": "All input types of builders that perform operations on one or multiple sub-builders.",
"type": "object",
"properties": {
"builders": {
"type": "array",
"items": {
"type": "object",
"properties": {
"builder": {
"type": "string",
"pattern": ".*:.*"
},
"options": {
"type": "object"
}
},
"required": [
"builder"
]
},
"minItems": 1
},
"targets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"target": {
"type": "string",
"pattern": ".*:.*"
},
"overrides": {
"type": "object"
}
},
"required": [
"target"
]
},
"minItems": 1
}
}
}
declare const _default: import("../src/internal").Builder<import("../../core/src/index").JsonObject>;
export default _default;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @license
* Copyright Google Inc. 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.io/license
*/
const src_1 = require("../src");
exports.default = src_1.createBuilder(() => ({ success: true }));
/**
* @license
* Copyright Google Inc. 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.io/license
*/
export * from './node-modules-architect-host';
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @license
* Copyright Google Inc. 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.io/license
*/
__export(require("./node-modules-architect-host"));
/**
* @license
* Copyright Google Inc. 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.io/license
*/
import { experimental, json, workspaces } from '@angular-devkit/core';
import { BuilderInfo } from '../src';
import { Target } from '../src/input-schema';
import { ArchitectHost, Builder } from '../src/internal';
export declare type NodeModulesBuilderInfo = BuilderInfo & {
import: string;
};
export declare class WorkspaceNodeModulesArchitectHost implements ArchitectHost<NodeModulesBuilderInfo> {
protected _workspace: experimental.workspace.Workspace | workspaces.WorkspaceDefinition;
protected _root: string;
/**
* @deprecated
*/
constructor(_workspace: experimental.workspace.Workspace, _root: string);
constructor(_workspace: workspaces.WorkspaceDefinition, _root: string);
getBuilderNameForTarget(target: Target): Promise<any>;
/**
* Resolve a builder. This needs to be a string which will be used in a dynamic `import()`
* clause. This should throw if no builder can be found. The dynamic import will throw if
* it is unsupported.
* @param builderStr The name of the builder to be used.
* @returns All the info needed for the builder itself.
*/
resolveBuilder(builderStr: string): Promise<NodeModulesBuilderInfo>;
getCurrentDirectory(): Promise<string>;
getWorkspaceRoot(): Promise<string>;
getOptionsForTarget(target: Target): Promise<json.JsonObject | null>;
loadBuilder(info: NodeModulesBuilderInfo): Promise<Builder>;
private findProjectTarget;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const node_1 = require("@angular-devkit/core/node");
const path = require("path");
const internal_1 = require("../src/internal");
// TODO: create a base class for all workspace related hosts.
class WorkspaceNodeModulesArchitectHost {
constructor(_workspace, _root) {
this._workspace = _workspace;
this._root = _root;
}
async getBuilderNameForTarget(target) {
const targetDefinition = this.findProjectTarget(target);
if (!targetDefinition) {
throw new Error('Project target does not exist.');
}
return targetDefinition.builder;
}
/**
* Resolve a builder. This needs to be a string which will be used in a dynamic `import()`
* clause. This should throw if no builder can be found. The dynamic import will throw if
* it is unsupported.
* @param builderStr The name of the builder to be used.
* @returns All the info needed for the builder itself.
*/
resolveBuilder(builderStr) {
const [packageName, builderName] = builderStr.split(':', 2);
if (!builderName) {
throw new Error('No builder name specified.');
}
const packageJsonPath = node_1.resolve(packageName, {
basedir: this._root,
checkLocal: true,
checkGlobal: true,
resolvePackageJson: true,
});
const packageJson = require(packageJsonPath);
if (!packageJson['builders']) {
throw new Error(`Package ${JSON.stringify(packageName)} has no builders defined.`);
}
const builderJsonPath = path.resolve(path.dirname(packageJsonPath), packageJson['builders']);
const builderJson = require(builderJsonPath);
const builder = builderJson.builders && builderJson.builders[builderName];
if (!builder) {
throw new Error(`Cannot find builder ${JSON.stringify(builderStr)}.`);
}
const importPath = builder.implementation;
if (!importPath) {
throw new Error('Could not find the implementation for builder ' + builderStr);
}
return Promise.resolve({
name: builderStr,
builderName,
description: builder['description'],
optionSchema: require(path.resolve(path.dirname(builderJsonPath), builder.schema)),
import: path.resolve(path.dirname(builderJsonPath), importPath),
});
}
async getCurrentDirectory() {
return process.cwd();
}
async getWorkspaceRoot() {
return this._root;
}
async getOptionsForTarget(target) {
const targetSpec = this.findProjectTarget(target);
if (targetSpec === undefined) {
return null;
}
if (target.configuration
&& !(targetSpec['configurations'] && targetSpec['configurations'][target.configuration])) {
throw new Error(`Configuration '${target.configuration}' is not set in the workspace.`);
}
return {
...targetSpec['options'],
...(target.configuration ? targetSpec['configurations'][target.configuration] : 0),
};
}
async loadBuilder(info) {
const builder = (await Promise.resolve().then(() => require(info.import))).default;
if (builder[internal_1.BuilderSymbol]) {
return builder;
}
throw new Error('Builder is not a builder');
}
findProjectTarget(target) {
// NOTE: Remove conditional when deprecated support for experimental workspace API is removed.
if ('getProjectTargets' in this._workspace) {
return this._workspace.getProjectTargets(target.project)[target.target];
}
else {
const projectDefinition = this._workspace.projects.get(target.project);
if (!projectDefinition) {
throw new Error('Project does not exist.');
}
return projectDefinition.targets.get(target.target);
}
}
}
exports.WorkspaceNodeModulesArchitectHost = WorkspaceNodeModulesArchitectHost;
{
"_args": [
[
"@angular-devkit/architect@0.803.17",
"/home/nitin/Documents/Software_Lab/Project/Google-Form-Mandar"
]
],
"_development": true,
"_from": "@angular-devkit/architect@0.803.17",
"_id": "@angular-devkit/architect@0.803.17",
"_inBundle": false,
"_integrity": "sha512-QbuWJhjh78Pb/9574OIjR38hhJCRBd0BtdrRRdTjP7By6liXURnA/OH6iZ9o1jA8It1NvoJQtM2flr8dQf83Mw==",
"_location": "/@angular-devkit/architect",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@angular-devkit/architect@0.803.17",
"name": "@angular-devkit/architect",
"escapedName": "@angular-devkit%2farchitect",
"scope": "@angular-devkit",
"rawSpec": "0.803.17",
"saveSpec": null,
"fetchSpec": "0.803.17"
},
"_requiredBy": [
"/@angular-devkit/build-angular",
"/@angular-devkit/build-webpack",
"/@angular/cli"
],
"_resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.803.17.tgz",
"_spec": "0.803.17",
"_where": "/home/nitin/Documents/Software_Lab/Project/Google-Form-Mandar",
"author": {
"name": "Angular Authors"
},
"bugs": {
"url": "https://github.com/angular/angular-cli/issues"
},
"builders": "./builders/builders.json",
"dependencies": {
"@angular-devkit/core": "8.3.17",
"rxjs": "6.4.0"
},
"description": "Angular Build Facade",
"engines": {
"node": ">= 10.9.0",
"npm": ">= 6.2.0"
},
"experimental": true,
"homepage": "https://github.com/angular/angular-cli",
"husky": {
"hooks": {
"pre-push": "node ./bin/devkit-admin hooks/pre-push"
}
},
"keywords": [
"angular",
"Angular CLI",
"devkit",
"sdk",
"Angular DevKit"
],
"license": "MIT",
"main": "src/index.js",
"name": "@angular-devkit/architect",
"repository": {
"type": "git",
"url": "git+https://github.com/angular/angular-cli.git"
},
"typings": "src/index.d.ts",
"version": "0.803.17"
}
This diff is collapsed.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const rxjs_1 = require("rxjs");
const operators_1 = require("rxjs/operators");
const progress_schema_1 = require("./progress-schema");
exports.BuilderProgressState = progress_schema_1.State;
// tslint:disable-next-line:no-any
function isBuilderOutput(obj) {
if (!obj || typeof obj.then === 'function' || typeof obj.subscribe === 'function') {
return false;
}
return typeof obj.success === 'boolean';
}
exports.isBuilderOutput = isBuilderOutput;
/**
* Returns a string of "project:target[:configuration]" for the target object.
*/
function targetStringFromTarget({ project, target, configuration }) {
return `${project}:${target}${configuration !== undefined ? ':' + configuration : ''}`;
}
exports.targetStringFromTarget = targetStringFromTarget;
/**
* Return a Target tuple from a string.
*/
function targetFromTargetString(str) {
const tuple = str.split(/:/, 3);
if (tuple.length < 2) {
throw new Error('Invalid target string: ' + JSON.stringify(str));
}
return {
project: tuple[0],
target: tuple[1],
...(tuple[2] !== undefined) && { configuration: tuple[2] },
};
}
exports.targetFromTargetString = targetFromTargetString;
/**
* Schedule a target, and forget about its run. This will return an observable of outputs, that
* as a a teardown will stop the target from running. This means that the Run object this returns
* should not be shared.
*
* The reason this is not part of the Context interface is to keep the Context as normal form as
* possible. This is really an utility that people would implement in their project.
*
* @param context The context of your current execution.
* @param target The target to schedule.
* @param overrides Overrides that are used in the target.
* @param scheduleOptions Additional scheduling options.
*/
function scheduleTargetAndForget(context, target, overrides, scheduleOptions) {
let resolve = null;
const promise = new Promise(r => resolve = r);
context.addTeardown(() => promise);
return rxjs_1.from(context.scheduleTarget(target, overrides, scheduleOptions)).pipe(operators_1.switchMap(run => new rxjs_1.Observable(observer => {
const subscription = run.output.subscribe(observer);
return () => {
subscription.unsubscribe();
// We can properly ignore the floating promise as it's a "reverse" promise; the teardown
// is waiting for the resolve.
// tslint:disable-next-line:no-floating-promises
run.stop().then(resolve);
};
})));
}
exports.scheduleTargetAndForget = scheduleTargetAndForget;
/**
* @license
* Copyright Google Inc. 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.io/license
*/
import { analytics, experimental, json, logging } from '@angular-devkit/core';
import { Observable } from 'rxjs';
import { BuilderRun, Target } from './api';
import { ArchitectHost } from './internal';
export interface ScheduleOptions {
logger?: logging.Logger;
analytics?: analytics.Analytics;
}
export declare class Architect {
private _host;
private readonly _scheduler;
private readonly _jobCache;
private readonly _infoCache;
constructor(_host: ArchitectHost, registry?: json.schema.SchemaRegistry, additionalJobRegistry?: experimental.jobs.Registry);
has(name: experimental.jobs.JobName): Observable<boolean>;
scheduleBuilder(name: string, options: json.JsonObject, scheduleOptions?: ScheduleOptions): Promise<BuilderRun>;
scheduleTarget(target: Target, overrides?: json.JsonObject, scheduleOptions?: ScheduleOptions): Promise<BuilderRun>;
}
This diff is collapsed.
export interface Schema {
/**
* Link to schema.
*/
$schema?: string;
builders: {
[key: string]: Builder;
};
}
/**
* Target options for Builders.
*/
export interface Builder {
/**
* The builder class module.
*/
class?: string;
/**
* Builder description.
*/
description: string;
/**
* The next generation builder module.
*/
implementation?: string;
/**
* Schema for builder option validation.
*/
schema: string;
}
"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 });
{
"$schema": "http://json-schema.org/schema",
"id": "BuildersSchema",
"title": "Builders schema for validating a list of builders.",
"type": "object",
"properties": {
"$schema": {
"type": "string",
"description": "Link to schema."
},
"builders": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/builder"
}
}
},
"required": [
"builders"
],
"definitions": {
"builder": {
"type": "object",
"description": "Target options for Builders.",
"allOf": [
{
"properties": {
"schema": {
"type": "string",
"description": "Schema for builder option validation."
},
"description": {
"type": "string",
"description": "Builder description."
}
},
"required": [
"schema",
"description"
]
},
{
"anyOf": [
{
"properties": {
"implementation": {
"type": "string",
"description": "The next generation builder module."
}
},
"required": [
"implementation"
]
},
{
"properties": {
"class": {
"type": "string",
"description": "The builder class module."
}
},
"required": [
"class"
]
}
]
}
]
}
}
}
/**
* @license
* Copyright Google Inc. 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.io/license
*/
import { json } from '@angular-devkit/core';
import { BuilderHandlerFn, BuilderOutput } from './api';
import { Builder } from './internal';
export declare function createBuilder<OptT extends json.JsonObject, OutT extends BuilderOutput = BuilderOutput>(fn: BuilderHandlerFn<OptT>): Builder<OptT>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @license
* Copyright Google Inc. 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.io/license
*/
const core_1 = require("@angular-devkit/core");
const rxjs_1 = require("rxjs");
const operators_1 = require("rxjs/operators");
const api_1 = require("./api");
const internal_1 = require("./internal");
const schedule_by_name_1 = require("./schedule-by-name");
function createBuilder(fn) {
const cjh = core_1.experimental.jobs.createJobHandler;
const handler = cjh((options, context) => {
const scheduler = context.scheduler;
const progressChannel = context.createChannel('progress');
const logChannel = context.createChannel('log');
const analyticsChannel = context.createChannel('analytics');
let currentState = api_1.BuilderProgressState.Stopped;
const teardownLogics = [];
let tearingDown = false;
let current = 0;
let status = '';
let total = 1;
function log(entry) {
logChannel.next(entry);
}
function progress(progress, context) {
currentState = progress.state;
if (progress.state === api_1.BuilderProgressState.Running) {
current = progress.current;
total = progress.total !== undefined ? progress.total : total;
if (progress.status === undefined) {
progress.status = status;
}
else {
status = progress.status;
}
}
progressChannel.next({
...progress,
...(context.target && { target: context.target }),
...(context.builder && { builder: context.builder }),
id: context.id,
});
}
return new rxjs_1.Observable(observer => {
const subscriptions = [];
const inputSubscription = context.inboundBus.subscribe(i => {
switch (i.kind) {
case core_1.experimental.jobs.JobInboundMessageKind.Stop:
// Run teardown logic then complete.
tearingDown = true;
Promise.all(teardownLogics.map(fn => fn() || Promise.resolve()))
.then(() => observer.complete(), err => observer.error(err));
break;
case core_1.experimental.jobs.JobInboundMessageKind.Input:
if (!tearingDown) {
onInput(i.value);
}
break;
}
});
function onInput(i) {
const builder = i.info;
const loggerName = i.target
? api_1.targetStringFromTarget(i.target)
: builder.builderName;
const logger = new core_1.logging.Logger(loggerName);
subscriptions.push(logger.subscribe(entry => log(entry)));
const context = {
builder,
workspaceRoot: i.workspaceRoot,
currentDirectory: i.currentDirectory,
target: i.target,
logger: logger,
id: i.id,
async scheduleTarget(target, overrides = {}, scheduleOptions = {}) {
const run = await schedule_by_name_1.scheduleByTarget(target, overrides, {
scheduler,
logger: scheduleOptions.logger || logger.createChild(''),
workspaceRoot: i.workspaceRoot,
currentDirectory: i.currentDirectory,
});
// We don't want to subscribe errors and complete.
subscriptions.push(run.progress.subscribe(event => progressChannel.next(event)));
return run;
},
async scheduleBuilder(builderName, options = {}, scheduleOptions = {}) {
const run = await schedule_by_name_1.scheduleByName(builderName, options, {
scheduler,
target: scheduleOptions.target,
logger: scheduleOptions.logger || logger.createChild(''),
workspaceRoot: i.workspaceRoot,
currentDirectory: i.currentDirectory,
});
// We don't want to subscribe errors and complete.
subscriptions.push(run.progress.subscribe(event => progressChannel.next(event)));
return run;
},
async getTargetOptions(target) {
return scheduler.schedule('..getTargetOptions', target).output.toPromise();
},
async getBuilderNameForTarget(target) {
return scheduler.schedule('..getBuilderNameForTarget', target).output.toPromise();
},
async validateOptions(options, builderName) {
return scheduler.schedule('..validateOptions', [builderName, options]).output.toPromise();
},
reportRunning() {
switch (currentState) {
case api_1.BuilderProgressState.Waiting:
case api_1.BuilderProgressState.Stopped:
progress({ state: api_1.BuilderProgressState.Running, current: 0, total }, context);
break;
}
},
reportStatus(status) {
switch (currentState) {
case api_1.BuilderProgressState.Running:
progress({ state: currentState, status, current, total }, context);
break;
case api_1.BuilderProgressState.Waiting:
progress({ state: currentState, status }, context);
break;
}
},
reportProgress(current, total, status) {
switch (currentState) {
case api_1.BuilderProgressState.Running:
progress({ state: currentState, current, total, status }, context);
}
},
analytics: new core_1.analytics.ForwardingAnalytics(report => analyticsChannel.next(report)),
addTeardown(teardown) {
teardownLogics.push(teardown);
},
};
context.reportRunning();
let result;
try {
result = fn(i.options, context);
if (api_1.isBuilderOutput(result)) {
result = rxjs_1.of(result);
}
else {
result = rxjs_1.from(result);
}
}
catch (e) {
result = rxjs_1.throwError(e);
}
// Manage some state automatically.
progress({ state: api_1.BuilderProgressState.Running, current: 0, total: 1 }, context);
subscriptions.push(result.pipe(operators_1.tap(() => {
progress({ state: api_1.BuilderProgressState.Running, current: total }, context);
progress({ state: api_1.BuilderProgressState.Stopped }, context);
})).subscribe(message => observer.next(message), error => observer.error(error), () => observer.complete()));
}
return () => {
subscriptions.forEach(x => x.unsubscribe());
inputSubscription.unsubscribe();
};
});
});
return {
handler,
[internal_1.BuilderSymbol]: true,
[internal_1.BuilderVersionSymbol]: require('../package.json').version,
};
}
exports.createBuilder = createBuilder;
/**
* @license
* Copyright Google Inc. 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.io/license
*/
export * from './api';
export { Architect, ScheduleOptions } from './architect';
export { createBuilder } from './create-builder';
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @license
* Copyright Google Inc. 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.io/license
*/
__export(require("./api"));
var architect_1 = require("./architect");
exports.Architect = architect_1.Architect;
var create_builder_1 = require("./create-builder");
exports.createBuilder = create_builder_1.createBuilder;
export interface Schema {
currentDirectory: string;
id: number;
info: {
[key: string]: any;
};
options?: {
[key: string]: any;
};
target?: Target;
workspaceRoot: string;
}
export interface Target {
configuration?: string;
project: string;
target: string;
}
"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 });
{
"$schema": "http://json-schema.org/schema",
"id": "BuilderInputSchema",
"title": "Input schema for builders.",
"type": "object",
"properties": {
"workspaceRoot": {
"type": "string"
},
"currentDirectory": {
"type": "string"
},
"id": {
"type": "number"
},
"target": {
"type": "object",
"properties": {
"project": {
"type": "string"
},
"target": {
"type": "string"
},
"configuration": {
"type": "string"
}
},
"required": [
"project",
"target"
]
},
"info": {
"type": "object"
},
"options": {
"type": "object"
}
},
"required": [
"currentDirectory",
"id",
"info",
"workspaceRoot"
]
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment