Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

single-spa-angular

Package Overview
Dependencies
Maintainers
14
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

single-spa-angular - npm Package Compare versions

Comparing version 4.8.0 to 4.9.0

17

lib/webpack/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const webpackMerge = require("webpack-merge");
const path = require("path");

@@ -40,3 +39,3 @@ const fs = require("fs");

};
const mergedConfig = webpackMerge.smart(config, singleSpaConfig);
const mergedConfig = mergeConfigs(config, singleSpaConfig);
if (mergedConfig.output.libraryTarget === 'system') {

@@ -104,3 +103,3 @@ // Don't used named exports when exporting in System.register format.

function getProjectNameFromAngularJson(options) {
const angularJsonPath = find_up_1.findUp(['angular.json', '.angular.json'], process.cwd());
const angularJsonPath = find_up_1.findUp(['angular.json', '.angular.json', 'workspace.json'], process.cwd());
if (!angularJsonPath)

@@ -146,2 +145,14 @@ return null;

}
function mergeConfigs(config, singleSpaConfig) {
// eslint-disable-next-line
const webpackMerge = require('webpack-merge');
try {
// If `merge.smart` is available then it means that Webpack 4 is used.
return webpackMerge.smart(config, singleSpaConfig);
}
catch (_a) {
// `merge.smart` has been dropped in `webpack-merge@5`.
return webpackMerge.default(config, singleSpaConfig);
}
}
//# sourceMappingURL=index.js.map

2

package.json
{
"$schema": "../node_modules/ng-packagr/ng-package.schema.json",
"name": "single-spa-angular",
"version": "4.8.0",
"version": "4.9.0",
"description": "Helpers for building single-spa applications which use Angular 2",

@@ -6,0 +6,0 @@ "schematics": "./schematics/schematics.json",

import { NodeDependency } from '@schematics/angular/utility/dependencies';
export declare function getSingleSpaDependency(): NodeDependency;
export declare function getSingleSpaAngularDependency(): NodeDependency;
/**
* We have to install `@angular-builders/custom-webpack` version compatible with the current
* version of Angular. If Angular is 8 then `custom-webpack@8.4.1` has to be installed.
*/
export declare function getAngularBuildersCustomWebpackDependency(): NodeDependency;
export declare function getAngularBuildersCustomWebpackDependency(): Promise<NodeDependency>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAngularBuildersCustomWebpackDependency = exports.getSingleSpaAngularDependency = exports.getSingleSpaDependency = void 0;
const tslib_1 = require("tslib");
const https = require("https");
const core_1 = require("@angular/core");
const dependencies_1 = require("@schematics/angular/utility/dependencies");

@@ -25,16 +28,54 @@ const { version, peerDependencies, dependencies } = require('../../package.json');

exports.getSingleSpaAngularDependency = getSingleSpaAngularDependency;
/**
* We have to install `@angular-builders/custom-webpack` version compatible with the current
* version of Angular. If Angular is 8 then `custom-webpack@8.4.1` has to be installed.
*/
function getAngularBuildersCustomWebpackDependency() {
const { VERSION } = require('@angular/core');
return {
name: '@angular-builders/custom-webpack',
version: `^${VERSION.major}`,
overwrite: false,
type: dependencies_1.NodeDependencyType.Dev,
};
return tslib_1.__awaiter(this, void 0, void 0, function* () {
return {
name: '@angular-builders/custom-webpack',
overwrite: false,
type: dependencies_1.NodeDependencyType.Dev,
version: yield resolveCustomWebpackVersion(),
};
});
}
exports.getAngularBuildersCustomWebpackDependency = getAngularBuildersCustomWebpackDependency;
function resolveCustomWebpackVersion() {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
let version;
try {
const versions = yield getCustomWebpackVersions();
// We do `filter` because there can be `beta` versions, thus `^11`
// will not work in that case.
const compatibleMajorVersions = versions.filter(version => version.startsWith(core_1.VERSION.major));
version = compatibleMajorVersions.pop() || 'latest';
}
catch (_a) {
// We could actually initialize version with the `latest` value,
// but let's be more imperative and fallback to the `latest` value
// if any exception has occured previously.
version = 'latest';
}
return version;
});
}
function getCustomWebpackVersions() {
return new Promise((resolve, reject) => {
const request = https.get({
protocol: 'https:',
hostname: 'registry.npmjs.com',
path: '/@angular-builders/custom-webpack',
}, (response) => {
const chunks = [];
response
.on('error', reject)
.on('data', chunk => {
chunks.push(chunk);
})
.on('end', () => {
const response = JSON.parse(`${Buffer.concat(chunks)}`);
const versions = Object.keys(response.versions);
resolve(versions);
});
});
request.on('error', reject).end();
});
}
//# sourceMappingURL=dependencies.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addNPMScripts = exports.updateConfiguration = exports.createMainEntry = exports.addDependencies = void 0;
const tslib_1 = require("tslib");
const schematics_1 = require("@angular-devkit/schematics");

@@ -10,3 +11,3 @@ const config_1 = require("@schematics/angular/utility/config");

// starting from version 10, contain comments in `tsconfig` files.
const JSON5 = require("json5");
const json5_1 = require("json5");
const add_scripts_1 = require("./add-scripts");

@@ -29,8 +30,19 @@ const dependencies_2 = require("./dependencies");

];
return (tree, context) => {
for (const dependency of dependencies) {
dependencies_1.addPackageJsonDependency(tree, dependency);
context.logger.info(`Added '${dependency.name}' as a dependency`);
return (tree, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
var e_1, _a;
try {
for (var dependencies_3 = tslib_1.__asyncValues(dependencies), dependencies_3_1; dependencies_3_1 = yield dependencies_3.next(), !dependencies_3_1.done;) {
const dependency = dependencies_3_1.value;
dependencies_1.addPackageJsonDependency(tree, dependency);
context.logger.info(`Added '${dependency.name}' as a dependency`);
}
}
};
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (dependencies_3_1 && !dependencies_3_1.done && (_a = dependencies_3.return)) yield _a.call(dependencies_3);
}
finally { if (e_1) throw e_1.error; }
}
});
}

@@ -116,3 +128,3 @@ exports.addDependencies = addDependencies;

}
const tsConfig = JSON5.parse(buffer.toString());
const tsConfig = json5_1.parse(buffer.toString());
if (!Array.isArray(tsConfig.files)) {

@@ -124,3 +136,3 @@ return;

tsConfig.files = ['src/main.single-spa.ts'];
host.overwrite(tsConfigPath, JSON5.stringify(tsConfig, null, 2));
host.overwrite(tsConfigPath, JSON.stringify(tsConfig, null, 2));
}

@@ -127,0 +139,0 @@ function addNPMScripts(options) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc