angular-calendar
Advanced tools
Comparing version 0.28.0 to 0.28.1
{ | ||
"name": "angular-calendar", | ||
"version": "0.28.0", | ||
"version": "0.28.1", | ||
"description": "A calendar component for angular 6.0+ that can display events on a month, week or day view", | ||
@@ -59,4 +59,4 @@ "funding": "https://github.com/sponsors/mattlewis92", | ||
"@types/moment-timezone": "^0.5.12", | ||
"@types/node": "^12.12.7", | ||
"@types/sinon": "^7.5.0", | ||
"@types/node": "^12.12.11", | ||
"@types/sinon": "^7.5.1", | ||
"@types/sinon-chai": "^3.2.3", | ||
@@ -66,3 +66,3 @@ "angular-cli-ghpages": "^0.5.3", | ||
"angularx-flatpickr": "^6.1.1", | ||
"autoprefixer": "^9.7.1", | ||
"autoprefixer": "^9.7.2", | ||
"bootstrap-css-only": "^4.3.1", | ||
@@ -78,3 +78,3 @@ "chai": "^4.2.0", | ||
"css-loader": "^3.2.0", | ||
"date-fns": "^2.7.0", | ||
"date-fns": "^2.8.0", | ||
"del-cli": "^3.0.0", | ||
@@ -84,3 +84,3 @@ "flatpickr": "^4.6.3", | ||
"highlightjs-loader": "^0.2.3", | ||
"husky": "^3.0.9", | ||
"husky": "^3.1.0", | ||
"karma": "^4.4.1", | ||
@@ -108,7 +108,7 @@ "karma-chrome-launcher": "^3.1.0", | ||
"sinon-chai": "^3.3.0", | ||
"standard-version": "^7.0.0", | ||
"stylelint": "^11.1.1", | ||
"standard-version": "^7.0.1", | ||
"stylelint": "^12.0.0", | ||
"stylelint-config-prettier": "^6.0.0", | ||
"stylelint-config-standard": "^19.0.0", | ||
"ts-node": "^8.5.0", | ||
"ts-node": "^8.5.2", | ||
"tslib": "^1.10.0", | ||
@@ -115,0 +115,0 @@ "tslint": "^5.20.1", |
@@ -62,12 +62,20 @@ "use strict"; | ||
: ng_ast_utils_1.getAppModulePath(host, mainPath); | ||
var moduleSource = utils_1.getSourceFile(host, appModulePath); | ||
var moduleName = "CalendarModule.forRoot({ provide: DateAdapter, useFactory: adapterFactory })"; | ||
var moduleName = "CalendarModule.forRoot({ provide: DateAdapter, useFactory: " + (options.dateAdapter === 'moment' | ||
? 'momentAdapterFactory' | ||
: 'adapterFactory') + " })"; | ||
var moduleCalendarSrc = 'angular-calendar'; | ||
var PEER_DEPENDENCIES = ['DateAdapter', 'adapterFactory']; | ||
utils_1.addModuleImportToRootModule(host, moduleName, moduleCalendarSrc, project); | ||
var peerDependencyChange1 = ast_utils_1.insertImport(moduleSource, appModulePath, PEER_DEPENDENCIES[0], moduleCalendarSrc); | ||
var peerDependencyChange2 = ast_utils_1.insertImport(moduleSource, appModulePath, PEER_DEPENDENCIES[1], moduleCalendarSrc + "/date-adapters/" + options.dateAdapter); | ||
var moduleSource = utils_1.getSourceFile(host, appModulePath); | ||
var updates = [ | ||
ast_utils_1.insertImport(moduleSource, appModulePath, 'DateAdapter', moduleCalendarSrc), | ||
ast_utils_1.insertImport(moduleSource, appModulePath, 'adapterFactory', moduleCalendarSrc + "/date-adapters/" + options.dateAdapter) | ||
]; | ||
if (options.dateAdapter === 'moment') { | ||
updates.push(utils_1.insertWildcardImport(moduleSource, appModulePath, 'moment', 'moment')); | ||
updates.push(utils_1.insertAfterImports(moduleSource, appModulePath, ";\n\nexport function momentAdapterFactory() {\n return adapterFactory(moment);\n}")); | ||
} | ||
var recorder = host.beginUpdate(appModulePath); | ||
recorder.insertLeft(peerDependencyChange1.pos, peerDependencyChange1.toAdd); | ||
recorder.insertLeft(peerDependencyChange2.pos, peerDependencyChange2.toAdd); | ||
updates.forEach(function (update) { | ||
recorder.insertLeft(update.pos, update.toAdd); | ||
}); | ||
host.commitUpdate(recorder); | ||
@@ -74,0 +82,0 @@ return host; |
@@ -7,2 +7,3 @@ "use strict"; | ||
var ng_ast_utils_1 = require("@schematics/angular/utility/ng-ast-utils"); | ||
var ts = require("typescript"); | ||
var file_1 = require("./file"); | ||
@@ -40,1 +41,10 @@ /** | ||
} | ||
function insertAfterImports(source, fileToEdit, toInsert) { | ||
var allImports = ast_utils_1.findNodes(source, ts.SyntaxKind.ImportDeclaration); | ||
return ast_utils_1.insertAfterLastOccurrence(allImports, toInsert, fileToEdit, 0, ts.SyntaxKind.StringLiteral); | ||
} | ||
exports.insertAfterImports = insertAfterImports; | ||
function insertWildcardImport(source, fileToEdit, symbolName, fileName) { | ||
return insertAfterImports(source, fileToEdit, ";\nimport * as " + symbolName + " from '" + fileName + "'"); | ||
} | ||
exports.insertWildcardImport = insertWildcardImport; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2552212
20902