Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions schematics/scully/src/ng-add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default (options: Schema): Rule => {
runScullySchematic(options),
]);
};

const addDependencies = () => (tree: Tree, context: SchematicContext) => {
addPackageToPackageJson(tree, '@scullyio/scully', `${scullyVersion}`);
const ngCoreVersionTag = getPackageVersionFromPackageJson(tree, '@angular/core');
Expand Down Expand Up @@ -97,9 +96,14 @@ const injectIdleService = () => (tree: Tree, context: SchematicContext) => {
if (appComponent.includes('IdleMonitorService')) {
context.logger.info(`⚠️️ Skipping ${appComponentPath}`);
} else {
const idleImport = `import {IdleMonitorService} from '@scullyio/ng-lib';`;
const ngCoreVersionTag = getPackageVersionFromPackageJson(tree, '@angular/core');
let v8 = '';
if (+ngCoreVersionTag.search(/(\^8|~8)/g) === 0) {
v8 = '-8';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New version of lib I'm working on is called:
ng-lib-v8 <- notice the v

}
const idleImport = `import {IdleMonitorService} from '@scullyio/ng-lib${v8}';`;
// add
const idImport = `${idleImport} \n ${appComponent}`;
const idImport = `${idleImport}\n${appComponent}`;
const idle = 'private idle: IdleMonitorService';
let output = '';
// check if exist
Expand Down