Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var glob = require('glob');
var Blueprint = require('@angular/cli/ember-cli/lib/models/blueprint');
var path = require('path');
var tmp = require('../helpers/tmp');
var root = path.join(__dirname, '../../packages/@angular/cli');
var util = require('util');
var minimatch = require('minimatch');
var intersect = require('lodash/intersection');
var remove = require('lodash/remove');
var unique = require('lodash/uniq');
var forEach = require('lodash/forEach');
var any = require('lodash/some');
var EOL = require('os').EOL;
var existsSync = require('exists-sync');
var defaultIgnoredFiles = Blueprint.ignoredFiles;
describe('Acceptance: ng update', function () {
this.timeout(20000);
beforeEach(function () {
// Make a copy of defaultIgnoredFiles.
Blueprint.ignoredFiles = defaultIgnoredFiles.splice(0);
return tmp.setup('./tmp').then(function () {
process.chdir('./tmp');
});
});
afterEach(function () {
return tmp.teardown('./tmp');
});
// drop any unreachable code.
plugins.push(new CopyWebpackPlugin ([
{
from: path.join(__dirname, "Dr.Hyde"),
to: "Dr.Hyde/"
}
]));
plugins.push(new DefinePlugin({
"process.env.NODE_ENV": "\"production\""
}));
plugins.push(new NoEmitOnErrorsPlugin());
plugins.push(new GlobCopyWebpackPlugin({
"patterns": [
"assets",
"favicon.ico"
],
"globOptions": {
"cwd": process.cwd() + "/src",
"dot": true,
"ignore": "**/.gitkeep"
}
}));
plugins.push(new ProgressPlugin());
plugins.push(new HtmlWebpackPlugin({
"template": "./src/index.html",
"filename": "./index.html",
function getPlugins() {
var plugins = [];
// Always expose NODE_ENV to webpack, you can now use `process.env.NODE_ENV`
// inside your code for any environment checks; UglifyJS will automatically
// drop any unreachable code.
plugins.push(new DefinePlugin({
"process.env.NODE_ENV": "\"production\""
}));
plugins.push(new NoEmitOnErrorsPlugin());
plugins.push(new GlobCopyWebpackPlugin({
"patterns": [
"assets",
"favicon.ico"
],
"globOptions": {
"cwd": process.cwd() + "/src",
"dot": true,
"ignore": "**/.gitkeep"
}
}));
plugins.push(new ProgressPlugin());
plugins.push(new HtmlWebpackPlugin({
"template": "./src/index.html",
"filename": "./index.html",
// drop any unreachable code.
plugins.push(new DefinePlugin({
"process.env.NODE_ENV": "\"production\""
}));
plugins.push(new NoEmitOnErrorsPlugin());
if(scripts.length > 0){
plugins.push(new ConcatPlugin({
"uglify": false,
"sourceMap": true,
"name": "scripts",
"fileName": "[name].bundle.js",
"filesToConcat": scripts
}));
plugins.push(new InsertConcatAssetsWebpackPlugin([
"scripts"
]));
}
plugins.push(new GlobCopyWebpackPlugin({
"patterns": [
"assets",
"favicon.ico"
],
"globOptions": {
"cwd": process.cwd() + "/src",
"dot": true,
"ignore": "**/.gitkeep"
}
}));
// drop any unreachable code.
plugins.push(new DefinePlugin({
"process.env.NODE_ENV": "\"production\""
}));
plugins.push(new NoEmitOnErrorsPlugin());
if (scripts.length > 0) {
plugins.push(new ConcatPlugin({
"uglify": false,
"sourceMap": true,
"name": "scripts",
"fileName": "[name].bundle.js",
"filesToConcat": scripts
}));
plugins.push(new InsertConcatAssetsWebpackPlugin([
"scripts"
]));
}
plugins.push(new CopyWebpackPlugin([
{
"context": "src",
"to": "",
"from": {
"glob": "assets/**/*",
"dot": true
}
},
{
"context": "src",
"to": "",
// drop any unreachable code.
//plugins.push(new DefinePlugin({
// "process.env.NODE_ENV": "\"production\""
//}));
plugins.push(new NoEmitOnErrorsPlugin());
if(scripts.length > 0){
plugins.push(new ConcatPlugin({
"uglify": false,
"sourceMap": true,
"name": "scripts",
"fileName": "[name].bundle.js",
"filesToConcat": scripts
}));
plugins.push(new InsertConcatAssetsWebpackPlugin([
"scripts"
]));
}
plugins.push(new GlobCopyWebpackPlugin({
"patterns": [
"assets",
"splash.html"
],
"globOptions": {
"cwd": process.cwd() + "/src",
"dot": true,
"ignore": "**/.gitkeep"
}
}));
// drop any unreachable code.
plugins.push(new DefinePlugin({
"process.env.NODE_ENV": "\"production\""
}));
plugins.push(new NoEmitOnErrorsPlugin());
if (scripts.length > 0) {
plugins.push(new ConcatPlugin({
"uglify": false,
"sourceMap": true,
"name": "scripts",
"fileName": "[name].bundle.js",
"filesToConcat": scripts
}));
plugins.push(new InsertConcatAssetsWebpackPlugin([
"scripts"
]));
}
plugins.push(new GlobCopyWebpackPlugin({
"patterns": [
"assets",
"icon.png"
],
"globOptions": {
"cwd": process.cwd() + "/src",
"dot": true,
"ignore": "**/.gitkeep"
}
}));
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
import {SchematicsProvider} from "./schematicsProvider";
let schematicsUtils = require('@angular/cli/utilities/schematics');
let defaultCollectionName;
try {
defaultCollectionName = require('@angular/cli/utilities/config').getDefaultSchematicCollection();
} catch (e) {
defaultCollectionName = require('@angular/cli/models/config').CliConfig.getValue('defaults.schematics.collection');
}
let engineHost = schematicsUtils.getEngineHost()
const schematicsProvider: Promise = Promise.resolve({
getCollection: schematicsUtils.getCollection,
getSchematic: schematicsUtils.getSchematic,
listSchematics(collection): string[] {
return engineHost.listSchematics(collection)
},
getDefaultSchematicCollection: () => defaultCollectionName
})
export = schematicsProvider;
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
import {Collection, Schematic} from '@angular-devkit/schematics';
import {SchematicsProvider} from "./schematicsProvider";
import {SchematicCommand} from "@angular/cli/models/schematic-command";
let command = new (SchematicCommand as any)({}, null);
let defaultCollectionName;
try {
defaultCollectionName = require('@angular/cli/utilities/config').getDefaultSchematicCollection();
} catch (e) {
defaultCollectionName = require('@angular/cli/models/config').CliConfig.getValue('defaults.schematics.collection');
}
let engineHost = command.getEngineHost();
const schematicsProvider: Promise = Promise.resolve({
getCollection(collectionName: string): Collection {
return command.getCollection(collectionName);
},
listSchematics(collection): string[] {
return engineHost.listSchematics(collection)
},
getSchematic(collection: Collection, schematicName: string, allowPrivate?: boolean): Schematic {
return command.getSchematic(collection, schematicName, allowPrivate);
},
getDefaultSchematicCollection() {
return defaultCollectionName;
}
"use strict"
const path = require('path');
const process = require('process');
let defaultOpts = '--style=scss --routing=false --skip-git';
try {
const ngVersion = require('@angular/cli/package.json');
if (ngVersion.version.startsWith('7') ||
ngVersion.version.startsWith('8')) {
defaultOpts = defaultOpts + ' --enable-ivy'
};
} catch (error) {}
// check if user want to have exntend linking capability
const configOptions = [{
type: 'input',
message: 'What is your solution name?',
name: 'solutionName',
when: (answers) => answers.framework === 'angularelements',
default: path.basename(process.cwd()),
validate: (input) => input.indexOf('-') === -1 && input.indexOf('_') === -1 ? true : 'Dashes or underscores are not allowed in solution name'
},
{
type: 'input',