From 658ecf5d563395b92307c9fc59c42ee6ca319e98 Mon Sep 17 00:00:00 2001 From: Jan Vennemann Date: Fri, 29 Nov 2019 00:06:27 +0100 Subject: [PATCH 01/19] refactor: use external compiler package --- Alloy/commands/compile/index.js | 525 +-- package-lock.json | 5595 +++++++++++++++++++++++++++++++ package.json | 4 +- 3 files changed, 5687 insertions(+), 437 deletions(-) diff --git a/Alloy/commands/compile/index.js b/Alloy/commands/compile/index.js index 12d054b42..83804ce7a 100755 --- a/Alloy/commands/compile/index.js +++ b/Alloy/commands/compile/index.js @@ -5,24 +5,28 @@ var ejs = require('ejs'), chmodr = require('chmodr'), vm = require('vm'), babel = require('@babel/core'), - async = require('async'), // alloy requires _ = require('lodash'), - logger = require('../../logger'), - U = require('../../utils'), - tiapp = require('../../tiapp'), - CONST = require('../../common/constants'), - platforms = require('../../../platforms/index'), // alloy compiler requires - CU = require('./compilerUtils'), - styler = require('./styler'), - sourceMapper = require('./sourceMapper'), CompilerMakeFile = require('./CompilerMakeFile'), - BuildLog = require('./BuildLog'), Orphanage = require('./Orphanage'); +const { + BuildLog, + createCompileConfig, + createCompiler, + sourceMapper, + utils: CU +} = require('alloy-compiler'); +const { + constants: CONST, + logger, + platforms, + utils: U +} = require('alloy-utils'); + var alloyRoot = path.join(__dirname, '..', '..'), viewRegex = new RegExp('\\.' + CONST.FILE_EXT.VIEW + '$'), controllerRegex = new RegExp('\\.' + CONST.FILE_EXT.CONTROLLER + '$'), @@ -34,7 +38,8 @@ var alloyRoot = path.join(__dirname, '..', '..'), buildLog, theme, platformTheme, - widgetIds = []; + widgetIds = [], + compiler; var times = { first: null, @@ -61,10 +66,6 @@ module.exports = function(args, program) { // Initialize modules used throughout the compile process buildLog = new BuildLog(paths.project); - tiapp.init(path.join(paths.project, 'tiapp.xml')); - - // validate the current Titanium SDK version, exit on failure - tiapp.validateSdkVersion(); // construct compiler config from command line config parameters // and print the configuration data @@ -159,8 +160,11 @@ module.exports = function(args, program) { // create compile config from paths and various alloy config files logger.debug('----- CONFIG.JSON -----'); - // NOTE: the following line creates the Resources/alloy/CFG.js and Resources//alloy/CFG.js - compileConfig = CU.createCompileConfig(paths.app, paths.project, alloyConfig, buildLog); + compileConfig = createCompileConfig({ + projectDir: paths.project, + buildLog, + alloyConfig + }); theme = compileConfig.theme; platformTheme = buildLog.data[buildPlatform] ? buildLog.data[buildPlatform]['theme'] : ''; @@ -404,9 +408,7 @@ module.exports = function(args, program) { logger.info('----- MVC GENERATION -----'); - // create the global style, if it exists - styler.setPlatform(buildPlatform); - styler.loadGlobalStyles(paths.app, theme ? {theme:theme} : {}); + compiler = createCompiler({ compileConfig }); // Create collection of all widget and app paths var widgetDirs = U.getWidgetDirectories(paths.app); @@ -448,7 +450,7 @@ module.exports = function(args, program) { // generate runtime controller logger.info('[' + view + '] ' + (collection.manifest ? collection.manifest.id + ' ' : '') + 'view processing...'); - parseAlloyComponent(view, collection.dir, collection.manifest, null, restrictionPath); + parseAlloyComponentNew(view, collection.dir, collection.manifest, null, restrictionPath); tracker[fp] = true; } }); @@ -470,7 +472,7 @@ module.exports = function(args, program) { // generate runtime controller logger.info('[' + controller + '] ' + (collection.manifest ? collection.manifest.id + ' ' : '') + 'controller processing...'); - parseAlloyComponent(controller, collection.dir, collection.manifest, true, restrictionPath); + parseAlloyComponentNew(controller, collection.dir, collection.manifest, true, restrictionPath); tracker[fp] = true; } }); @@ -480,13 +482,6 @@ module.exports = function(args, program) { generateAppJs(paths, compileConfig, restrictionPath, compilerMakeFile); - // ALOY-905: workaround TiSDK < 3.2.0 iOS device build bug where it can't reference app.js - // in platform-specific folders, so we just copy the platform-specific one to - // the Resources folder. - if (buildPlatform === 'ios' && tiapp.version.lt('3.2.0')) { - U.copyFileSync(path.join(paths.resources, titaniumFolder, 'app.js'), path.join(paths.resources, 'app.js')); - } - // optimize code logger.info('----- OPTIMIZING -----'); @@ -584,343 +579,53 @@ function matchesRestriction(files, fileRestriction) { return matches; } -function parseAlloyComponent(view, dir, manifest, noView, fileRestriction) { - var parseType = noView ? 'controller' : 'view'; - fileRestriction = fileRestriction || null; +function parseAlloyComponentNew(view, dir, manifest, noView, fileRestriction) { + const parseType = noView ? 'controller' : 'view'; + if (!view) { + U.die('Undefined ' + parseType + ' passed to parseAlloyComponent()'); + } + if (!dir) { + U.die('Failed to parse ' + parseType + ' "' + view + '", no directory given'); + } - // validate parameters - if (!view) { U.die('Undefined ' + parseType + ' passed to parseAlloyComponent()'); } - if (!dir) { U.die('Failed to parse ' + parseType + ' "' + view + '", no directory given'); } - - var dirRegex = new RegExp('^(?:' + CONST.PLATFORM_FOLDERS_ALLOY.join('|') + ')[\\\\\\/]*'); - var basename = path.basename(view, '.' + CONST.FILE_EXT[parseType.toUpperCase()]), - dirname = path.dirname(view).replace(dirRegex, ''), - viewName = basename, - template = { - viewCode: '', - modelVariable: CONST.BIND_MODEL_VAR, - parentVariable: CONST.PARENT_SYMBOL_VAR, - itemTemplateVariable: CONST.ITEM_TEMPLATE_VAR, - controllerPath: (dirname ? path.join(dirname, viewName) : viewName).replace(/\\/g, '/'), - preCode: '', - postCode: '', - Widget: !manifest ? '' : 'var ' + CONST.WIDGET_OBJECT + - " = new (require('/alloy/widget'))('" + manifest.id + "');this.__widgetId='" + - manifest.id + "';", - WPATH: !manifest ? '' : _.template(fs.readFileSync(path.join(alloyRoot, 'template', 'wpath.js'), 'utf8'))({ WIDGETID: manifest.id }), - __MAPMARKER_CONTROLLER_CODE__: '', - ES6Mod: '' - }, - widgetDir = dirname ? path.join(CONST.DIR.COMPONENT, dirname) : CONST.DIR.COMPONENT, - widgetStyleDir = dirname ? path.join(CONST.DIR.RUNTIME_STYLE, dirname) : - CONST.DIR.RUNTIME_STYLE, - state = { parent: {}, styles: [] }, - files = {}; - - // reset the bindings map - styler.bindingsMap = {}; - CU.destroyCode = ''; - CU.postCode = ''; - CU[CONST.AUTOSTYLE_PROPERTY] = compileConfig[CONST.AUTOSTYLE_PROPERTY]; - CU.currentManifest = manifest; - CU.currentDefaultId = viewName; - - // create a list of file paths - var searchPaths = noView ? ['CONTROLLER'] : ['VIEW', 'STYLE', 'CONTROLLER']; - _.each(searchPaths, function(fileType) { - // get the path values for the file - var fileTypeRoot = path.join(dir, CONST.DIR[fileType]); - var filename = viewName + '.' + CONST.FILE_EXT[fileType]; - var filepath = dirname ? path.join(dirname, filename) : filename; - - // check for platform-specific versions of the file - var baseFile = path.join(fileTypeRoot, filepath); - if (buildPlatform) { - var platformSpecificFile = path.join(fileTypeRoot, buildPlatform, filepath); - if (fs.existsSync(platformSpecificFile)) { - if (fileType === 'STYLE') { - files[fileType] = [ - { file:baseFile }, - { file:platformSpecificFile, platform:true } - ]; - } else { - files[fileType] = platformSpecificFile; - } - return; - } - } - files[fileType] = baseFile; - }); + const meta = compiler.resolveComponentMeta(path.join(dir, `${parseType}s`, view)); + const { componentName: viewName, subPath: dirname, files } = meta; + const { componentOutputPath, styleOutputPath } = resolveOutputPaths(viewName, dirname, manifest, files); + fileRestriction = fileRestriction || null; if (fileRestriction !== null && !matchesRestriction(files, fileRestriction)) { logger.info(' Not matching the file restriction, skipping'); return; } - _.each(['COMPONENT', 'RUNTIME_STYLE'], function(fileType) { - files[fileType] = path.join(compileConfig.dir.resources, 'alloy', CONST.DIR[fileType]); - if (dirname) { files[fileType] = path.join(files[fileType], dirname); } - files[fileType] = path.join(files[fileType], viewName + '.js'); + // generate component file + const { code, map } = compiler.compileComponent({ + file: parseType === 'controller' ? files.CONTROLLER : files.VIEW }); - - // we are processing a view, not just a controller - if (!noView) { - // validate view - if (!fs.existsSync(files.VIEW)) { - logger.warn('No ' + CONST.FILE_EXT.VIEW + ' view file found for view ' + files.VIEW); - return; - } - - // load global style, if present - state.styles = styler.globalStyle || []; - - // Load the style and update the state - if (files.STYLE) { - var theStyles = _.isArray(files.STYLE) ? files.STYLE : [{file:files.STYLE}]; - _.each(theStyles, function(style) { - if (fs.existsSync(style.file)) { - logger.info(' style: "' + - path.relative(path.join(dir, CONST.DIR.STYLE), style.file) + '"'); - state.styles = styler.loadAndSortStyle(style.file, { - existingStyle: state.styles, - platform: style.platform - }); - } - }); - } - - if (theme) { - // if a theme is applied, override TSS definitions with those defined in the theme - var themeStylesDir, theStyle, themeStylesFile, psThemeStylesFile; - if (!manifest) { - // theming a "normal" controller - themeStylesDir = path.join(compileConfig.dir.themes, theme, 'styles'); - theStyle = dirname ? path.join(dirname, viewName + '.tss') : viewName + '.tss'; - themeStylesFile = path.join(themeStylesDir, theStyle); - psThemeStylesFile = path.join(themeStylesDir, buildPlatform, theStyle); - } else { - // theming a widget - themeStylesDir = path.join(compileConfig.dir.themes, theme, 'widgets', manifest.id, 'styles'); - theStyle = dirname ? path.join(dirname, viewName + '.tss') : viewName + '.tss'; - themeStylesFile = path.join(themeStylesDir, theStyle); - psThemeStylesFile = path.join(themeStylesDir, buildPlatform, theStyle); - } - - if (fs.existsSync(themeStylesFile)) { - // load theme-specific styles, overriding default definitions - logger.info(' theme: "' + path.join(theme.toUpperCase(), theStyle) + '"'); - state.styles = styler.loadAndSortStyle(themeStylesFile, { - existingStyle: state.styles, - theme: true - }); - } - if (fs.existsSync(psThemeStylesFile)) { - // load theme- and platform-specific styles, overriding default definitions - logger.info(' theme: "' + - path.join(theme.toUpperCase(), buildPlatform, theStyle) + '"'); - state.styles = styler.loadAndSortStyle(psThemeStylesFile, { - existingStyle: state.styles, - platform: true, - theme: true - }); - } - } - - // Load view from file into an XML document root node - var docRoot; - try { - logger.info(' view: "' + - path.relative(path.join(dir, CONST.DIR.VIEW), files.VIEW) + '"'); - docRoot = U.XML.getAlloyFromFile(files.VIEW); - } catch (e) { - U.die([ - e.stack, - 'Error parsing XML for view "' + view + '"' - ]); - } - - // see if autoStyle is enabled for the view - if (docRoot.hasAttribute(CONST.AUTOSTYLE_PROPERTY)) { - CU[CONST.AUTOSTYLE_PROPERTY] = - docRoot.getAttribute(CONST.AUTOSTYLE_PROPERTY) === 'true'; - } - - // see if module attribute has been set on the docRoot () tag for the view - if (docRoot.hasAttribute(CONST.DOCROOT_MODULE_PROPERTY)) { - CU[CONST.DOCROOT_MODULE_PROPERTY] = docRoot.getAttribute(CONST.DOCROOT_MODULE_PROPERTY); - } else { - CU[CONST.DOCROOT_MODULE_PROPERTY] = null; - } - - // see if baseController attribute has been set on the docRoot () tag for the view - if (docRoot.hasAttribute(CONST.DOCROOT_BASECONTROLLER_PROPERTY)) { - CU[CONST.DOCROOT_BASECONTROLLER_PROPERTY] = '"' + docRoot.getAttribute(CONST.DOCROOT_BASECONTROLLER_PROPERTY) + '"'; - } else { - CU[CONST.DOCROOT_BASECONTROLLER_PROPERTY] = null; - } - - // make sure we have a Window, TabGroup, or SplitWindow - var rootChildren = U.XML.getElementsFromNodes(docRoot.childNodes); - if (viewName === 'index' && !dirname) { - var valid = [ - 'Ti.UI.Window', - 'Ti.UI.iOS.SplitWindow', - 'Ti.UI.TabGroup', - 'Ti.UI.iOS.NavigationWindow', - 'Ti.UI.NavigationWindow' - ].concat(CONST.MODEL_ELEMENTS); - _.each(rootChildren, function(node) { - var found = true; - var args = CU.getParserArgs(node, {}, { doSetId: false }); - - if (args.fullname === 'Alloy.Require') { - var inspect = CU.inspectRequireNode(node); - for (var j = 0; j < inspect.names.length; j++) { - if (!_.includes(valid, inspect.names[j])) { - found = false; - break; - } - } - } else { - found = _.includes(valid, args.fullname); - } - - if (!found) { - U.die([ - 'Compile failed. index.xml must have a top-level container element.', - 'Valid elements: [' + valid.join(',') + ']' - ]); - } - }); - } - - // process any model/collection nodes - _.each(rootChildren, function(node, i) { - var fullname = CU.getNodeFullname(node); - var isModelElement = _.includes(CONST.MODEL_ELEMENTS, fullname); - - if (isModelElement) { - var vCode = CU.generateNode(node, state, undefined, false, true); - template.viewCode += vCode.content; - template.preCode += vCode.pre; - - // remove the model/collection nodes when done - docRoot.removeChild(node); - } - }); - - // rebuild the children list since model elements have been removed - rootChildren = U.XML.getElementsFromNodes(docRoot.childNodes); - - // process the UI nodes - _.each(rootChildren, function(node, i) { - // should we use the default id? - var defaultId = CU.isNodeForCurrentPlatform(node) ? viewName : undefined; - - // generate the code for this node - var fullname = CU.getNodeFullname(node); - template.viewCode += CU.generateNode(node, { - parent:{}, - styles:state.styles, - widgetId: manifest ? manifest.id : undefined, - parentFormFactor: node.hasAttribute('formFactor') ? node.getAttribute('formFactor') : undefined - }, defaultId, true); - }); - } - - // process the controller code - if (fs.existsSync(files.CONTROLLER)) { - logger.info(' controller: "' + - path.relative(path.join(dir, CONST.DIR.CONTROLLER), files.CONTROLLER) + '"'); - } - var cCode = CU.loadController(files.CONTROLLER); - template.parentController = (cCode.parentControllerName !== '') ? - cCode.parentControllerName : CU[CONST.DOCROOT_BASECONTROLLER_PROPERTY] || "'BaseController'"; - template.__MAPMARKER_CONTROLLER_CODE__ += cCode.controller; - template.preCode += cCode.pre; - template.ES6Mod += cCode.es6mods; - - // for each model variable in the bindings map... - _.each(styler.bindingsMap, function(mapping, modelVar) { - - // open the model binding handler - var handlerVar = CU.generateUniqueId(); - template.viewCode += 'var ' + handlerVar + ' = function() {'; - - _.each(mapping.models, function(modelVar) { - template.viewCode += modelVar + '.__transform = _.isFunction(' + modelVar + '.transform) ? ' + modelVar + '.transform() : ' + modelVar + '.toJSON();'; - }); - - CU.destroyCode += modelVar + ' && ' + ((state.parentFormFactor) ? 'is' + U.ucfirst(state.parentFormFactor) : '' ) + - modelVar + ".off('" + CONST.MODEL_BINDING_EVENTS + "'," + handlerVar + ');'; - - // for each specific conditional within the bindings map.... - _.each(_.groupBy(mapping.bindings, function(b) {return b.condition;}), function(bindings, condition) { - var bCode = ''; - - // for each binding belonging to this model/conditional pair... - _.each(bindings, function(binding) { - bCode += '$.' + binding.id + '.' + binding.prop + ' = ' + binding.val + ';'; - }); - - // if this is a legit conditional, wrap the binding code in it - if (typeof condition !== 'undefined' && condition !== 'undefined') { - bCode = 'if(' + condition + '){' + bCode + '}'; - } - template.viewCode += bCode; - - }); - template.viewCode += '};'; - template.viewCode += modelVar + ".on('" + CONST.MODEL_BINDING_EVENTS + "'," + - handlerVar + ');'; + let finalCode = code; + const relativeOutfile = path.relative(compileConfig.dir.project, componentOutputPath); + if (compileConfig.sourcemap !== false) { + const mapDir = path.join(compileConfig.dir.project, CONST.DIR.MAP); + const sourceMapOutputPath = `${path.join(mapDir, relativeOutfile)}.${CONST.FILE_EXT.MAP}`; + fs.outputFileSync(sourceMapOutputPath, map.toString()); + finalCode += `\n//# sourceMappingURL=file://${sourceMapOutputPath}`; + } + fs.outputFileSync(componentOutputPath, finalCode); + logger.info(' created: "' + relativeOutfile + '"'); + + // generate runtime style file + const styleFiles = Array.isArray(files.STYLE) ? files.STYLE : [ files.STYLE ]; + const { code: styleCode } = compiler.compileStyle({ + file: styleFiles[0] }); + fs.outputFileSync(styleOutputPath, styleCode); - // add destroy() function to view for cleaning up bindings - template.viewCode += 'exports.destroy = function () {' + CU.destroyCode + '};'; - - // add dataFunction of original name (if data-binding with form factor has been used) - if (!_.isEmpty(CU.dataFunctionNames)) { - _.each(Object.keys(CU.dataFunctionNames), function(funcName) { - template.viewCode += 'function ' + funcName + '() { '; - _.each(CU.dataFunctionNames[funcName], function(formFactor) { - template.viewCode += ' if(Alloy.is' + U.ucfirst(formFactor) + ') { ' + funcName + U.ucfirst(formFactor) + '(); } '; - }); - template.viewCode += '}'; - }); - } - - // add any postCode after the controller code - template.postCode += CU.postCode; - - // create generated controller module code for this view/controller or widget - var controllerCode = template.__MAPMARKER_CONTROLLER_CODE__; - delete template.__MAPMARKER_CONTROLLER_CODE__; - var code = _.template(fs.readFileSync(path.join(compileConfig.dir.template, 'component.js'), 'utf8'))(template); - - // prep the controller paths based on whether it's an app - // controller or widget controller - var targetFilepath = path.join(compileConfig.dir.resources, titaniumFolder, - path.relative(compileConfig.dir.resources, files.COMPONENT)); - var runtimeStylePath = path.join(compileConfig.dir.resources, titaniumFolder, - path.relative(compileConfig.dir.resources, files.RUNTIME_STYLE)); if (manifest) { - fs.mkdirpSync( - path.join(compileConfig.dir.resources, titaniumFolder, 'alloy', CONST.DIR.WIDGET, - manifest.id, widgetDir) - ); - chmodr.sync(path.join(compileConfig.dir.resources, titaniumFolder, 'alloy', CONST.DIR.WIDGET, - manifest.id, widgetDir), 0755); - fs.mkdirpSync( - path.join(compileConfig.dir.resources, titaniumFolder, 'alloy', CONST.DIR.WIDGET, - manifest.id, widgetStyleDir) - ); - chmodr.sync(path.join(compileConfig.dir.resources, titaniumFolder, 'alloy', CONST.DIR.WIDGET, - manifest.id, widgetStyleDir), 0755); - - // [ALOY-967] merge "i18n" dir in widget folder + // merge widget i18n and copy resources (but only once for every widget) + if (widgetIds.includes(manifest.id)) { + return; + } CU.mergeI18N(path.join(dir, 'i18n'), path.join(compileConfig.dir.project, 'i18n'), { override: false }); - widgetIds.push(manifest.id); - CU.copyWidgetResources( [path.join(dir, CONST.DIR.ASSETS), path.join(dir, CONST.DIR.LIB)], path.join(compileConfig.dir.resources, titaniumFolder), @@ -932,95 +637,43 @@ function parseAlloyComponent(view, dir, manifest, noView, fileRestriction) { theme: theme } ); - targetFilepath = path.join( + widgetIds.push(manifest.id); + } +} + +/** + * Resolve the output paths based on whether it's an app controller or widget + * controller. + * + * @param {*} view + * @param {*} dirname + * @param {*} manifest + * @param {*} files + */ +function resolveOutputPaths(viewName, dirname, manifest, files) { + var componentOutputPath = path.join(compileConfig.dir.resources, titaniumFolder, + path.relative(compileConfig.dir.resources, files.COMPONENT)); + var styleOutputPath = path.join(compileConfig.dir.resources, titaniumFolder, + path.relative(compileConfig.dir.resources, files.RUNTIME_STYLE)); + if (manifest) { + const widgetDir = dirname ? path.join(CONST.DIR.COMPONENT, dirname) : CONST.DIR.COMPONENT; + const widgetStyleDir = dirname + ? path.join(CONST.DIR.RUNTIME_STYLE, dirname) + : CONST.DIR.RUNTIME_STYLE; + componentOutputPath = path.join( compileConfig.dir.resources, titaniumFolder, 'alloy', CONST.DIR.WIDGET, manifest.id, widgetDir, viewName + '.js' ); - runtimeStylePath = path.join( + styleOutputPath = path.join( compileConfig.dir.resources, titaniumFolder, 'alloy', CONST.DIR.WIDGET, manifest.id, widgetStyleDir, viewName + '.js' ); } - // generate the code and source map for the current controller - sourceMapper.generateCodeAndSourceMap({ - target: { - filename: path.relative(compileConfig.dir.project, files.COMPONENT), - filepath: targetFilepath, - templateContent: code - }, - data: { - __MAPMARKER_CONTROLLER_CODE__: { - filename: path.relative(compileConfig.dir.project, files.CONTROLLER), - fileContent: controllerCode - } - } - }, compileConfig); - - // initiate runtime style module creation - var relativeStylePath = path.relative(compileConfig.dir.project, runtimeStylePath); - logger.info(' created: "' + relativeStylePath + '"'); - - // skip optimize process, as the file is an alloy component - restrictionSkipOptimize = (fileRestriction !== null); - - // pre-process runtime controllers to save runtime performance - var STYLE_PLACEHOLDER = '__STYLE_PLACEHOLDER__'; - var STYLE_REGEX = new RegExp('[\'"]' + STYLE_PLACEHOLDER + '[\'"]'); - var processedStyles = []; - _.each(state.styles, function(s) { - var o = {}; - - // make sure this style entry applies to the current platform - if (s && s.queries && s.queries.platform && - !_.includes(s.queries.platform, buildPlatform)) { - return; - } - - // get the runtime processed version of the JSON-safe style - var processed = '{' + styler.processStyle(s.style, state) + '}'; - - // create a temporary style object, sans style key - _.each(s, function(v, k) { - if (k === 'queries') { - var queriesObj = {}; - - // optimize style conditionals for runtime - _.each(s[k], function(query, queryKey) { - if (queryKey === 'platform') { - // do nothing, we don't need the platform key anymore - } else if (queryKey === 'formFactor') { - queriesObj[queryKey] = 'is' + U.ucfirst(query); - } else if (queryKey === 'if') { - queriesObj[queryKey] = query; - } else { - logger.warn('Unknown device query "' + queryKey + '"'); - } - }); - - // add the queries object, if not empty - if (!_.isEmpty(queriesObj)) { - o[k] = queriesObj; - } - } else if (k !== 'style') { - o[k] = v; - } - }); - - // Create a full processed style string by inserting the processed style - // into the JSON stringifed temporary style object - o.style = STYLE_PLACEHOLDER; - processedStyles.push(JSON.stringify(o).replace(STYLE_REGEX, processed)); - }); - - // write out the pre-processed styles to runtime module files - var styleCode = 'module.exports = [' + processedStyles.join(',') + '];'; - if (manifest) { - styleCode += _.template(fs.readFileSync(path.join(alloyRoot, 'template', 'wpath.js'), 'utf8'))({ WIDGETID: manifest.id }); - } - fs.mkdirpSync(path.dirname(runtimeStylePath)); - chmodr.sync(path.dirname(runtimeStylePath), 0755); - fs.writeFileSync(runtimeStylePath, styleCode); + return { + componentOutputPath, + styleOutputPath + }; } function findModelMigrations(name, inDir) { @@ -1111,7 +764,7 @@ function processModels(dirs) { function updateFilesWithBuildLog(src, dst, opts) { // filter on retrictionPath if (opts.restrictionPath === null || _.find(opts.restrictionPath, function(f) {return f.indexOf(src) === 0;})) { - var updatedFiles = U.updateFiles(src, dst, _.extend({ isNew: buildLog.isNew }, opts)); + var updatedFiles = CU.updateFiles(src, dst, _.extend({ isNew: buildLog.isNew }, opts)); if (typeof updatedFiles == 'object' && updatedFiles.length > 0 && opts.restrictionPath !== null) { fileRestrictionUpdatedFiles = _.union(fileRestrictionUpdatedFiles, updatedFiles); diff --git a/package-lock.json b/package-lock.json index cffc4a136..84c772bde 100644 --- a/package-lock.json +++ b/package-lock.json @@ -396,6 +396,5601 @@ "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", "dev": true }, + "alloy-compiler": { + "version": "file:../alloy-compiler", + "requires": { + "@babel/generator": "^7.7.2", + "@babel/parser": "^7.7.3", + "@babel/traverse": "^7.7.2", + "@babel/types": "^7.7.2", + "alloy-utils": "file:../alloy-utils", + "chmodr": "^1.2.0", + "fs-extra": "^8.1.0", + "jsonlint": "^1.6.3", + "lodash": "^4.17.15", + "node.extend": "^2.0.2", + "walk-sync": "^2.0.2", + "xmldom": "^0.1.27" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "bundled": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/core": { + "version": "7.7.4", + "bundled": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.4", + "@babel/helpers": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "json5": "^2.1.0", + "lodash": "^4.17.13", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "@babel/generator": { + "version": "7.7.4", + "bundled": true, + "requires": { + "@babel/types": "^7.7.4", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.7.4", + "bundled": true, + "requires": { + "@babel/helper-get-function-arity": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.4", + "bundled": true, + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.4", + "bundled": true, + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/parser": { + "version": "7.7.4", + "bundled": true + }, + "@babel/template": { + "version": "7.7.4", + "bundled": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/traverse": { + "version": "7.7.4", + "bundled": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.4", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + } + }, + "@babel/types": { + "version": "7.7.4", + "bundled": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "semver": { + "version": "5.7.1", + "bundled": true + } + } + }, + "@babel/generator": { + "version": "7.7.2", + "bundled": true, + "requires": { + "@babel/types": "^7.7.2", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.7.0", + "bundled": true, + "requires": { + "@babel/helper-get-function-arity": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.0", + "bundled": true, + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.0.0", + "bundled": true + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.0", + "bundled": true, + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/helpers": { + "version": "7.7.4", + "bundled": true, + "requires": { + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" + }, + "dependencies": { + "@babel/generator": { + "version": "7.7.4", + "bundled": true, + "requires": { + "@babel/types": "^7.7.4", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.7.4", + "bundled": true, + "requires": { + "@babel/helper-get-function-arity": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.4", + "bundled": true, + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.4", + "bundled": true, + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/parser": { + "version": "7.7.4", + "bundled": true + }, + "@babel/template": { + "version": "7.7.4", + "bundled": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/traverse": { + "version": "7.7.4", + "bundled": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.4", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + } + }, + "@babel/types": { + "version": "7.7.4", + "bundled": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + } + } + }, + "@babel/highlight": { + "version": "7.5.0", + "bundled": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.7.3", + "bundled": true + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.7.4", + "bundled": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/template": { + "version": "7.7.0", + "bundled": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/traverse": { + "version": "7.7.2", + "bundled": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.2", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/parser": "^7.7.2", + "@babel/types": "^7.7.2", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + } + }, + "@babel/types": { + "version": "7.7.2", + "bundled": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "@cnakazawa/watch": { + "version": "1.0.3", + "bundled": true, + "requires": { + "exec-sh": "^0.3.2", + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true + } + } + }, + "@jest/console": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/source-map": "^24.9.0", + "chalk": "^2.0.1", + "slash": "^2.0.0" + } + }, + "@jest/core": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/console": "^24.7.1", + "@jest/reporters": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "graceful-fs": "^4.1.15", + "jest-changed-files": "^24.9.0", + "jest-config": "^24.9.0", + "jest-haste-map": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-regex-util": "^24.3.0", + "jest-resolve": "^24.9.0", + "jest-resolve-dependencies": "^24.9.0", + "jest-runner": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-snapshot": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", + "jest-watcher": "^24.9.0", + "micromatch": "^3.1.10", + "p-each-series": "^1.0.0", + "realpath-native": "^1.1.0", + "rimraf": "^2.5.4", + "slash": "^2.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-escapes": { + "version": "3.2.0", + "bundled": true + } + } + }, + "@jest/environment": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/fake-timers": "^24.9.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "jest-mock": "^24.9.0" + } + }, + "@jest/fake-timers": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/types": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-mock": "^24.9.0" + } + }, + "@jest/reporters": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/environment": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "glob": "^7.1.2", + "istanbul-lib-coverage": "^2.0.2", + "istanbul-lib-instrument": "^3.0.1", + "istanbul-lib-report": "^2.0.4", + "istanbul-lib-source-maps": "^3.0.1", + "istanbul-reports": "^2.2.6", + "jest-haste-map": "^24.9.0", + "jest-resolve": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-util": "^24.9.0", + "jest-worker": "^24.6.0", + "node-notifier": "^5.4.2", + "slash": "^2.0.0", + "source-map": "^0.6.0", + "string-length": "^2.0.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true + } + } + }, + "@jest/source-map": { + "version": "24.9.0", + "bundled": true, + "requires": { + "callsites": "^3.0.0", + "graceful-fs": "^4.1.15", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true + } + } + }, + "@jest/test-result": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/console": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/istanbul-lib-coverage": "^2.0.0" + } + }, + "@jest/test-sequencer": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/test-result": "^24.9.0", + "jest-haste-map": "^24.9.0", + "jest-runner": "^24.9.0", + "jest-runtime": "^24.9.0" + } + }, + "@jest/transform": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/types": "^24.9.0", + "babel-plugin-istanbul": "^5.1.0", + "chalk": "^2.0.1", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.1.15", + "jest-haste-map": "^24.9.0", + "jest-regex-util": "^24.9.0", + "jest-util": "^24.9.0", + "micromatch": "^3.1.10", + "pirates": "^4.0.1", + "realpath-native": "^1.1.0", + "slash": "^2.0.0", + "source-map": "^0.6.1", + "write-file-atomic": "2.4.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true + } + } + }, + "@jest/types": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@types/babel__core": { + "version": "7.1.3", + "bundled": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "@types/babel__generator": { + "version": "7.6.0", + "bundled": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@types/babel__template": { + "version": "7.0.2", + "bundled": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@types/babel__traverse": { + "version": "7.0.8", + "bundled": true, + "requires": { + "@babel/types": "^7.3.0" + } + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.1", + "bundled": true + }, + "@types/istanbul-lib-report": { + "version": "1.1.1", + "bundled": true, + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "1.1.1", + "bundled": true, + "requires": { + "@types/istanbul-lib-coverage": "*", + "@types/istanbul-lib-report": "*" + } + }, + "@types/json-schema": { + "version": "7.0.3", + "bundled": true + }, + "@types/minimatch": { + "version": "3.0.3", + "bundled": true + }, + "@types/stack-utils": { + "version": "1.0.1", + "bundled": true + }, + "@types/yargs": { + "version": "13.0.3", + "bundled": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "13.1.0", + "bundled": true + }, + "@typescript-eslint/experimental-utils": { + "version": "2.8.0", + "bundled": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "2.8.0", + "eslint-scope": "^5.0.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "2.8.0", + "bundled": true, + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash.unescape": "4.0.1", + "semver": "^6.3.0", + "tsutils": "^3.17.1" + } + }, + "JSV": { + "version": "4.0.2", + "bundled": true + }, + "abab": { + "version": "2.0.3", + "bundled": true + }, + "acorn": { + "version": "7.1.0", + "bundled": true + }, + "acorn-globals": { + "version": "4.3.4", + "bundled": true, + "requires": { + "acorn": "^6.0.1", + "acorn-walk": "^6.0.1" + }, + "dependencies": { + "acorn": { + "version": "6.3.0", + "bundled": true + } + } + }, + "acorn-jsx": { + "version": "5.1.0", + "bundled": true + }, + "acorn-walk": { + "version": "6.2.0", + "bundled": true + }, + "ajv": { + "version": "6.10.2", + "bundled": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "alloy-utils": { + "version": "file:../alloy-utils", + "bundled": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "chmodr": "^1.2.0", + "colors": "^1.4.0", + "fs-extra": "^8.1.0", + "global-paths": "^1.0.0", + "jsonlint": "^1.6.3", + "lodash": "^4.17.15", + "resolve": "^1.12.0", + "walk-sync": "^2.0.2", + "xmldom": "^0.1.27" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "bundled": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.5.0", + "bundled": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "bundled": true + }, + "JSV": { + "version": "4.0.2", + "bundled": true + }, + "ansi-styles": { + "version": "3.2.1", + "bundled": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "array-unique": { + "version": "0.3.2", + "bundled": true + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chalk": { + "version": "2.4.2", + "bundled": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chmodr": { + "version": "1.2.0", + "bundled": true + }, + "color-convert": { + "version": "1.9.3", + "bundled": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "bundled": true + }, + "colors": { + "version": "1.4.0", + "bundled": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "ensure-posix-path": { + "version": "1.1.1", + "bundled": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "bundled": true + }, + "esutils": { + "version": "2.0.3", + "bundled": true + }, + "fs-extra": { + "version": "8.1.0", + "bundled": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "global-modules": { + "version": "0.2.3", + "bundled": true, + "requires": { + "global-prefix": "^0.1.4", + "is-windows": "^0.2.0" + }, + "dependencies": { + "is-windows": { + "version": "0.2.0", + "bundled": true + } + } + }, + "global-paths": { + "version": "1.0.0", + "bundled": true, + "requires": { + "array-unique": "^0.3.2", + "global-modules": "^0.2.3", + "is-windows": "^1.0.0" + } + }, + "global-prefix": { + "version": "0.1.5", + "bundled": true, + "requires": { + "homedir-polyfill": "^1.0.0", + "ini": "^1.3.4", + "is-windows": "^0.2.0", + "which": "^1.2.12" + }, + "dependencies": { + "is-windows": { + "version": "0.2.0", + "bundled": true + } + } + }, + "graceful-fs": { + "version": "4.2.3", + "bundled": true + }, + "has-color": { + "version": "0.1.7", + "bundled": true + }, + "has-flag": { + "version": "3.0.0", + "bundled": true + }, + "homedir-polyfill": { + "version": "1.0.3", + "bundled": true, + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "ini": { + "version": "1.3.5", + "bundled": true + }, + "is-windows": { + "version": "1.0.2", + "bundled": true + }, + "isexe": { + "version": "2.0.0", + "bundled": true + }, + "js-tokens": { + "version": "4.0.0", + "bundled": true + }, + "jsonfile": { + "version": "4.0.0", + "bundled": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonlint": { + "version": "1.6.3", + "bundled": true, + "requires": { + "JSV": "^4.0.x", + "nomnom": "^1.5.x" + } + }, + "lodash": { + "version": "4.17.15", + "bundled": true + }, + "matcher-collection": { + "version": "2.0.1", + "bundled": true, + "requires": { + "@types/minimatch": "^3.0.3", + "minimatch": "^3.0.2" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "nomnom": { + "version": "1.8.1", + "bundled": true, + "requires": { + "chalk": "~0.4.0", + "underscore": "~1.6.0" + }, + "dependencies": { + "ansi-styles": { + "version": "1.0.0", + "bundled": true + }, + "chalk": { + "version": "0.4.0", + "bundled": true, + "requires": { + "ansi-styles": "~1.0.0", + "has-color": "~0.1.0", + "strip-ansi": "~0.1.0" + } + } + } + }, + "parse-passwd": { + "version": "1.0.0", + "bundled": true + }, + "path-parse": { + "version": "1.0.6", + "bundled": true + }, + "resolve": { + "version": "1.12.0", + "bundled": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "strip-ansi": { + "version": "0.1.1", + "bundled": true + }, + "supports-color": { + "version": "5.5.0", + "bundled": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "underscore": { + "version": "1.6.0", + "bundled": true + }, + "universalify": { + "version": "0.1.2", + "bundled": true + }, + "walk-sync": { + "version": "2.0.2", + "bundled": true, + "requires": { + "@types/minimatch": "^3.0.3", + "ensure-posix-path": "^1.1.0", + "matcher-collection": "^2.0.0" + } + }, + "which": { + "version": "1.3.1", + "bundled": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "xmldom": { + "version": "0.1.27", + "bundled": true + } + } + }, + "ansi-escapes": { + "version": "4.3.0", + "bundled": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "ansi-regex": { + "version": "5.0.0", + "bundled": true + }, + "ansi-styles": { + "version": "3.2.1", + "bundled": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "2.0.0", + "bundled": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "argparse": { + "version": "1.0.10", + "bundled": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "arr-diff": { + "version": "4.0.0", + "bundled": true + }, + "arr-flatten": { + "version": "1.1.0", + "bundled": true + }, + "arr-union": { + "version": "3.1.0", + "bundled": true + }, + "array-equal": { + "version": "1.0.0", + "bundled": true + }, + "array-includes": { + "version": "3.0.3", + "bundled": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.7.0" + } + }, + "array-unique": { + "version": "0.3.2", + "bundled": true + }, + "asn1": { + "version": "0.2.4", + "bundled": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "bundled": true + }, + "assign-symbols": { + "version": "1.0.0", + "bundled": true + }, + "astral-regex": { + "version": "1.0.0", + "bundled": true + }, + "async-limiter": { + "version": "1.0.1", + "bundled": true + }, + "asynckit": { + "version": "0.4.0", + "bundled": true + }, + "atob": { + "version": "2.1.2", + "bundled": true + }, + "aws-sign2": { + "version": "0.7.0", + "bundled": true + }, + "aws4": { + "version": "1.8.0", + "bundled": true + }, + "babel-jest": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/babel__core": "^7.1.0", + "babel-plugin-istanbul": "^5.1.0", + "babel-preset-jest": "^24.9.0", + "chalk": "^2.4.2", + "slash": "^2.0.0" + } + }, + "babel-plugin-istanbul": { + "version": "5.2.0", + "bundled": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "find-up": "^3.0.0", + "istanbul-lib-instrument": "^3.3.0", + "test-exclude": "^5.2.3" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "bundled": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "bundled": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.2.1", + "bundled": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "bundled": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "bundled": true + } + } + }, + "babel-plugin-jest-hoist": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@types/babel__traverse": "^7.0.6" + } + }, + "babel-preset-jest": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@babel/plugin-syntax-object-rest-spread": "^7.0.0", + "babel-plugin-jest-hoist": "^24.9.0" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "base": { + "version": "0.11.2", + "bundled": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "bundled": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "bundled": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "browser-process-hrtime": { + "version": "0.1.3", + "bundled": true + }, + "browser-resolve": { + "version": "1.11.3", + "bundled": true, + "requires": { + "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "bundled": true + } + } + }, + "bser": { + "version": "2.1.1", + "bundled": true, + "requires": { + "node-int64": "^0.4.0" + } + }, + "buffer-from": { + "version": "1.1.1", + "bundled": true + }, + "cache-base": { + "version": "1.0.1", + "bundled": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "callsites": { + "version": "3.1.0", + "bundled": true + }, + "camelcase": { + "version": "5.3.1", + "bundled": true + }, + "capture-exit": { + "version": "2.0.0", + "bundled": true, + "requires": { + "rsvp": "^4.8.4" + } + }, + "caseless": { + "version": "0.12.0", + "bundled": true + }, + "chalk": { + "version": "2.4.2", + "bundled": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.7.0", + "bundled": true + }, + "chmodr": { + "version": "1.2.0", + "bundled": true + }, + "ci-info": { + "version": "2.0.0", + "bundled": true + }, + "class-utils": { + "version": "0.3.6", + "bundled": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "cli-cursor": { + "version": "3.1.0", + "bundled": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-width": { + "version": "2.2.0", + "bundled": true + }, + "cliui": { + "version": "5.0.0", + "bundled": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "bundled": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "bundled": true + }, + "string-width": { + "version": "3.1.0", + "bundled": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } + } + }, + "co": { + "version": "4.6.0", + "bundled": true + }, + "collection-visit": { + "version": "1.0.0", + "bundled": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "bundled": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "bundled": true + }, + "combined-stream": { + "version": "1.0.8", + "bundled": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.20.3", + "bundled": true, + "optional": true + }, + "component-emitter": { + "version": "1.3.0", + "bundled": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "contains-path": { + "version": "0.1.0", + "bundled": true + }, + "convert-source-map": { + "version": "1.7.0", + "bundled": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "bundled": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true + }, + "cross-spawn": { + "version": "6.0.5", + "bundled": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "bundled": true + } + } + }, + "cssom": { + "version": "0.3.8", + "bundled": true + }, + "cssstyle": { + "version": "1.4.0", + "bundled": true, + "requires": { + "cssom": "0.3.x" + } + }, + "dashdash": { + "version": "1.14.1", + "bundled": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "data-urls": { + "version": "1.1.0", + "bundled": true, + "requires": { + "abab": "^2.0.0", + "whatwg-mimetype": "^2.2.0", + "whatwg-url": "^7.0.0" + }, + "dependencies": { + "whatwg-url": { + "version": "7.1.0", + "bundled": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + } + } + }, + "debug": { + "version": "4.1.1", + "bundled": true, + "requires": { + "ms": "^2.1.1" + } + }, + "decamelize": { + "version": "1.2.0", + "bundled": true + }, + "decode-uri-component": { + "version": "0.2.0", + "bundled": true + }, + "deep-is": { + "version": "0.1.3", + "bundled": true + }, + "define-properties": { + "version": "1.1.3", + "bundled": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "bundled": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "bundled": true + }, + "detect-newline": { + "version": "2.1.0", + "bundled": true + }, + "diff-sequences": { + "version": "24.9.0", + "bundled": true + }, + "doctrine": { + "version": "3.0.0", + "bundled": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "domexception": { + "version": "1.0.1", + "bundled": true, + "requires": { + "webidl-conversions": "^4.0.2" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "bundled": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "emoji-regex": { + "version": "8.0.0", + "bundled": true + }, + "end-of-stream": { + "version": "1.4.4", + "bundled": true, + "requires": { + "once": "^1.4.0" + } + }, + "ensure-posix-path": { + "version": "1.1.1", + "bundled": true + }, + "error-ex": { + "version": "1.3.2", + "bundled": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.16.0", + "bundled": true, + "requires": { + "es-to-primitive": "^1.2.0", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.0", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-inspect": "^1.6.0", + "object-keys": "^1.1.1", + "string.prototype.trimleft": "^2.1.0", + "string.prototype.trimright": "^2.1.0" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "bundled": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "bundled": true + }, + "escodegen": { + "version": "1.12.0", + "bundled": true, + "requires": { + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "esprima": { + "version": "3.1.3", + "bundled": true + }, + "source-map": { + "version": "0.6.1", + "bundled": true, + "optional": true + } + } + }, + "eslint": { + "version": "6.6.0", + "bundled": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + } + }, + "eslint-config-axway": { + "version": "4.5.0", + "bundled": true, + "requires": { + "eslint-plugin-chai-expect": "^2.0.1", + "eslint-plugin-import": "^2.18.2", + "eslint-plugin-node": "^10.0.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-security": "^1.4.0", + "find-root": "^1.1.0", + "semver": "^6.3.0" + } + }, + "eslint-import-resolver-node": { + "version": "0.3.2", + "bundled": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true + } + } + }, + "eslint-module-utils": { + "version": "2.4.1", + "bundled": true, + "requires": { + "debug": "^2.6.8", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true + } + } + }, + "eslint-plugin-chai-expect": { + "version": "2.0.1", + "bundled": true + }, + "eslint-plugin-es": { + "version": "2.0.0", + "bundled": true, + "requires": { + "eslint-utils": "^1.4.2", + "regexpp": "^3.0.0" + }, + "dependencies": { + "regexpp": { + "version": "3.0.0", + "bundled": true + } + } + }, + "eslint-plugin-import": { + "version": "2.18.2", + "bundled": true, + "requires": { + "array-includes": "^3.0.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.2", + "eslint-module-utils": "^2.4.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.0", + "read-pkg-up": "^2.0.0", + "resolve": "^1.11.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "bundled": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true + } + } + }, + "eslint-plugin-jest": { + "version": "23.0.4", + "bundled": true, + "requires": { + "@typescript-eslint/experimental-utils": "^2.5.0" + } + }, + "eslint-plugin-node": { + "version": "10.0.0", + "bundled": true, + "requires": { + "eslint-plugin-es": "^2.0.0", + "eslint-utils": "^1.4.2", + "ignore": "^5.1.1", + "minimatch": "^3.0.4", + "resolve": "^1.10.1", + "semver": "^6.1.0" + }, + "dependencies": { + "ignore": { + "version": "5.1.4", + "bundled": true + } + } + }, + "eslint-plugin-promise": { + "version": "4.2.1", + "bundled": true + }, + "eslint-plugin-security": { + "version": "1.4.0", + "bundled": true, + "requires": { + "safe-regex": "^1.1.0" + } + }, + "eslint-scope": { + "version": "5.0.0", + "bundled": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.4.3", + "bundled": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.1.0", + "bundled": true + }, + "espree": { + "version": "6.1.2", + "bundled": true, + "requires": { + "acorn": "^7.1.0", + "acorn-jsx": "^5.1.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "esprima": { + "version": "4.0.1", + "bundled": true + }, + "esquery": { + "version": "1.0.1", + "bundled": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "bundled": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.3.0", + "bundled": true + }, + "esutils": { + "version": "2.0.3", + "bundled": true + }, + "exec-sh": { + "version": "0.3.4", + "bundled": true + }, + "execa": { + "version": "1.0.0", + "bundled": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "exit": { + "version": "0.1.2", + "bundled": true + }, + "expand-brackets": { + "version": "2.1.4", + "bundled": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "bundled": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true + } + } + }, + "expect": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/types": "^24.9.0", + "ansi-styles": "^3.2.0", + "jest-get-type": "^24.9.0", + "jest-matcher-utils": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-regex-util": "^24.9.0" + } + }, + "extend": { + "version": "3.0.2", + "bundled": true + }, + "extend-shallow": { + "version": "3.0.2", + "bundled": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "bundled": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "external-editor": { + "version": "3.1.0", + "bundled": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "extglob": { + "version": "2.0.4", + "bundled": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "extsprintf": { + "version": "1.3.0", + "bundled": true + }, + "fast-deep-equal": { + "version": "2.0.1", + "bundled": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "bundled": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "bundled": true + }, + "fb-watchman": { + "version": "2.0.0", + "bundled": true, + "requires": { + "bser": "^2.0.0" + } + }, + "figures": { + "version": "3.1.0", + "bundled": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "bundled": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "fill-range": { + "version": "4.0.0", + "bundled": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-root": { + "version": "1.1.0", + "bundled": true + }, + "find-up": { + "version": "2.1.0", + "bundled": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "flat-cache": { + "version": "2.0.1", + "bundled": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.1", + "bundled": true + }, + "for-in": { + "version": "1.0.2", + "bundled": true + }, + "forever-agent": { + "version": "0.6.1", + "bundled": true + }, + "form-data": { + "version": "2.3.3", + "bundled": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fragment-cache": { + "version": "0.2.1", + "bundled": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs-extra": { + "version": "8.1.0", + "bundled": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true + }, + "fsevents": { + "version": "1.2.9", + "bundled": true, + "optional": true, + "requires": { + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.1", + "bundled": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "debug": { + "version": "4.1.1", + "bundled": true, + "optional": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.3", + "bundled": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.24", + "bundled": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true + }, + "minipass": { + "version": "2.3.5", + "bundled": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.2.1", + "bundled": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.1", + "bundled": true, + "optional": true + }, + "needle": { + "version": "2.3.0", + "bundled": true, + "optional": true, + "requires": { + "debug": "^4.1.0", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.12.0", + "bundled": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.6", + "bundled": true, + "optional": true + }, + "npm-packlist": { + "version": "1.4.1", + "bundled": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.3", + "bundled": true, + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "optional": true + }, + "semver": { + "version": "5.7.0", + "bundled": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "tar": { + "version": "4.4.8", + "bundled": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + }, + "yallist": { + "version": "3.0.3", + "bundled": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "bundled": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "bundled": true + }, + "get-caller-file": { + "version": "2.0.5", + "bundled": true + }, + "get-stream": { + "version": "4.1.0", + "bundled": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "bundled": true + }, + "getpass": { + "version": "0.1.7", + "bundled": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.6", + "bundled": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.0", + "bundled": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "11.12.0", + "bundled": true + }, + "graceful-fs": { + "version": "4.2.3", + "bundled": true + }, + "growly": { + "version": "1.3.0", + "bundled": true + }, + "handlebars": { + "version": "4.5.3", + "bundled": true, + "requires": { + "neo-async": "^2.6.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true + } + } + }, + "har-schema": { + "version": "2.0.0", + "bundled": true + }, + "har-validator": { + "version": "5.1.3", + "bundled": true, + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "bundled": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-color": { + "version": "0.1.7", + "bundled": true + }, + "has-flag": { + "version": "3.0.0", + "bundled": true + }, + "has-symbols": { + "version": "1.0.1", + "bundled": true + }, + "has-value": { + "version": "1.0.0", + "bundled": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "bundled": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "bundled": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hosted-git-info": { + "version": "2.8.5", + "bundled": true + }, + "html-encoding-sniffer": { + "version": "1.0.2", + "bundled": true, + "requires": { + "whatwg-encoding": "^1.0.1" + } + }, + "http-signature": { + "version": "1.2.0", + "bundled": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "bundled": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "4.0.6", + "bundled": true + }, + "import-fresh": { + "version": "3.2.1", + "bundled": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "import-local": { + "version": "2.0.0", + "bundled": true, + "requires": { + "pkg-dir": "^3.0.0", + "resolve-cwd": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "bundled": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "bundled": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.2.1", + "bundled": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "bundled": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "bundled": true + }, + "pkg-dir": { + "version": "3.0.0", + "bundled": true, + "requires": { + "find-up": "^3.0.0" + } + } + } + }, + "imurmurhash": { + "version": "0.1.4", + "bundled": true + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "bundled": true + }, + "inquirer": { + "version": "7.0.0", + "bundled": true, + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^2.4.2", + "cli-cursor": "^3.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^4.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + } + }, + "invariant": { + "version": "2.2.4", + "bundled": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "is": { + "version": "3.3.0", + "bundled": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "bundled": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "bundled": true + }, + "is-buffer": { + "version": "1.1.6", + "bundled": true + }, + "is-callable": { + "version": "1.1.4", + "bundled": true + }, + "is-ci": { + "version": "2.0.0", + "bundled": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "bundled": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-date-object": { + "version": "1.0.1", + "bundled": true + }, + "is-descriptor": { + "version": "0.1.6", + "bundled": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "bundled": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "bundled": true + }, + "is-extglob": { + "version": "2.1.1", + "bundled": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "bundled": true + }, + "is-generator-fn": { + "version": "2.1.0", + "bundled": true + }, + "is-glob": { + "version": "4.0.1", + "bundled": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "3.0.0", + "bundled": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "bundled": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-promise": { + "version": "2.1.0", + "bundled": true + }, + "is-regex": { + "version": "1.0.4", + "bundled": true, + "requires": { + "has": "^1.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "bundled": true + }, + "is-symbol": { + "version": "1.0.3", + "bundled": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "bundled": true + }, + "is-windows": { + "version": "1.0.2", + "bundled": true + }, + "is-wsl": { + "version": "1.1.0", + "bundled": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true + }, + "isexe": { + "version": "2.0.0", + "bundled": true + }, + "isobject": { + "version": "3.0.1", + "bundled": true + }, + "isstream": { + "version": "0.1.2", + "bundled": true + }, + "istanbul-lib-coverage": { + "version": "2.0.5", + "bundled": true + }, + "istanbul-lib-instrument": { + "version": "3.3.0", + "bundled": true, + "requires": { + "@babel/generator": "^7.4.0", + "@babel/parser": "^7.4.3", + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0", + "istanbul-lib-coverage": "^2.0.5", + "semver": "^6.0.0" + } + }, + "istanbul-lib-report": { + "version": "2.0.8", + "bundled": true, + "requires": { + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "supports-color": "^6.1.0" + }, + "dependencies": { + "supports-color": { + "version": "6.1.0", + "bundled": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "3.0.6", + "bundled": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "rimraf": "^2.6.3", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true + } + } + }, + "istanbul-reports": { + "version": "2.2.6", + "bundled": true, + "requires": { + "handlebars": "^4.1.2" + } + }, + "jest": { + "version": "24.9.0", + "bundled": true, + "requires": { + "import-local": "^2.0.0", + "jest-cli": "^24.9.0" + }, + "dependencies": { + "jest-cli": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/core": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "import-local": "^2.0.0", + "is-ci": "^2.0.0", + "jest-config": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", + "prompts": "^2.0.1", + "realpath-native": "^1.1.0", + "yargs": "^13.3.0" + } + } + } + }, + "jest-changed-files": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/types": "^24.9.0", + "execa": "^1.0.0", + "throat": "^4.0.0" + } + }, + "jest-config": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/test-sequencer": "^24.9.0", + "@jest/types": "^24.9.0", + "babel-jest": "^24.9.0", + "chalk": "^2.0.1", + "glob": "^7.1.1", + "jest-environment-jsdom": "^24.9.0", + "jest-environment-node": "^24.9.0", + "jest-get-type": "^24.9.0", + "jest-jasmine2": "^24.9.0", + "jest-regex-util": "^24.3.0", + "jest-resolve": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", + "micromatch": "^3.1.10", + "pretty-format": "^24.9.0", + "realpath-native": "^1.1.0" + } + }, + "jest-diff": { + "version": "24.9.0", + "bundled": true, + "requires": { + "chalk": "^2.0.1", + "diff-sequences": "^24.9.0", + "jest-get-type": "^24.9.0", + "pretty-format": "^24.9.0" + } + }, + "jest-docblock": { + "version": "24.9.0", + "bundled": true, + "requires": { + "detect-newline": "^2.1.0" + } + }, + "jest-each": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/types": "^24.9.0", + "chalk": "^2.0.1", + "jest-get-type": "^24.9.0", + "jest-util": "^24.9.0", + "pretty-format": "^24.9.0" + } + }, + "jest-environment-jsdom": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/environment": "^24.9.0", + "@jest/fake-timers": "^24.9.0", + "@jest/types": "^24.9.0", + "jest-mock": "^24.9.0", + "jest-util": "^24.9.0", + "jsdom": "^11.5.1" + } + }, + "jest-environment-node": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/environment": "^24.9.0", + "@jest/fake-timers": "^24.9.0", + "@jest/types": "^24.9.0", + "jest-mock": "^24.9.0", + "jest-util": "^24.9.0" + } + }, + "jest-get-type": { + "version": "24.9.0", + "bundled": true + }, + "jest-haste-map": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/types": "^24.9.0", + "anymatch": "^2.0.0", + "fb-watchman": "^2.0.0", + "fsevents": "^1.2.7", + "graceful-fs": "^4.1.15", + "invariant": "^2.2.4", + "jest-serializer": "^24.9.0", + "jest-util": "^24.9.0", + "jest-worker": "^24.9.0", + "micromatch": "^3.1.10", + "sane": "^4.0.3", + "walker": "^1.0.7" + } + }, + "jest-jasmine2": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@babel/traverse": "^7.1.0", + "@jest/environment": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "chalk": "^2.0.1", + "co": "^4.6.0", + "expect": "^24.9.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^24.9.0", + "jest-matcher-utils": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-snapshot": "^24.9.0", + "jest-util": "^24.9.0", + "pretty-format": "^24.9.0", + "throat": "^4.0.0" + } + }, + "jest-leak-detector": { + "version": "24.9.0", + "bundled": true, + "requires": { + "jest-get-type": "^24.9.0", + "pretty-format": "^24.9.0" + } + }, + "jest-matcher-utils": { + "version": "24.9.0", + "bundled": true, + "requires": { + "chalk": "^2.0.1", + "jest-diff": "^24.9.0", + "jest-get-type": "^24.9.0", + "pretty-format": "^24.9.0" + } + }, + "jest-message-util": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/stack-utils": "^1.0.1", + "chalk": "^2.0.1", + "micromatch": "^3.1.10", + "slash": "^2.0.0", + "stack-utils": "^1.0.1" + } + }, + "jest-mock": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/types": "^24.9.0" + } + }, + "jest-pnp-resolver": { + "version": "1.2.1", + "bundled": true + }, + "jest-regex-util": { + "version": "24.9.0", + "bundled": true + }, + "jest-resolve": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/types": "^24.9.0", + "browser-resolve": "^1.11.3", + "chalk": "^2.0.1", + "jest-pnp-resolver": "^1.2.1", + "realpath-native": "^1.1.0" + } + }, + "jest-resolve-dependencies": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/types": "^24.9.0", + "jest-regex-util": "^24.3.0", + "jest-snapshot": "^24.9.0" + } + }, + "jest-runner": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/console": "^24.7.1", + "@jest/environment": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "chalk": "^2.4.2", + "exit": "^0.1.2", + "graceful-fs": "^4.1.15", + "jest-config": "^24.9.0", + "jest-docblock": "^24.3.0", + "jest-haste-map": "^24.9.0", + "jest-jasmine2": "^24.9.0", + "jest-leak-detector": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-resolve": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-util": "^24.9.0", + "jest-worker": "^24.6.0", + "source-map-support": "^0.5.6", + "throat": "^4.0.0" + } + }, + "jest-runtime": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/console": "^24.7.1", + "@jest/environment": "^24.9.0", + "@jest/source-map": "^24.3.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/yargs": "^13.0.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.1.15", + "jest-config": "^24.9.0", + "jest-haste-map": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-mock": "^24.9.0", + "jest-regex-util": "^24.3.0", + "jest-resolve": "^24.9.0", + "jest-snapshot": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", + "realpath-native": "^1.1.0", + "slash": "^2.0.0", + "strip-bom": "^3.0.0", + "yargs": "^13.3.0" + } + }, + "jest-serializer": { + "version": "24.9.0", + "bundled": true + }, + "jest-snapshot": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@babel/types": "^7.0.0", + "@jest/types": "^24.9.0", + "chalk": "^2.0.1", + "expect": "^24.9.0", + "jest-diff": "^24.9.0", + "jest-get-type": "^24.9.0", + "jest-matcher-utils": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-resolve": "^24.9.0", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "pretty-format": "^24.9.0", + "semver": "^6.2.0" + } + }, + "jest-util": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/console": "^24.9.0", + "@jest/fake-timers": "^24.9.0", + "@jest/source-map": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "callsites": "^3.0.0", + "chalk": "^2.0.1", + "graceful-fs": "^4.1.15", + "is-ci": "^2.0.0", + "mkdirp": "^0.5.1", + "slash": "^2.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true + } + } + }, + "jest-validate": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/types": "^24.9.0", + "camelcase": "^5.3.1", + "chalk": "^2.0.1", + "jest-get-type": "^24.9.0", + "leven": "^3.1.0", + "pretty-format": "^24.9.0" + } + }, + "jest-watcher": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/yargs": "^13.0.0", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.1", + "jest-util": "^24.9.0", + "string-length": "^2.0.0" + }, + "dependencies": { + "ansi-escapes": { + "version": "3.2.0", + "bundled": true + } + } + }, + "jest-worker": { + "version": "24.9.0", + "bundled": true, + "requires": { + "merge-stream": "^2.0.0", + "supports-color": "^6.1.0" + }, + "dependencies": { + "supports-color": { + "version": "6.1.0", + "bundled": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "js-tokens": { + "version": "4.0.0", + "bundled": true + }, + "js-yaml": { + "version": "3.13.1", + "bundled": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "bundled": true + }, + "jsdom": { + "version": "11.12.0", + "bundled": true, + "requires": { + "abab": "^2.0.0", + "acorn": "^5.5.3", + "acorn-globals": "^4.1.0", + "array-equal": "^1.0.0", + "cssom": ">= 0.3.2 < 0.4.0", + "cssstyle": "^1.0.0", + "data-urls": "^1.0.0", + "domexception": "^1.0.1", + "escodegen": "^1.9.1", + "html-encoding-sniffer": "^1.0.2", + "left-pad": "^1.3.0", + "nwsapi": "^2.0.7", + "parse5": "4.0.0", + "pn": "^1.1.0", + "request": "^2.87.0", + "request-promise-native": "^1.0.5", + "sax": "^1.2.4", + "symbol-tree": "^3.2.2", + "tough-cookie": "^2.3.4", + "w3c-hr-time": "^1.0.1", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.3", + "whatwg-mimetype": "^2.1.0", + "whatwg-url": "^6.4.1", + "ws": "^5.2.0", + "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "acorn": { + "version": "5.7.3", + "bundled": true + } + } + }, + "jsesc": { + "version": "2.5.2", + "bundled": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "bundled": true + }, + "json-schema": { + "version": "0.2.3", + "bundled": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "bundled": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "bundled": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "bundled": true + }, + "json5": { + "version": "2.1.1", + "bundled": true, + "requires": { + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true + } + } + }, + "jsonfile": { + "version": "4.0.0", + "bundled": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonlint": { + "version": "1.6.3", + "bundled": true, + "requires": { + "JSV": "^4.0.x", + "nomnom": "^1.5.x" + } + }, + "jsprim": { + "version": "1.4.1", + "bundled": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "kind-of": { + "version": "6.0.2", + "bundled": true + }, + "kleur": { + "version": "3.0.3", + "bundled": true + }, + "left-pad": { + "version": "1.3.0", + "bundled": true + }, + "leven": { + "version": "3.1.0", + "bundled": true + }, + "levn": { + "version": "0.3.0", + "bundled": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "load-json-file": { + "version": "2.0.0", + "bundled": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "bundled": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "bundled": true + }, + "lodash.sortby": { + "version": "4.7.0", + "bundled": true + }, + "lodash.unescape": { + "version": "4.0.1", + "bundled": true + }, + "loose-envify": { + "version": "1.4.0", + "bundled": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "make-dir": { + "version": "2.1.0", + "bundled": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "dependencies": { + "pify": { + "version": "4.0.1", + "bundled": true + }, + "semver": { + "version": "5.7.1", + "bundled": true + } + } + }, + "makeerror": { + "version": "1.0.11", + "bundled": true, + "requires": { + "tmpl": "1.0.x" + } + }, + "map-cache": { + "version": "0.2.2", + "bundled": true + }, + "map-visit": { + "version": "1.0.0", + "bundled": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "matcher-collection": { + "version": "2.0.1", + "bundled": true, + "requires": { + "@types/minimatch": "^3.0.3", + "minimatch": "^3.0.2" + } + }, + "merge-stream": { + "version": "2.0.0", + "bundled": true + }, + "micromatch": { + "version": "3.1.10", + "bundled": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "mime-db": { + "version": "1.42.0", + "bundled": true + }, + "mime-types": { + "version": "2.1.25", + "bundled": true, + "requires": { + "mime-db": "1.42.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "bundled": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true + }, + "mixin-deep": { + "version": "1.3.2", + "bundled": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "bundled": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.2", + "bundled": true + }, + "mute-stream": { + "version": "0.0.8", + "bundled": true + }, + "nan": { + "version": "2.14.0", + "bundled": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "bundled": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "natural-compare": { + "version": "1.4.0", + "bundled": true + }, + "neo-async": { + "version": "2.6.1", + "bundled": true + }, + "nice-try": { + "version": "1.0.5", + "bundled": true + }, + "node-int64": { + "version": "0.4.0", + "bundled": true + }, + "node-modules-regexp": { + "version": "1.0.0", + "bundled": true + }, + "node-notifier": { + "version": "5.4.3", + "bundled": true, + "requires": { + "growly": "^1.3.0", + "is-wsl": "^1.1.0", + "semver": "^5.5.0", + "shellwords": "^0.1.1", + "which": "^1.3.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "bundled": true + } + } + }, + "node.extend": { + "version": "2.0.2", + "bundled": true, + "requires": { + "has": "^1.0.3", + "is": "^3.2.1" + } + }, + "nomnom": { + "version": "1.8.1", + "bundled": true, + "requires": { + "chalk": "~0.4.0", + "underscore": "~1.6.0" + }, + "dependencies": { + "ansi-styles": { + "version": "1.0.0", + "bundled": true + }, + "chalk": { + "version": "0.4.0", + "bundled": true, + "requires": { + "ansi-styles": "~1.0.0", + "has-color": "~0.1.0", + "strip-ansi": "~0.1.0" + } + }, + "strip-ansi": { + "version": "0.1.1", + "bundled": true + } + } + }, + "normalize-package-data": { + "version": "2.5.0", + "bundled": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "bundled": true + } + } + }, + "normalize-path": { + "version": "2.1.1", + "bundled": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "bundled": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "nwsapi": { + "version": "2.2.0", + "bundled": true + }, + "oauth-sign": { + "version": "0.9.0", + "bundled": true + }, + "object-copy": { + "version": "0.1.0", + "bundled": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "bundled": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-inspect": { + "version": "1.7.0", + "bundled": true + }, + "object-keys": { + "version": "1.1.1", + "bundled": true + }, + "object-visit": { + "version": "1.0.1", + "bundled": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "bundled": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" + } + }, + "object.pick": { + "version": "1.3.0", + "bundled": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "object.values": { + "version": "1.1.0", + "bundled": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.12.0", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.0", + "bundled": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "optimist": { + "version": "0.6.1", + "bundled": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + } + }, + "optionator": { + "version": "0.8.3", + "bundled": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true + }, + "p-each-series": { + "version": "1.0.0", + "bundled": true, + "requires": { + "p-reduce": "^1.0.0" + } + }, + "p-finally": { + "version": "1.0.0", + "bundled": true + }, + "p-limit": { + "version": "1.3.0", + "bundled": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "bundled": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-reduce": { + "version": "1.0.0", + "bundled": true + }, + "p-try": { + "version": "1.0.0", + "bundled": true + }, + "parent-module": { + "version": "1.0.1", + "bundled": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "bundled": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "parse5": { + "version": "4.0.0", + "bundled": true + }, + "pascalcase": { + "version": "0.1.1", + "bundled": true + }, + "path-exists": { + "version": "3.0.0", + "bundled": true + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true + }, + "path-key": { + "version": "2.0.1", + "bundled": true + }, + "path-parse": { + "version": "1.0.6", + "bundled": true + }, + "path-type": { + "version": "2.0.0", + "bundled": true, + "requires": { + "pify": "^2.0.0" + } + }, + "performance-now": { + "version": "2.1.0", + "bundled": true + }, + "pify": { + "version": "2.3.0", + "bundled": true + }, + "pirates": { + "version": "4.0.1", + "bundled": true, + "requires": { + "node-modules-regexp": "^1.0.0" + } + }, + "pkg-dir": { + "version": "2.0.0", + "bundled": true, + "requires": { + "find-up": "^2.1.0" + } + }, + "pn": { + "version": "1.1.0", + "bundled": true + }, + "posix-character-classes": { + "version": "0.1.1", + "bundled": true + }, + "prelude-ls": { + "version": "1.1.2", + "bundled": true + }, + "prettier": { + "version": "1.19.1", + "bundled": true + }, + "pretty-format": { + "version": "24.9.0", + "bundled": true, + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "bundled": true + } + } + }, + "progress": { + "version": "2.0.3", + "bundled": true + }, + "prompts": { + "version": "2.3.0", + "bundled": true, + "requires": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.3" + } + }, + "psl": { + "version": "1.4.0", + "bundled": true + }, + "pump": { + "version": "3.0.0", + "bundled": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "punycode": { + "version": "2.1.1", + "bundled": true + }, + "qs": { + "version": "6.5.2", + "bundled": true + }, + "react-is": { + "version": "16.12.0", + "bundled": true + }, + "read-pkg": { + "version": "2.0.0", + "bundled": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "bundled": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, + "realpath-native": { + "version": "1.1.0", + "bundled": true, + "requires": { + "util.promisify": "^1.0.0" + } + }, + "regex-not": { + "version": "1.0.2", + "bundled": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexpp": { + "version": "2.0.1", + "bundled": true + }, + "remove-trailing-separator": { + "version": "1.1.0", + "bundled": true + }, + "repeat-element": { + "version": "1.1.3", + "bundled": true + }, + "repeat-string": { + "version": "1.6.1", + "bundled": true + }, + "request": { + "version": "2.88.0", + "bundled": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "bundled": true + }, + "tough-cookie": { + "version": "2.4.3", + "bundled": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } + } + } + }, + "request-promise-core": { + "version": "1.1.3", + "bundled": true, + "requires": { + "lodash": "^4.17.15" + } + }, + "request-promise-native": { + "version": "1.0.8", + "bundled": true, + "requires": { + "request-promise-core": "1.1.3", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" + } + }, + "require-directory": { + "version": "2.1.1", + "bundled": true + }, + "require-main-filename": { + "version": "2.0.0", + "bundled": true + }, + "resolve": { + "version": "1.12.0", + "bundled": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-cwd": { + "version": "2.0.0", + "bundled": true, + "requires": { + "resolve-from": "^3.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "3.0.0", + "bundled": true + } + } + }, + "resolve-from": { + "version": "4.0.0", + "bundled": true + }, + "resolve-url": { + "version": "0.2.1", + "bundled": true + }, + "restore-cursor": { + "version": "3.1.0", + "bundled": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "ret": { + "version": "0.1.15", + "bundled": true + }, + "rimraf": { + "version": "2.6.3", + "bundled": true, + "requires": { + "glob": "^7.1.3" + } + }, + "rsvp": { + "version": "4.8.5", + "bundled": true + }, + "run-async": { + "version": "2.3.0", + "bundled": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rxjs": { + "version": "6.5.3", + "bundled": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true + }, + "safe-regex": { + "version": "1.1.0", + "bundled": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true + }, + "sane": { + "version": "4.1.0", + "bundled": true, + "requires": { + "@cnakazawa/watch": "^1.0.3", + "anymatch": "^2.0.0", + "capture-exit": "^2.0.0", + "exec-sh": "^0.3.2", + "execa": "^1.0.0", + "fb-watchman": "^2.0.0", + "micromatch": "^3.1.4", + "minimist": "^1.1.1", + "walker": "~1.0.5" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true + } + } + }, + "sax": { + "version": "1.2.4", + "bundled": true + }, + "semver": { + "version": "6.3.0", + "bundled": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true + }, + "set-value": { + "version": "2.0.1", + "bundled": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "bundled": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "bundled": true + }, + "shellwords": { + "version": "0.1.1", + "bundled": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true + }, + "sisteransi": { + "version": "1.0.4", + "bundled": true + }, + "slash": { + "version": "2.0.0", + "bundled": true + }, + "slice-ansi": { + "version": "2.1.0", + "bundled": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "bundled": true + } + } + }, + "snapdragon": { + "version": "0.8.2", + "bundled": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "bundled": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "bundled": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "bundled": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "bundled": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "bundled": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "bundled": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "bundled": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "bundled": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-map": { + "version": "0.5.7", + "bundled": true + }, + "source-map-resolve": { + "version": "0.5.2", + "bundled": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.16", + "bundled": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true + } + } + }, + "source-map-url": { + "version": "0.4.0", + "bundled": true + }, + "spdx-correct": { + "version": "3.1.0", + "bundled": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "bundled": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "bundled": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "bundled": true + }, + "split-string": { + "version": "3.1.0", + "bundled": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "bundled": true + }, + "sshpk": { + "version": "1.16.1", + "bundled": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "stack-utils": { + "version": "1.0.2", + "bundled": true + }, + "static-extend": { + "version": "0.1.2", + "bundled": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "bundled": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "stealthy-require": { + "version": "1.1.1", + "bundled": true + }, + "string-length": { + "version": "2.0.0", + "bundled": true, + "requires": { + "astral-regex": "^1.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "bundled": true + }, + "strip-ansi": { + "version": "4.0.0", + "bundled": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "string-width": { + "version": "4.2.0", + "bundled": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "6.0.0", + "bundled": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "string.prototype.trimleft": { + "version": "2.1.0", + "bundled": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimright": { + "version": "2.1.0", + "bundled": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "strip-ansi": { + "version": "5.2.0", + "bundled": true, + "requires": { + "ansi-regex": "^4.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "bundled": true + } + } + }, + "strip-bom": { + "version": "3.0.0", + "bundled": true + }, + "strip-eof": { + "version": "1.0.0", + "bundled": true + }, + "strip-json-comments": { + "version": "3.0.1", + "bundled": true + }, + "supports-color": { + "version": "5.5.0", + "bundled": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "symbol-tree": { + "version": "3.2.4", + "bundled": true + }, + "table": { + "version": "5.4.6", + "bundled": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "bundled": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "bundled": true + }, + "string-width": { + "version": "3.1.0", + "bundled": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } + } + }, + "test-exclude": { + "version": "5.2.3", + "bundled": true, + "requires": { + "glob": "^7.1.3", + "minimatch": "^3.0.4", + "read-pkg-up": "^4.0.0", + "require-main-filename": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "bundled": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "bundled": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "bundled": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.2.1", + "bundled": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "bundled": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "bundled": true + }, + "parse-json": { + "version": "4.0.0", + "bundled": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-type": { + "version": "3.0.0", + "bundled": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "bundled": true + }, + "read-pkg": { + "version": "3.0.0", + "bundled": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "4.0.0", + "bundled": true, + "requires": { + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "bundled": true + }, + "throat": { + "version": "4.1.0", + "bundled": true + }, + "through": { + "version": "2.3.8", + "bundled": true + }, + "tmp": { + "version": "0.0.33", + "bundled": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "tmpl": { + "version": "1.0.4", + "bundled": true + }, + "to-fast-properties": { + "version": "2.0.0", + "bundled": true + }, + "to-object-path": { + "version": "0.3.0", + "bundled": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "bundled": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "bundled": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "tough-cookie": { + "version": "2.5.0", + "bundled": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "tr46": { + "version": "1.0.1", + "bundled": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "tslib": { + "version": "1.10.0", + "bundled": true + }, + "tsutils": { + "version": "3.17.1", + "bundled": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "bundled": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "bundled": true + }, + "type-check": { + "version": "0.3.2", + "bundled": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "type-fest": { + "version": "0.8.1", + "bundled": true + }, + "uglify-js": { + "version": "3.6.9", + "bundled": true, + "optional": true, + "requires": { + "commander": "~2.20.3", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true, + "optional": true + } + } + }, + "underscore": { + "version": "1.6.0", + "bundled": true + }, + "union-value": { + "version": "1.0.1", + "bundled": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "universalify": { + "version": "0.1.2", + "bundled": true + }, + "unset-value": { + "version": "1.0.0", + "bundled": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "bundled": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "bundled": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "bundled": true + } + } + }, + "uri-js": { + "version": "4.2.2", + "bundled": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "bundled": true + }, + "use": { + "version": "3.1.1", + "bundled": true + }, + "util.promisify": { + "version": "1.0.0", + "bundled": true, + "requires": { + "define-properties": "^1.1.2", + "object.getownpropertydescriptors": "^2.0.3" + } + }, + "uuid": { + "version": "3.3.3", + "bundled": true + }, + "v8-compile-cache": { + "version": "2.1.0", + "bundled": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "bundled": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "bundled": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "w3c-hr-time": { + "version": "1.0.1", + "bundled": true, + "requires": { + "browser-process-hrtime": "^0.1.2" + } + }, + "walk-sync": { + "version": "2.0.2", + "bundled": true, + "requires": { + "@types/minimatch": "^3.0.3", + "ensure-posix-path": "^1.1.0", + "matcher-collection": "^2.0.0" + } + }, + "walker": { + "version": "1.0.7", + "bundled": true, + "requires": { + "makeerror": "1.0.x" + } + }, + "webidl-conversions": { + "version": "4.0.2", + "bundled": true + }, + "whatwg-encoding": { + "version": "1.0.5", + "bundled": true, + "requires": { + "iconv-lite": "0.4.24" + } + }, + "whatwg-mimetype": { + "version": "2.3.0", + "bundled": true + }, + "whatwg-url": { + "version": "6.5.0", + "bundled": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "which": { + "version": "1.3.1", + "bundled": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "bundled": true + }, + "word-wrap": { + "version": "1.2.3", + "bundled": true + }, + "wordwrap": { + "version": "0.0.3", + "bundled": true + }, + "wrap-ansi": { + "version": "5.1.0", + "bundled": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "bundled": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "bundled": true + }, + "string-width": { + "version": "3.1.0", + "bundled": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + }, + "write": { + "version": "1.0.3", + "bundled": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, + "write-file-atomic": { + "version": "2.4.1", + "bundled": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "ws": { + "version": "5.2.2", + "bundled": true, + "requires": { + "async-limiter": "~1.0.0" + } + }, + "xml-name-validator": { + "version": "3.0.0", + "bundled": true + }, + "xmldom": { + "version": "0.1.27", + "bundled": true + }, + "y18n": { + "version": "4.0.0", + "bundled": true + }, + "yargs": { + "version": "13.3.0", + "bundled": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.1" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "bundled": true + }, + "find-up": { + "version": "3.0.0", + "bundled": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "bundled": true + }, + "locate-path": { + "version": "3.0.0", + "bundled": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.2.1", + "bundled": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "bundled": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "bundled": true + }, + "string-width": { + "version": "3.1.0", + "bundled": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } + } + }, + "yargs-parser": { + "version": "13.1.1", + "bundled": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "alloy-utils": { + "version": "file:../alloy-utils", + "requires": { + "@babel/code-frame": "^7.5.5", + "chmodr": "^1.2.0", + "colors": "^1.4.0", + "fs-extra": "^8.1.0", + "global-paths": "^1.0.0", + "jsonlint": "^1.6.3", + "lodash": "^4.17.15", + "resolve": "^1.12.0", + "walk-sync": "^2.0.2", + "xmldom": "^0.1.27" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "bundled": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.5.0", + "bundled": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "bundled": true + }, + "JSV": { + "version": "4.0.2", + "bundled": true + }, + "ansi-styles": { + "version": "3.2.1", + "bundled": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "array-unique": { + "version": "0.3.2", + "bundled": true + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chalk": { + "version": "2.4.2", + "bundled": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chmodr": { + "version": "1.2.0", + "bundled": true + }, + "color-convert": { + "version": "1.9.3", + "bundled": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "bundled": true + }, + "colors": { + "version": "1.4.0", + "bundled": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "ensure-posix-path": { + "version": "1.1.1", + "bundled": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "bundled": true + }, + "esutils": { + "version": "2.0.3", + "bundled": true + }, + "fs-extra": { + "version": "8.1.0", + "bundled": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "global-modules": { + "version": "0.2.3", + "bundled": true, + "requires": { + "global-prefix": "^0.1.4", + "is-windows": "^0.2.0" + }, + "dependencies": { + "is-windows": { + "version": "0.2.0", + "bundled": true + } + } + }, + "global-paths": { + "version": "1.0.0", + "bundled": true, + "requires": { + "array-unique": "^0.3.2", + "global-modules": "^0.2.3", + "is-windows": "^1.0.0" + } + }, + "global-prefix": { + "version": "0.1.5", + "bundled": true, + "requires": { + "homedir-polyfill": "^1.0.0", + "ini": "^1.3.4", + "is-windows": "^0.2.0", + "which": "^1.2.12" + }, + "dependencies": { + "is-windows": { + "version": "0.2.0", + "bundled": true + } + } + }, + "graceful-fs": { + "version": "4.2.3", + "bundled": true + }, + "has-color": { + "version": "0.1.7", + "bundled": true + }, + "has-flag": { + "version": "3.0.0", + "bundled": true + }, + "homedir-polyfill": { + "version": "1.0.3", + "bundled": true, + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "ini": { + "version": "1.3.5", + "bundled": true + }, + "is-windows": { + "version": "1.0.2", + "bundled": true + }, + "isexe": { + "version": "2.0.0", + "bundled": true + }, + "js-tokens": { + "version": "4.0.0", + "bundled": true + }, + "jsonfile": { + "version": "4.0.0", + "bundled": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonlint": { + "version": "1.6.3", + "bundled": true, + "requires": { + "JSV": "^4.0.x", + "nomnom": "^1.5.x" + } + }, + "lodash": { + "version": "4.17.15", + "bundled": true + }, + "matcher-collection": { + "version": "2.0.1", + "bundled": true, + "requires": { + "@types/minimatch": "^3.0.3", + "minimatch": "^3.0.2" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "nomnom": { + "version": "1.8.1", + "bundled": true, + "requires": { + "chalk": "~0.4.0", + "underscore": "~1.6.0" + }, + "dependencies": { + "ansi-styles": { + "version": "1.0.0", + "bundled": true + }, + "chalk": { + "version": "0.4.0", + "bundled": true, + "requires": { + "ansi-styles": "~1.0.0", + "has-color": "~0.1.0", + "strip-ansi": "~0.1.0" + } + } + } + }, + "parse-passwd": { + "version": "1.0.0", + "bundled": true + }, + "path-parse": { + "version": "1.0.6", + "bundled": true + }, + "resolve": { + "version": "1.12.0", + "bundled": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "strip-ansi": { + "version": "0.1.1", + "bundled": true + }, + "supports-color": { + "version": "5.5.0", + "bundled": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "underscore": { + "version": "1.6.0", + "bundled": true + }, + "universalify": { + "version": "0.1.2", + "bundled": true + }, + "walk-sync": { + "version": "2.0.2", + "bundled": true, + "requires": { + "@types/minimatch": "^3.0.3", + "ensure-posix-path": "^1.1.0", + "matcher-collection": "^2.0.0" + } + }, + "which": { + "version": "1.3.1", + "bundled": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "xmldom": { + "version": "0.1.27", + "bundled": true + } + } + }, "ansi-escapes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", diff --git a/package.json b/package.json index 6b23ddc5a..f35523a76 100644 --- a/package.json +++ b/package.json @@ -33,9 +33,11 @@ "@babel/core": "^7.4.5", "@babel/generator": "^7.4.4", "@babel/parser": "^7.4.5", + "@babel/template": "^7.4.4", "@babel/traverse": "^7.4.5", "@babel/types": "^7.4.4", - "@babel/template": "^7.4.4", + "alloy-compiler": "file:../alloy-devkit/packages/alloy-compiler", + "alloy-utils": "file:../alloy-devkit/packages/alloy-utils", "async": "^2.4.0", "chmodr": "^1.0.2", "colors": "^1.1.2", From 145d3a722fe85a21a25c653efa9326e70b36915a Mon Sep 17 00:00:00 2001 From: Jan Vennemann Date: Fri, 29 Nov 2019 19:17:32 +0100 Subject: [PATCH 02/19] fix: mobile web is dead --- Alloy/builtins/string.js | 5 +---- Alloy/template/lib/alloy.js | 17 ----------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/Alloy/builtins/string.js b/Alloy/builtins/string.js index 0bbde84e9..b69127b44 100755 --- a/Alloy/builtins/string.js +++ b/Alloy/builtins/string.js @@ -64,10 +64,7 @@ exports.lcfirst = function (text) { * @param {String} amount Amount to format. * @return {String} Amount formatted as a currency value. */ -exports.formatCurrency = !(OS_MOBILEWEB) ? String.formatCurrency : function (amount) { - var num = isNaN(amount) || amount === '' || amount === null ? 0.00 : amount; - return '$' + parseFloat(num).toFixed(2); -}; +exports.formatCurrency = String.formatCurrency; /** diff --git a/Alloy/template/lib/alloy.js b/Alloy/template/lib/alloy.js index 06dca71a3..3ae8ead36 100644 --- a/Alloy/template/lib/alloy.js +++ b/Alloy/template/lib/alloy.js @@ -32,8 +32,6 @@ exports._ = _; exports.Backbone = Backbone; var DEFAULT_WIDGET = 'widget'; -var TI_VERSION = Ti.version; -var MW320_CHECK = OS_MOBILEWEB && TI_VERSION >= '3.2.0'; var IDENTITY_TRANSFORM = OS_ANDROID ? (Ti.version >= '8.0.0' ? Ti.UI.createMatrix2D() : Ti.UI.create2DMatrix()) : undefined; var RESET = { bottom: null, @@ -319,8 +317,6 @@ exports.createStyle = function(controller, opts, defaults) { styleFinal[CONST.CLASS_PROPERTY] = classes; styleFinal[CONST.APINAME_PROPERTY] = apiName; - if (MW320_CHECK) { delete styleFinal[CONST.APINAME_PROPERTY]; } - return defaults ? _.defaults(styleFinal, defaults) : styleFinal; }; @@ -338,7 +334,6 @@ exports.addClass = function(controller, proxy, classes, opts) { // make sure we actually have classes to add if (!classes) { if (opts) { - if (MW320_CHECK) { delete opts.apiName; } proxy.applyProperties(opts); } return; @@ -352,7 +347,6 @@ exports.addClass = function(controller, proxy, classes, opts) { // make sure we actually added classes before processing styles if (beforeLen === newClasses.length) { if (opts) { - if (MW320_CHECK) { delete opts.apiName; } proxy.applyProperties(opts); } return; @@ -370,7 +364,6 @@ exports.removeClass = function(controller, proxy, classes, opts) { // make sure there's classes to remove before processing if (!beforeLen || !classes.length) { if (opts) { - if (MW320_CHECK) { delete opts.apiName; } proxy.applyProperties(opts); } return; @@ -382,7 +375,6 @@ exports.removeClass = function(controller, proxy, classes, opts) { // make sure there was actually a difference before processing if (beforeLen === newClasses.length) { if (opts) { - if (MW320_CHECK) { delete opts.apiName; } proxy.applyProperties(opts); } return; @@ -478,15 +470,6 @@ exports.isTablet = (function() { var psc = Ti.Platform.Android.physicalSizeCategory; return psc === Ti.Platform.Android.PHYSICAL_SIZE_CATEGORY_LARGE || psc === Ti.Platform.Android.PHYSICAL_SIZE_CATEGORY_XLARGE; - } else if (OS_MOBILEWEB) { - return Math.min( - Ti.Platform.displayCaps.platformHeight, - Ti.Platform.displayCaps.platformWidth - ) >= 400; - // } else if (OS_BLACKBERRY) { - // // Tablets not currently supported by BB TiSDK - // // https://jira.appcelerator.org/browse/TIMOB-13225 - // return false; } else if (OS_WINDOWS) { // per http://www.extremetech.com/computing/139768-windows-8-smartphones-and-windows-phone-8-tablets // tablets should be >= 1024x768 and phones could be lower, though current phones are running at From b14838369ab9f3b3e6ce9546bc8479a806691c98 Mon Sep 17 00:00:00 2001 From: Jan Vennemann Date: Fri, 29 Nov 2019 19:18:39 +0100 Subject: [PATCH 03/19] refactor: remove duplicate code --- Alloy/alloy.js | 17 +- Alloy/commands/compile/BuildLog.js | 59 - Alloy/commands/compile/CompilerMakeFile.js | 5 +- Alloy/commands/compile/Orphanage.js | 11 +- Alloy/commands/compile/ast/builtins-plugin.js | 91 - Alloy/commands/compile/ast/controller.js | 96 - .../compile/ast/handle-alloy-globals.js | 98 - .../commands/compile/ast/optimizer-plugin.js | 71 - Alloy/commands/compile/compilerUtils.js | 1033 --------- Alloy/commands/compile/index.js | 24 +- .../compile/parsers/Alloy.Abstract.Actions.js | 16 - .../parsers/Alloy.Abstract.BarItemType.js | 46 - .../parsers/Alloy.Abstract.BarItemTypes.js | 21 - .../parsers/Alloy.Abstract.ButtonName.js | 27 - .../parsers/Alloy.Abstract.ButtonNames.js | 17 - .../parsers/Alloy.Abstract.ContentView.js | 12 - .../Alloy.Abstract.CoverFlowImageType.js | 36 - .../Alloy.Abstract.CoverFlowImageTypes.js | 19 - .../parsers/Alloy.Abstract.FixedSpace.js | 30 - .../parsers/Alloy.Abstract.FlexSpace.js | 28 - .../compile/parsers/Alloy.Abstract.Item.js | 24 - .../parsers/Alloy.Abstract.ItemTemplate.js | 109 - .../compile/parsers/Alloy.Abstract.Items.js | 17 - .../compile/parsers/Alloy.Abstract.Option.js | 39 - .../compile/parsers/Alloy.Abstract.Options.js | 16 - .../compile/parsers/Alloy.Abstract.Preview.js | 14 - .../parsers/Alloy.Abstract._BackboneClass.js | 93 - .../parsers/Alloy.Abstract._ItemArray.js | 125 -- .../parsers/Alloy.Abstract._ItemContainer.js | 123 -- .../parsers/Alloy.Abstract._ProxyProperty.js | 82 - .../compile/parsers/Alloy.Collection.js | 3 - Alloy/commands/compile/parsers/Alloy.Model.js | 3 - .../commands/compile/parsers/Alloy.Module.js | 11 - .../commands/compile/parsers/Alloy.Require.js | 144 -- .../commands/compile/parsers/Alloy.Widget.js | 10 - Alloy/commands/compile/parsers/README.md | 9 - .../compile/parsers/Ti.Android.ActionBar.js | 73 - .../compile/parsers/Ti.Android.Menu.js | 101 - .../compile/parsers/Ti.Android.MenuItem.js | 56 - .../compile/parsers/Ti.Map.Annotation.js | 33 - Alloy/commands/compile/parsers/Ti.Map.View.js | 86 - .../compile/parsers/Ti.UI.AlertDialog.js | 14 - .../compile/parsers/Ti.UI.Android.CardView.js | 3 - .../Ti.UI.Android.DrawerLayout.CenterView.js | 3 - .../Ti.UI.Android.DrawerLayout.LeftView.js | 3 - .../Ti.UI.Android.DrawerLayout.RightView.js | 3 - ....UI.Android.DrawerLayout._ProxyProperty.js | 13 - .../compile/parsers/Ti.UI.AndroidView.js | 5 - .../compile/parsers/Ti.UI.AttributedString.js | 44 - .../commands/compile/parsers/Ti.UI.Button.js | 41 - .../compile/parsers/Ti.UI.ButtonBar.js | 15 - .../compile/parsers/Ti.UI.DashboardView.js | 87 - .../compile/parsers/Ti.UI.ImageView.js | 13 - Alloy/commands/compile/parsers/Ti.UI.Label.js | 56 - .../compile/parsers/Ti.UI.ListItem.js | 42 - .../compile/parsers/Ti.UI.ListSection.js | 173 -- .../compile/parsers/Ti.UI.ListView.js | 168 -- .../Ti.UI.MobileWeb.NavigationGroup.js | 3 - .../compile/parsers/Ti.UI.NavigationWindow.js | 61 - .../compile/parsers/Ti.UI.OptionDialog.js | 32 - .../commands/compile/parsers/Ti.UI.Picker.js | 137 -- .../compile/parsers/Ti.UI.PickerColumn.js | 87 - .../compile/parsers/Ti.UI.ScrollView.js | 40 - .../compile/parsers/Ti.UI.ScrollableView.js | 76 - .../commands/compile/parsers/Ti.UI.Switch.js | 29 - Alloy/commands/compile/parsers/Ti.UI.Tab.js | 48 - .../compile/parsers/Ti.UI.TabGroup.js | 91 - .../compile/parsers/Ti.UI.TabbedBar.js | 16 - .../compile/parsers/Ti.UI.TableView.js | 226 -- .../compile/parsers/Ti.UI.TableViewSection.js | 118 -- .../compile/parsers/Ti.UI.TextArea.js | 141 -- .../compile/parsers/Ti.UI.TextField.js | 155 -- .../commands/compile/parsers/Ti.UI.Toolbar.js | 73 - .../commands/compile/parsers/Ti.UI.WebView.js | 13 - .../parsers/Ti.UI.Window.LeftNavButton.js | 3 - .../parsers/Ti.UI.Window.LeftNavButtons.js | 17 - .../parsers/Ti.UI.Window.RightNavButton.js | 3 - .../parsers/Ti.UI.Window.RightNavButtons.js | 17 - .../parsers/Ti.UI.Window.TitleControl.js | 3 - .../parsers/Ti.UI.Window.WindowToolbar.js | 17 - .../parsers/Ti.UI.Window._ProxyProperty.js | 13 - .../parsers/Ti.UI.Windows.AppBarButton.js | 13 - .../parsers/Ti.UI.Windows.AppBarSeparator.js | 8 - .../Ti.UI.Windows.AppBarToggleButton.js | 3 - .../parsers/Ti.UI.Windows.CommandBar.js | 12 - .../parsers/Ti.UI.iOS.CoverFlowView.js | 15 - .../compile/parsers/Ti.UI.iOS.MenuPopup.js | 14 - .../parsers/Ti.UI.iOS.PreviewAction.js | 12 - .../parsers/Ti.UI.iOS.PreviewActionGroup.js | 46 - .../parsers/Ti.UI.iOS.PreviewContext.js | 61 - .../compile/parsers/Ti.UI.iOS.SplitWindow.js | 66 - .../parsers/Ti.UI.iPad.Popover.ContentView.js | 13 - .../Ti.UI.iPad.Popover._ProxyProperty.js | 12 - .../parsers/Ti.UI.iPhone.NavigationGroup.js | 58 - .../parsers/_ProxyProperty.ActionView.js | 12 - .../parsers/_ProxyProperty.KeyboardToolbar.js | 13 - .../parsers/_ProxyProperty.LeftButton.js | 13 - .../parsers/_ProxyProperty.RightButton.js | 13 - .../compile/parsers/_ProxyProperty._Lists.js | 15 - .../compile/parsers/_ProxyProperty.js | 68 - Alloy/commands/compile/parsers/base.js | 20 - Alloy/commands/compile/parsers/default.js | 201 -- .../compile/parsers/default_abstract.js | 42 - Alloy/commands/compile/sourceMapper.js | 235 --- Alloy/commands/compile/styler.js | 721 ------- Alloy/commands/copy/index.js | 12 +- Alloy/commands/debugger/index.js | 3 +- Alloy/commands/extract-i18n/i18nHandler.js | 9 +- Alloy/commands/extract-i18n/index.js | 9 +- Alloy/commands/generate/generateUtils.js | 11 +- Alloy/commands/generate/index.js | 10 +- Alloy/commands/generate/targets/jmk.js | 7 +- Alloy/commands/generate/targets/migration.js | 9 +- Alloy/commands/generate/targets/model.js | 11 +- Alloy/commands/generate/targets/style.js | 11 +- Alloy/commands/generate/targets/widget.js | 11 +- Alloy/commands/info/index.js | 8 +- Alloy/commands/install/index.js | 9 +- Alloy/commands/move/index.js | 14 +- Alloy/commands/new/index.js | 18 +- Alloy/commands/remove/index.js | 14 +- Alloy/commands/test/index.js | 9 +- Alloy/common/constants.js | 272 --- Alloy/lib/alloy/sync/localStorage.js | 100 - Alloy/logger.js | 85 - Alloy/template/component.js | 58 - Alloy/template/wpath.js | 8 - Alloy/tiapp.js | 208 -- Alloy/utils.js | 674 ------ package-lock.json | 1861 ++++++++--------- 130 files changed, 962 insertions(+), 9195 deletions(-) delete mode 100644 Alloy/commands/compile/BuildLog.js delete mode 100644 Alloy/commands/compile/ast/builtins-plugin.js delete mode 100644 Alloy/commands/compile/ast/controller.js delete mode 100644 Alloy/commands/compile/ast/handle-alloy-globals.js delete mode 100644 Alloy/commands/compile/ast/optimizer-plugin.js delete mode 100755 Alloy/commands/compile/compilerUtils.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract.Actions.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract.BarItemType.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract.BarItemTypes.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract.ButtonName.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract.ButtonNames.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract.ContentView.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract.CoverFlowImageType.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract.CoverFlowImageTypes.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract.FixedSpace.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract.FlexSpace.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract.Item.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract.ItemTemplate.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract.Items.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract.Option.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract.Options.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract.Preview.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract._BackboneClass.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract._ItemArray.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract._ItemContainer.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Abstract._ProxyProperty.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Collection.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Model.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Module.js delete mode 100755 Alloy/commands/compile/parsers/Alloy.Require.js delete mode 100644 Alloy/commands/compile/parsers/Alloy.Widget.js delete mode 100644 Alloy/commands/compile/parsers/README.md delete mode 100644 Alloy/commands/compile/parsers/Ti.Android.ActionBar.js delete mode 100644 Alloy/commands/compile/parsers/Ti.Android.Menu.js delete mode 100644 Alloy/commands/compile/parsers/Ti.Android.MenuItem.js delete mode 100755 Alloy/commands/compile/parsers/Ti.Map.Annotation.js delete mode 100755 Alloy/commands/compile/parsers/Ti.Map.View.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.AlertDialog.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.Android.CardView.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.Android.DrawerLayout.CenterView.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.Android.DrawerLayout.LeftView.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.Android.DrawerLayout.RightView.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.Android.DrawerLayout._ProxyProperty.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.AndroidView.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.AttributedString.js delete mode 100755 Alloy/commands/compile/parsers/Ti.UI.Button.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.ButtonBar.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.DashboardView.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.ImageView.js delete mode 100755 Alloy/commands/compile/parsers/Ti.UI.Label.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.ListItem.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.ListSection.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.ListView.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.MobileWeb.NavigationGroup.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.NavigationWindow.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.OptionDialog.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.Picker.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.PickerColumn.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.ScrollView.js delete mode 100755 Alloy/commands/compile/parsers/Ti.UI.ScrollableView.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.Switch.js delete mode 100755 Alloy/commands/compile/parsers/Ti.UI.Tab.js delete mode 100755 Alloy/commands/compile/parsers/Ti.UI.TabGroup.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.TabbedBar.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.TableView.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.TableViewSection.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.TextArea.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.TextField.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.Toolbar.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.WebView.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.Window.LeftNavButton.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.Window.LeftNavButtons.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.Window.RightNavButton.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.Window.RightNavButtons.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.Window.TitleControl.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.Window.WindowToolbar.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.Window._ProxyProperty.js delete mode 100755 Alloy/commands/compile/parsers/Ti.UI.Windows.AppBarButton.js delete mode 100755 Alloy/commands/compile/parsers/Ti.UI.Windows.AppBarSeparator.js delete mode 100755 Alloy/commands/compile/parsers/Ti.UI.Windows.AppBarToggleButton.js delete mode 100755 Alloy/commands/compile/parsers/Ti.UI.Windows.CommandBar.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.iOS.CoverFlowView.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.iOS.MenuPopup.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.iOS.PreviewAction.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.iOS.PreviewActionGroup.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.iOS.PreviewContext.js delete mode 100755 Alloy/commands/compile/parsers/Ti.UI.iOS.SplitWindow.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.iPad.Popover.ContentView.js delete mode 100644 Alloy/commands/compile/parsers/Ti.UI.iPad.Popover._ProxyProperty.js delete mode 100755 Alloy/commands/compile/parsers/Ti.UI.iPhone.NavigationGroup.js delete mode 100644 Alloy/commands/compile/parsers/_ProxyProperty.ActionView.js delete mode 100644 Alloy/commands/compile/parsers/_ProxyProperty.KeyboardToolbar.js delete mode 100644 Alloy/commands/compile/parsers/_ProxyProperty.LeftButton.js delete mode 100644 Alloy/commands/compile/parsers/_ProxyProperty.RightButton.js delete mode 100644 Alloy/commands/compile/parsers/_ProxyProperty._Lists.js delete mode 100644 Alloy/commands/compile/parsers/_ProxyProperty.js delete mode 100755 Alloy/commands/compile/parsers/base.js delete mode 100755 Alloy/commands/compile/parsers/default.js delete mode 100644 Alloy/commands/compile/parsers/default_abstract.js delete mode 100644 Alloy/commands/compile/sourceMapper.js delete mode 100644 Alloy/commands/compile/styler.js delete mode 100755 Alloy/common/constants.js delete mode 100755 Alloy/lib/alloy/sync/localStorage.js delete mode 100755 Alloy/logger.js delete mode 100755 Alloy/template/component.js delete mode 100644 Alloy/template/wpath.js delete mode 100644 Alloy/tiapp.js delete mode 100755 Alloy/utils.js diff --git a/Alloy/alloy.js b/Alloy/alloy.js index 1dd6c929f..6408078b8 100755 --- a/Alloy/alloy.js +++ b/Alloy/alloy.js @@ -4,15 +4,18 @@ * See LICENSE for more information on licensing. */ var program = require('commander'), - logger = require('./logger'), os = require('os'), - U = require('./utils'), colors = require('colors'), _ = require('lodash'), - pkginfo = require('pkginfo')(module, 'version'), path = require('path'), - fs = require('fs'), - CONST = require('./common/constants'); + fs = require('fs'); + +const { + constants: CONST, + logger, + platforms, + utils: U +} = require('alloy-utils'); // patch to remove the warning in node >=0.8 path.existsSync = fs.existsSync || path.existsSync; @@ -98,8 +101,8 @@ if (program.args.length === 0) { process.exit(0); } -if (program.platform && !_.includes(CONST.PLATFORM_FOLDERS_ALLOY, program.platform)) { - U.die('Invalid platform "' + program.platform + '" specified, must be [' + CONST.PLATFORM_FOLDERS_ALLOY.join(',') + ']'); +if (program.platform && !_.includes(platforms.constants.PLATFORM_FOLDERS_ALLOY, program.platform)) { + U.die('Invalid platform "' + program.platform + '" specified, must be [' + platforms.constants.PLATFORM_FOLDERS_ALLOY.join(',') + ']'); } // Validate the given command diff --git a/Alloy/commands/compile/BuildLog.js b/Alloy/commands/compile/BuildLog.js deleted file mode 100644 index 6210ead2e..000000000 --- a/Alloy/commands/compile/BuildLog.js +++ /dev/null @@ -1,59 +0,0 @@ -var fs = require('fs-extra'), - chmodr = require('chmodr'), - path = require('path'), - CONST = require('../../common/constants'), - logger = require('../../logger'); - -var dir, file, projectPath; - -function BuildLog(_projectPath) { - // make/reference singleton instance - if (BuildLog.instance) { - return BuildLog.instance; - } - BuildLog.instance = this; - - // set "private" variables - projectPath = _projectPath; - dir = path.join(projectPath, CONST.DIR.BUILD); - file = path.join(dir, 'build.json'); - - // expose data object - this.isNew = true; - this.data = {}; - - // make sure the alloy build folder exists - if (!fs.existsSync(dir)) { - fs.mkdirpSync(dir); - chmodr.sync(dir, 0755); - } - - // load it up - this.read(); -} - -BuildLog.prototype.read = function() { - if (!fs.existsSync(file)) { - this.isNew = true; - this.data = {}; - } else { - this.isNew = false; - try { - this.data = JSON.parse(fs.readFileSync(file, 'utf8')); - } catch (e) { - logger.warn('Build log at "' + path.relative(projectPath, file) + - '" is corrupt, creating a new one...'); - this.data = {}; - } - } -}; - -BuildLog.prototype.write = function() { - try { - fs.writeFileSync(file, JSON.stringify(this.data)); - } catch (e) { - logger.warn('Unable to write build log to "' + path.relative(projectPath, file) + '"'); - } -}; - -module.exports = BuildLog; diff --git a/Alloy/commands/compile/CompilerMakeFile.js b/Alloy/commands/compile/CompilerMakeFile.js index c2fd9f8d7..43ff67e51 100755 --- a/Alloy/commands/compile/CompilerMakeFile.js +++ b/Alloy/commands/compile/CompilerMakeFile.js @@ -1,5 +1,6 @@ -var logger = require('../../logger'), - colors = require('colors'); +var colors = require('colors'); + +const { logger } = require('alloy-utils'); function CompilerMakeFile() { var handlers = {}; diff --git a/Alloy/commands/compile/Orphanage.js b/Alloy/commands/compile/Orphanage.js index 0db007e83..9ed68a54e 100644 --- a/Alloy/commands/compile/Orphanage.js +++ b/Alloy/commands/compile/Orphanage.js @@ -6,12 +6,15 @@ var fs = require('fs-extra'), walkSync = require('walk-sync'), path = require('path'), - platforms = require('../../../platforms/index'), - logger = require('../../logger'), - CONST = require('../../common/constants'), - U = require('../../utils'), _ = require('lodash'); +const { + constants: CONST, + logger, + platforms, + utils: U +} = require('alloy-utils'); + var ALLOY_ROOT = path.join(__dirname, '..', '..'); var dirs, platform, titaniumFolder, theme, adapters; diff --git a/Alloy/commands/compile/ast/builtins-plugin.js b/Alloy/commands/compile/ast/builtins-plugin.js deleted file mode 100644 index de5fc4ab1..000000000 --- a/Alloy/commands/compile/ast/builtins-plugin.js +++ /dev/null @@ -1,91 +0,0 @@ -var path = require('path'), - fs = require('fs'), - _ = require('lodash'), - logger = require('../../../logger'), - U = require('../../../utils'); - -var EXCLUDE = ['backbone', 'CFG', 'underscore']; -var BUILTINS_PATH = path.join(__dirname, '..', '..', '..', 'builtins'); -var loaded = []; - -function appendExtension(file, extension) { - extension = '.' + extension; - file = U.trim(file); - - var len = extension.length; - if (file.substring(file.length - extension.length) !== extension) { - return file + extension; - } else { - return file; - } -} - -function loadBuiltin(source, name, dest) { - if (!path.existsSync(source)) { - return; - } - - logger.debug(' - [' + name + '] --> "' + dest + '"'); - U.copyFileSync(source, dest); - loaded = _.union(loaded, [name]); -} - -function loadMomentLanguages(config) { - // retrieve the languages of the project - var i18nPath = path.join(config.dir.project, 'i18n'); - if (fs.existsSync(i18nPath)) { - var languages = _.filter(fs.readdirSync(i18nPath), function(file) { - return fs.statSync(path.join(i18nPath, file)).isDirectory(); - }); - - // filter the momentjs translation files that match one of these languages - var availableI18nPath = path.join(BUILTINS_PATH, 'moment', 'lang'); - var fileNames = _.filter(fs.readdirSync(availableI18nPath), function(file) { - return _.indexOf(languages, file.substr(0, 2)) !== -1; - }); - - // import these files - _.each(fileNames, function(file) { - var source = path.join(BUILTINS_PATH, 'moment', 'lang', file); - var dest = path.join(config.dir.resources, 'alloy', 'moment', 'lang', file); - loadBuiltin(source, file, dest); - }); - } -} - -module.exports = function (_ref) { - var types = _ref.types; - var rx = /^(\/?alloy)\/(.+)$/; - - return { - visitor: { - CallExpression: function(p) { - var theString = p.node.arguments[0], - match; - if (p.node.callee.name === 'require' && // Is this a require call? - theString && types.isStringLiteral(theString) && // Is the 1st param a literal string? - (match = theString.value.match(rx)) !== null && // Is it an alloy module? - !_.includes(EXCLUDE, match[2]) && // Make sure it's not excluded. - !_.includes(loaded, match[2]) // Make sure we didn't find it already - ) { - // Make sure it hasn't already been copied to Resources - var name = appendExtension(match[2], 'js'); - if (fs.existsSync(path.join(this.opts.dir.resources, match[1], name))) { - return; - } - - // make sure the builtin exists - var source = path.join(BUILTINS_PATH, name); - var dest = path.join(this.opts.dir.resources, 'alloy', name); - loadBuiltin(source, name, dest); - - if ('moment.js' === name) { - // if momentjs is required in the project, also load the - // localizations which may be used - loadMomentLanguages(this.opts); - } - } - } - } - }; -}; diff --git a/Alloy/commands/compile/ast/controller.js b/Alloy/commands/compile/ast/controller.js deleted file mode 100644 index 82af33902..000000000 --- a/Alloy/commands/compile/ast/controller.js +++ /dev/null @@ -1,96 +0,0 @@ -var U = require('../../../utils'), - babylon = require('@babel/parser'), - types = require('@babel/types'), - generate = require('@babel/generator').default, - { default: traverse, Hub, NodePath } = require('@babel/traverse'); - -var isBaseControllerExportExpression = types.buildMatchMemberExpression('exports.baseController'); - -const GENCODE_OPTIONS = { - retainLines: true -}; - -exports.processController = function(code, file) { - var baseController = '', - moduleCodes = '', - newCode = '', - exportSpecifiers = []; - - try { - var ast = babylon.parse(code, { sourceFilename: file, sourceType: 'unambiguous' }); - - const hub = new Hub(); - hub.buildError = function (node, message, Error) { - const loc = node && node.loc; - const err = new Error(message); - - if (loc) { - err.loc = loc.start; - } - - return err; - }; - const path = NodePath.get({ - hub: hub, - parent: ast, - container: ast, - key: 'program' - }).setContext(); - traverse(ast, { - enter: function(path) { - if (types.isAssignmentExpression(path.node) && isBaseControllerExportExpression(path.node.left)) { - // what's equivalent of print_to_string()? I replaced with simple value property assuming it's a string literal - baseController = '\'' + path.node.right.value + '\''; - } - }, - - ImportDeclaration: function(path) { - moduleCodes += generate(path.node, GENCODE_OPTIONS).code; - path.remove(); - }, - - ExportNamedDeclaration: function(path) { - var node = path.node; - var specifiers = node.specifiers; - if (specifiers && specifiers.length !== 0) { - specifiers.forEach(function (specifier) { - if (specifier.local && specifier.local.name) { - exportSpecifiers.push(specifier.local.name); - } - }); - } - moduleCodes += generate(node, GENCODE_OPTIONS).code; - path.remove(); - } - }, path.scope); - - if (exportSpecifiers.length > 0) { - traverse(ast, { - enter: function(path) { - var node = path.node, - name; - if (node.type === 'VariableDeclaration') { - name = node.declarations[0].id.name; - } else if (node.type === 'FunctionDeclaration' || node.type === 'ClassDeclaration') { - name = node.id.name; - } - - if (exportSpecifiers.indexOf(name) !== -1) { - moduleCodes += generate(node, GENCODE_OPTIONS).code; - path.remove(); - } - } - }); - } - - newCode = generate(ast, GENCODE_OPTIONS).code; - } catch (e) { - U.dieWithCodeFrame('Error generating AST for "' + file + '". Unexpected token at line ' + e.loc.line + ' column ' + e.loc.column, e.loc, code); - } - - return { - es6mods: moduleCodes, - base: baseController, - code: newCode - }; -}; diff --git a/Alloy/commands/compile/ast/handle-alloy-globals.js b/Alloy/commands/compile/ast/handle-alloy-globals.js deleted file mode 100644 index 8aec620fd..000000000 --- a/Alloy/commands/compile/ast/handle-alloy-globals.js +++ /dev/null @@ -1,98 +0,0 @@ -const ALLOY_GLOBALS_TO_CHECK = [ 'Alloy', '_', 'Backbone' ]; -const template = require('@babel/template').default; - -const buildRequire = template(` - var VARIABLE = REQUIRECALL; -`); -module.exports = function(babel) { - return { - name: 'app.js top level variables global transform', - visitor: { - CallExpression: function (path, state) { - const node = path.node; - if (node.callee.name !== 'require') { - return; - } - if (!node.arguments || !node.arguments[0]) { - return; - } - checkStatement(node.arguments[0].value, state); - }, - ImportDeclaration (path, state) { - const node = path.node; - if (!node.source || !node.source.value) { - return; - } - checkStatement(node.source.value, state); - }, - ReferencedIdentifier(path) { - const name = path.node.name; - if (ALLOY_GLOBALS_TO_CHECK.includes(name) // Is this identifier one of the special 3 - && !this.required.includes(name) // Have we already imported it - && !path.scope.hasBinding(name) // Does this binding already exist in the scope? (e.g user might import lodash as _ which we don't want to override) - ) { - this.required.push(name); - switch (name) { - case 'Alloy': - this.toRequire.push({ - VARIABLE: 'Alloy', - REQUIRECALL: 'require(\'/alloy\')' - }); - break; - case '_': - this.toRequire.push({ - VARIABLE: '_', - REQUIRECALL: 'require(\'/alloy/underscore\')._' - }); - break; - case 'Backbone': - this.toRequire.push({ - VARIABLE: 'Backbone', - REQUIRECALL: 'require(\'/alloy/backbone\')' - }); - break; - } - - } - }, - Program: { - enter() { - this.toRequire = []; - this.required = []; - }, - - exit(path) { - if (this.toRequire.length) { - for (const data of this.toRequire) { - path.unshiftContainer('body', [ - buildRequire(data) - ]); - } - } - } - } - } - }; -}; - -/** - * - * @param {String} moduleName - Module name in the import or require statement - * @param {Object} state - Babel state object - */ -function checkStatement(moduleName, state) { - switch (moduleName) { - case 'alloy': - case '/alloy': - state.required.push('Alloy'); - break; - case 'alloy/underscore': - case '/alloy/underscore': - state.required.push('_'); - break; - case 'alloy/backbone': - case '/alloy/backbone': - state.required.push('Backbone'); - break; - } -} diff --git a/Alloy/commands/compile/ast/optimizer-plugin.js b/Alloy/commands/compile/ast/optimizer-plugin.js deleted file mode 100644 index 34d6248c4..000000000 --- a/Alloy/commands/compile/ast/optimizer-plugin.js +++ /dev/null @@ -1,71 +0,0 @@ -var CONST = require('../../../common/constants'), - _ = require('lodash'), - path = require('path'), - fs = require('fs'); - -// Walk tree transformer changing (Ti|Titanium).Platform.(osname|name) -// into static strings where possible. This will allow the following -// compression step to reduce the code further. -module.exports = function (_ref) { - var types = _ref.types; - - var isTiPlatform = types.buildMatchMemberExpression('Ti.Platform'); - var isTitaniumPlatform = types.buildMatchMemberExpression('Titanium.Platform'); - - return { - pre: function(state) { - var config = this.opts || {}; - config.deploytype = config.deploytype || 'development'; - - // create list of platform and deploy type defines - var defines = {}; - _.each(CONST.DEPLOY_TYPES, function(d) { - defines[d.key] = config.deploytype === d.value; - }); - _.each(CONST.DIST_TYPES, function(d) { - defines[d.key] = _.includes(d.value, config.target); - }); - _.each(CONST.PLATFORMS, function(p) { - defines['OS_' + p.toUpperCase()] = config.platform === p; - }); - this.defines = defines; - - // make sure the platform require includes - var platformString = config.platform.toLowerCase(); - var platformPath = path.join(__dirname, '..', '..', '..', '..', 'platforms', platformString, 'index'); - if (!fs.existsSync(platformPath + '.js')) { - this.platform = {name: undefined, osname: undefined }; - } else { - // create, transform, and validate the platform object - this.platform = require(platformPath); - if (!_.isString(this.platform.name)) { this.platform.name = undefined; } - if (!_.isString(this.platform.osname)) { this.platform.osname = undefined; } - } - }, - visitor: { - MemberExpression: function(path, state) { - // console.log(JSON.stringify(path.node)); - var name = ''; - if (types.isStringLiteral(path.node.property)) { - name = path.node.property.value; - } else if (types.isIdentifier(path.node.property)) { - name = path.node.property.name; - } else { - return; - } - - if ((name === 'name' || name === 'osname') && this.platform[name]) { - if (isTiPlatform(path.node.object) || isTitaniumPlatform(path.node.object)) { - path.replaceWith(types.stringLiteral(this.platform[name])); - } - } - }, - Identifier: function(path) { - if (this.defines.hasOwnProperty(path.node.name) && - (path.parent.type !== 'VariableDeclarator' || path.node.name !== path.parent.id.name)) { - path.replaceWith(types.booleanLiteral(this.defines[path.node.name])); - } - } - } - }; -}; diff --git a/Alloy/commands/compile/compilerUtils.js b/Alloy/commands/compile/compilerUtils.js deleted file mode 100755 index cf5e757a0..000000000 --- a/Alloy/commands/compile/compilerUtils.js +++ /dev/null @@ -1,1033 +0,0 @@ -var U = require('../../utils'), - colors = require('colors'), - path = require('path'), - os = require('os'), - fs = require('fs-extra'), - walkSync = require('walk-sync'), - chmodr = require('chmodr'), - jsonlint = require('jsonlint'), - logger = require('../../logger'), - astController = require('./ast/controller'), - _ = require('lodash'), - styler = require('./styler'), - XMLSerializer = require('xmldom').XMLSerializer, - CONST = require('../../common/constants'); - -/////////////////////////////////////// -////////// private variables ////////// -/////////////////////////////////////// -var alloyRoot = path.join(__dirname, '..', '..'), - platformsDir = path.join(alloyRoot, '..', 'platforms'), - alloyUniqueIdPrefix = '__alloyId', - alloyUniqueIdCounter = 0, - JSON_NULL = JSON.parse('null'), - compilerConfig; - -/////////////////////////////// -////////// constants ////////// -/////////////////////////////// -var RESERVED_ATTRIBUTES = [ - 'platform', - 'formFactor', - 'if', - CONST.BIND_COLLECTION, - CONST.BIND_WHERE, - CONST.AUTOSTYLE_PROPERTY, - 'ns', - 'method', - 'module' - ], - RESERVED_ATTRIBUTES_REQ_INC = [ - 'platform', - 'type', - 'src', - 'formFactor', - 'if', - CONST.BIND_COLLECTION, - CONST.BIND_WHERE, - CONST.AUTOSTYLE_PROPERTY, - 'ns', - 'method', - 'module' - ], - RESERVED_EVENT_REGEX = new RegExp(`^(?:(${CONST.PLATFORMS.join('|')}):)?on([A-Z].+)`); - -// load CONDITION_MAP with platforms -exports.CONDITION_MAP = { - handheld: { - runtime: '!Alloy.isTablet' - }, - tablet: { - runtime: 'Alloy.isTablet' - } -}; -_.each(CONST.PLATFORMS, function(p) { - exports.CONDITION_MAP[p] = require(path.join(platformsDir, p, 'index'))['condition']; -}); - -exports.bindingsMap = {}; -exports.destroyCode = ''; -exports.postCode = ''; -exports.models = []; -exports.dataFunctionNames = {}; - -////////////////////////////////////// -////////// public interface ////////// -////////////////////////////////////// -exports.getCompilerConfig = function() { - return compilerConfig; -}; - -exports.generateVarName = function(id, name) { - if (_.includes(CONST.JS_RESERVED_ALL, id)) { - U.die([ - 'Invalid ID "' + id + '" for <' + name + '>.', - 'Can\'t use reserved Javascript words as IDs.', - 'Reserved words: [' + CONST.JS_RESERVED_ALL.sort().join(',') + ']' - ]); - } - return '$.__views["' + id + '"]'; -}; - -exports.generateUniqueId = function() { - return alloyUniqueIdPrefix + alloyUniqueIdCounter++; -}; - -exports.getNodeFullname = function(node) { - var name = node.nodeName, - ns = node.getAttribute('ns') || CONST.IMPLICIT_NAMESPACES[name] || CONST.NAMESPACE_DEFAULT, - fullname = ns + '.' + name; - - return fullname; -}; - -exports.isNodeForCurrentPlatform = function(node) { - var isForCurrentPlatform = !node.hasAttribute('platform') || !compilerConfig || !compilerConfig.alloyConfig; - _.each(node.getAttribute('platform').split(','), function(p) { - // need to account for multiple platforms and negation, such as - // platform=ios,android or platform=!ios or platform="android,!mobileweb" - p = p.trim(); - if (p === compilerConfig.alloyConfig.platform || (p.indexOf('!') === 0 && p.slice(1) !== compilerConfig.alloyConfig.platform)) { - isForCurrentPlatform = true; - } - }); - return isForCurrentPlatform; -}; -exports.getParserArgs = function(node, state, opts) { - state = state || {}; - opts = opts || {}; - - var defaultId = opts.defaultId || undefined, - doSetId = opts.doSetId === false ? false : true, - name = node.nodeName, - ns = node.getAttribute('ns') || CONST.IMPLICIT_NAMESPACES[name] || CONST.NAMESPACE_DEFAULT, - fullname = (ns && ns.length) ? (ns + '.' + name) : name, - id = node.getAttribute('id') || defaultId || exports.generateUniqueId(), - platform = node.getAttribute('platform'), - formFactor = node.getAttribute('formFactor'), - tssIf = node.getAttribute('if'), - platformObj; - - // make sure we're not reusing the default ID for the first top level element - if (id === exports.currentDefaultId && - (node.parentNode && node.parentNode.nodeName !== 'Alloy') && - !node.__idWarningHandled) { - logger.warn([ - '<' + name + '> at line ' + node.lineNumber + - ' is using this view\'s default ID "' + id + '". ' + - 'Only a top-level element in a view should use the default ID' - ]); - node.__idWarningHandled = true; - } - - // handle binding arguments - var bindObj = {}; - bindObj[CONST.BIND_COLLECTION] = node.getAttribute(CONST.BIND_COLLECTION); - bindObj[CONST.BIND_WHERE] = node.getAttribute(CONST.BIND_WHERE); - bindObj[CONST.BIND_TRANSFORM] = node.getAttribute(CONST.BIND_TRANSFORM); - bindObj[CONST.BIND_FUNCTION] = node.getAttribute(CONST.BIND_FUNCTION); - - // cleanup namespaces and nodes - ns = ns.replace(/^Titanium\./, 'Ti.'); - if (doSetId && !_.includes(CONST.MODEL_ELEMENTS, fullname)) { - node.setAttribute('id', id); - } - - // process the platform attribute - if (platform) { - platformObj = {}; - _.each((platform).split(','), function(p) { - var matches = U.trim(p).match(/^(\!{0,1})(.+)/); - if (matches !== null) { - var negate = matches[1]; - var name = matches[2]; - if (_.includes(CONST.PLATFORMS, name)) { - if (negate === '!') { - _.each(_.without(CONST.PLATFORMS, name), function(n) { - platformObj[n] = true; - }); - } else { - platformObj[name] = true; - } - return; - } - } - U.die('Invalid platform type found: ' + p); - }); - } - - // get create arguments and events from attributes - var createArgs = {}, - events = []; - var attrs = _.includes(['Alloy.Require'], fullname) ? - RESERVED_ATTRIBUTES_REQ_INC : - RESERVED_ATTRIBUTES; - - // determine whether to autoStyle this component - // 1. autoStyle attribute - // 2. autoStyle from - // 3. autoStyle from config.json - var autoStyle = (function() { - var prop = CONST.AUTOSTYLE_PROPERTY; - if (node.hasAttribute(prop)) { - return node.getAttribute(prop) === 'true'; - } else { - return exports[prop]; - } - })(); - - // TODO: Add the apiName until TIMOB-12553 is resolved - if (autoStyle) { - createArgs[CONST.APINAME_PROPERTY] = fullname; - } - - _.each(node.attributes, function(attr) { - var attrName = attr.nodeName; - if (_.includes(attrs, attrName)) { return; } - var matches = attrName.match(RESERVED_EVENT_REGEX); - if (matches !== null && exports.isNodeForCurrentPlatform(node) && !_.includes(CONST.SPECIAL_PROPERTY_NAMES, attrName)) { - if (matches[1] && compilerConfig.alloyConfig.platform !== matches[1]) { - return; - } - events.push({ - name: U.lcfirst(matches[2]), - value: node.getAttribute(attrName) - }); - } else { - var theValue = node.getAttribute(attrName); - - // find platform specific attributes - var attributeParts = attrName.split(':'); - if ( attributeParts.length === 2 && _.includes(CONST.PLATFORMS, attributeParts[0])) { - // if this attribute is for this platform, create it without namespace. - if ( attributeParts[0] === compilerConfig.alloyConfig.platform ) { - attrName = attributeParts[1]; - } else { - return; - } - } - - if (/(^|\+)\s*(?:(?:Ti|Titanium|Alloy.Globals|Alloy.CFG|\$.args)\.|L\(.+\)\s*$)/.test(theValue)) { - var match = theValue.match(/^\s*L\([^'"]+\)\s*$/); - if (match !== null) { - theValue = theValue.replace(/\(/g, '("').replace(/\)/g, '")'); - } - theValue = styler.STYLE_EXPR_PREFIX + theValue; - } - - if (attrName === 'class') { - if (autoStyle) { - createArgs[CONST.CLASS_PROPERTY] = theValue.split(/\s+/) || []; - } - } else { - if (theValue === 'true') { - theValue = true; - } else if (theValue === 'false') { - theValue = false; - } else { - var n = parseInt(theValue); - if (!isNaN(n) && String(n) === theValue.trim()) { - theValue = n; - } else { - n = parseFloat(theValue); - if (!isNaN(n) && String(n) === theValue.trim()) { - theValue = n; - } - } - } - _.set(createArgs, attrName, theValue ); - } - } - }); - - if (autoStyle && !createArgs[CONST.CLASS_PROPERTY]) { - createArgs[CONST.CLASS_PROPERTY] = []; - } - - return _.extend({ - ns: ns, - name: name, - id: id, - fullname: fullname, - formFactor: node.getAttribute('formFactor'), - symbol: exports.generateVarName(id, name), - classes: node.getAttribute('class').split(' ') || [], - tssIf: node.getAttribute('if').split(',') || [], - parent: state.parent || {}, - platform: platformObj, - createArgs: createArgs, - events: events - }, bindObj); -}; - -exports.generateNodeExtended = function(node, state, newState) { - return exports.generateNode(node, _.extend(_.clone(state), newState)); -}; - -exports.generateNode = function(node, state, defaultId, isTopLevel, isModelOrCollection) { - if (node.nodeType != 1) return ''; - if (!exports.isNodeForCurrentPlatform(node)) { - return ''; - } - - var args = exports.getParserArgs(node, state, { defaultId: defaultId }), - codeTemplate = 'if (<%= condition %>) {\n<%= content %>}\n', - code = { - content: '', - pre: '' - }; - - // Check for platform specific considerations - var conditionType = compilerConfig && compilerConfig.alloyConfig && compilerConfig.alloyConfig.platform ? 'compile' : 'runtime'; - if (args.platform) { - var conditionArray = []; - _.each(args.platform, function(v, k) { - conditionArray.push(exports.CONDITION_MAP[k][conditionType]); - }); - - code.condition = '(' + conditionArray.join(' || ') + ')'; - } - - //Add form factor condition, if application form-factor specific runtime check - if (args.formFactor && exports.CONDITION_MAP[args.formFactor]) { - var check = exports.CONDITION_MAP[args.formFactor].runtime; - code.condition = (code.condition) ? code.condition += ' && ' + check : check; - } - - // ALOY-871: add the if condition check - args.tssIf = _.compact(args.tssIf); - if (args.tssIf.length > 0) { - if (code.condition) { - code.condition += (' && (' + args.tssIf.join(' || ') + ')'); - } else { - code.condition = args.tssIf.join(' || '); - } - } - - // pass relevant conditional information in state - if (code.condition) { - if (state.condition) { - state.condition += '&&' + code.condition; - } else { - state.condition = code.condition; - } - } - - // Determine which parser to use for this node - var parsersDir = path.join(alloyRoot, 'commands', 'compile', 'parsers'); - var parserRequire = 'default'; - if (_.includes(fs.readdirSync(parsersDir), args.fullname + '.js')) { - parserRequire = args.fullname + '.js'; - } - - // Execute the appropriate tag parser and append code - var isLocal = state.local; - // [ALOY-787] keeping track of widget id - var widgetId = state.widgetId; - state = require('./parsers/' + parserRequire).parse(node, state) || { parent: {} }; - code.content += state.code; - state.widgetId = widgetId; - - // Use local variable if given - if (isLocal && state.parent) { args.symbol = state.parent.symbol || args.symbol; } - - // Use manually given args.symbol if present - if (state.args) { args.symbol = state.args.symbol || args.symbol; } - - // add to list of top level views, if its top level - if (isTopLevel) { - if (state.isProxyProperty) { - delete state.isProxyProperty; - code.content += state.parent.symbol + ' && $.addProxyProperty("' + state.propertyName + - '", ' + state.parent.symbol + ');\n'; - } else { - code.content += args.symbol + ' && $.addTopLevelView(' + args.symbol + ');\n'; - } - } - - // handle any model/collection code - if (state.modelCode) { - code.pre += state.modelCode; - delete state.modelCode; - } - - // handle any events from markup - if (args.events && args.events.length > 0 && - !_.includes(CONST.SKIP_EVENT_HANDLING, args.fullname) && - !state.isViewTemplate) { - // determine which function name to use for event handling: - // * addEventListener() for Titanium proxies - // * on() for everything else (controllers, models, collections) - var eventFunc = /^Alloy\.(?:Collection|Model|Require|Widget)/.test(args.fullname) ? - 'on' : 'addEventListener'; - - _.each(args.events, function(ev) { - var eventObj = { - obj: isModelOrCollection ? state.args.symbol : args.symbol, - ev: ev.name, - cb: ev.value, - escapedCb: ev.value.replace(/'/g, "\\'"), - func: eventFunc - }, - postCode; - - if (_.includes(['Alloy.Widget', 'Alloy.Require'], args.fullname)) { - eventObj.obj = state.controller; - } - - // create templates for immediate and deferred event handler creation - var theDefer = _.template("__defers['<%= obj %>!<%= ev %>!<%= escapedCb %>']")(eventObj); - var theEvent; - if (eventFunc === 'addEventListener') { - theEvent = _.template("$.addListener(<%= obj %>,'<%= ev %>',<%= cb %>)")(eventObj); - } else { - theEvent = _.template("<%= obj %>.<%= func %>('<%= ev %>',<%= cb %>)")(eventObj); - } - var deferTemplate = theDefer + ' && ' + theEvent + ';'; - var immediateTemplate; - if (/[\.\[]/.test(eventObj.cb)) { - immediateTemplate = 'try{' + theEvent + ';}catch(e){' + theDefer + '=true;}'; - } else { - immediateTemplate = '<%= cb %>?' + theEvent + ':' + theDefer + '=true;'; - } - - // add the generated code to the view code and post-controller code respectively - code.content += _.template(immediateTemplate)(eventObj); - postCode = _.template(deferTemplate)(eventObj); - exports.postCode += state.condition ? _.template(codeTemplate)({ - condition: state.condition, - content: postCode - }) : postCode; - }); - } - - // Continue parsing if necessary - if (state.parent) { - var states = _.isArray(state.parent) ? state.parent : [state.parent]; - _.each(states, function(p) { - var parent = p.node; - if (!parent) { return; } - for (var i = 0, l = parent.childNodes.length; i < l; i++) { - var newState = _.defaults({ parent: p }, state); - if (node.hasAttribute('formFactor') || state.parentFormFactor) { - // propagate the form factor down through the hierarchy - newState.parentFormFactor = (node.getAttribute('formFactor') || state.parentFormFactor); - } - code.content += exports.generateNode(parent.childNodes.item(i), newState); - } - }); - } - - if (!isModelOrCollection) { - return code.condition ? _.template(codeTemplate)(code) : code.content; - } else { - return { - content: code.condition ? _.template(codeTemplate)(code) : code.content, - pre: code.condition ? _.template(codeTemplate)({content:code.pre}) : code.pre - }; - } -}; - -exports.expandRequireNode = function(requireNode, doRecursive) { - var cloneNode = requireNode.cloneNode(true); - - function getViewRequirePath(node) { - var regex = new RegExp('\\.' + CONST.FILE_EXT.VIEW + '$'), - src = node.getAttribute('src'), - fullname = exports.getNodeFullname(node), - name = node.getAttribute('name') || CONST.NAME_WIDGET_DEFAULT, - type = fullname === 'Alloy.Widget' ? 'widget' : node.getAttribute('type') || CONST.REQUIRE_TYPE_DEFAULT, - fullpaths = []; - - var platform; - if (compilerConfig && compilerConfig.alloyConfig && compilerConfig.alloyConfig.platform) { - platform = compilerConfig.alloyConfig.platform; - } - - // Must be a view, with a valid src, in a element - if (!src) { - return null; - } else if (fullname === 'Alloy.Require' && type === 'view') { - if (platform) { fullpaths.push(path.join(compilerConfig.dir.views, platform, src)); } - fullpaths.push(path.join(compilerConfig.dir.views, src)); - } else if (fullname === 'Alloy.Widget' || - (fullname === 'Alloy.Require' && type === 'widget')) { - U.getWidgetDirectories(compilerConfig.dir.home).forEach(function(wDir) { - if (wDir.manifest.id === src) { - if (platform) { - fullpaths.push(path.join(wDir.dir, CONST.DIR.VIEW, platform, name)); - } - fullpaths.push(path.join(wDir.dir, CONST.DIR.VIEW, name)); - } - }); - } else { - return null; - } - - // check the extensions on the paths to check - var found = false; - var fullpath; - for (var i = 0; i < fullpaths.length; i++) { - fullpath = fullpaths[i]; - fullpath += regex.test(fullpath) ? '' : '.' + CONST.FILE_EXT.VIEW; - if (fs.existsSync(fullpath)) { - found = true; - break; - } - } - - // abort if there's no view to be found - if (!found) { - U.die([ - type + ' "' + src + '" ' + (type === 'widget' ? 'view "' + name + '" ' : '') + - 'does not exist.', - 'The following paths were inspected:' - ].concat(fullpaths)); - } - - return fullpath; - } - - //create function, it expects 2 values. - function insertAfter(newElement, targetElement) { - //target is what you want it to go after. Look for this elements parent. - var parent = targetElement.parentNode; - - //if the parents lastchild is the targetElement... - if (parent.lastchild == targetElement) { - //add the newElement after the target element. - parent.appendChild(newElement); - } else { - // else the target has siblings, insert the new element between the target and it's next sibling. - parent.insertBefore(newElement, targetElement.nextSibling); - } - } - - function processRequire(node, isFirst) { - // make sure we have a valid required view and get its path - var fullpath = getViewRequirePath(node); - if (fullpath === null) { - return; - } - - // re-assemble XML with required elements - if (isFirst) { - cloneNode = U.XML.getAlloyFromFile(fullpath); - } else { - var newDocRoot = U.XML.getAlloyFromFile(fullpath); - _.each(U.XML.getElementsFromNodes(newDocRoot.childNodes), function(n) { - insertAfter(n, node); - }); - - node.parentNode.removeChild(node); - } - } - - // Expand the , recursively if specified - if (getViewRequirePath(cloneNode) !== null) { - processRequire(cloneNode, true); - while (doRecursive) { - var reqs = cloneNode.getElementsByTagName('Require'); - var widgets = cloneNode.getElementsByTagName('Widget'); - var all = []; - - // condense node lists into a single array - _.each(reqs, function(req) { - all.push(req); - }); - _.each(widgets, function(widget) { - all.push(widget); - }); - - // find all the valid widgets/requires - var viewRequires = _.filter(reqs, function(req) { - return getViewRequirePath(req) !== null; - }); - - if (viewRequires.length === 0) { - break; - } - - // TODO: https://jira.appcelerator.org/browse/ALOY-256 - //_.each(viewRequires, processRequire); - processRequire(viewRequires[0]); - } - } - - return cloneNode; -}; - -exports.inspectRequireNode = function(node) { - var newNode = exports.expandRequireNode(node, true); - var children = U.XML.getElementsFromNodes(newNode.childNodes); - var names = []; - - _.each(children, function(c) { - var args = exports.getParserArgs(c); - - // skip model elements when inspecting nodes for - if (_.includes(CONST.MODEL_ELEMENTS, args.fullname)) { - newNode.removeChild(c); - return; - } - - names.push(args.fullname); - }); - - return { - children: U.XML.getElementsFromNodes(newNode.childNodes), - length: names.length, - names: names - }; -}; - -exports.copyWidgetResources = function(resources, resourceDir, widgetId, opts) { - - opts = opts || {}; - var platform; - if (compilerConfig && compilerConfig.alloyConfig && compilerConfig.alloyConfig.platform) { - platform = compilerConfig.alloyConfig.platform; - } - - _.each(resources, function(dir) { - if (!path.existsSync(dir)) { return; } - logger.trace('WIDGET_SRC=' + path.relative(compilerConfig.dir.project, dir)); - var files = walkSync(dir); - _.each(files, function(file) { - file = path.normalize(file); - var source = path.join(dir, file); - - // make sure the file exists and that it is not filtered - if (!fs.existsSync(source) || - (opts.filter && opts.filter.test(file)) || - (opts.exceptions && _.includes(opts.exceptions, file))) { - return; - } - - if (fs.statSync(source).isFile()) { - var dirname = path.dirname(file); - var parts = dirname.split(/[\/\\]/); - if (opts.titaniumFolder && parts[0] === opts.titaniumFolder) { - dirname = parts.slice(1).join('/'); - } - - var destDir = path.join(resourceDir, dirname, widgetId); - var dest = path.join(destDir, path.basename(file)); - if (!path.existsSync(destDir)) { - fs.mkdirpSync(destDir); - chmodr.sync(destDir, 0755); - } - - logger.trace('Copying ' + file.yellow + ' --> ' + - path.relative(compilerConfig.dir.project, dest).yellow + '...'); - U.copyFileSync(source, dest); - } - }); - - // [ALOY-1002] Remove ios folder copied from widget - var iosDir = path.join(resourceDir, 'ios'); - if (fs.existsSync(iosDir)) { - fs.removeSync(iosDir); - } - logger.trace(' '); - }); - - if (opts.theme) { - // if this widget has been themed, copy its theme assets atop the stock ones - var widgetThemeDir = path.join(compilerConfig.dir.project, 'app', 'themes', opts.theme, 'widgets', widgetId); - if (fs.existsSync(widgetThemeDir)) { - logger.trace('Processing themed widgets'); - var widgetAssetSourceDir = path.join(widgetThemeDir, 'assets'); - var widgetAssetTargetDir = path.join(resourceDir, widgetId); - if (fs.existsSync(widgetAssetSourceDir)) { - fs.copySync(widgetAssetSourceDir, widgetAssetTargetDir, {preserveTimestamps: true}); - } - // platform-specific assets from the widget must override those of the theme - if (platform && path.existsSync(path.join(resources[0], platform))) { - fs.copySync(path.join(resources[0], platform), widgetAssetTargetDir, {preserveTimestamps: true}); - } - // however platform-specific theme assets must override the platform assets from the widget - if (platform && path.existsSync(path.join(widgetAssetSourceDir, platform))) { - logger.trace('Processing platform-specific theme assets for the ' + widgetId + ' widget'); - widgetAssetSourceDir = path.join(widgetAssetSourceDir, platform); - fs.copySync(widgetAssetSourceDir, widgetAssetTargetDir, {preserveTimestamps: true}); - } - - // [ALOY-1002] Remove platform-specific folders copied from theme - if (fs.existsSync(widgetAssetTargetDir)) { - var files = walkSync(widgetAssetTargetDir); - _.each(files, function(file) { - var source = path.join(widgetAssetTargetDir, file); - if (path.existsSync(source) && fs.statSync(source).isDirectory()) { - fs.removeSync(source); - } - }); - } - } - } -}; - -exports.mergeI18N = function mergeI18N(src, dest, opts) { - var serializer = new XMLSerializer(); - opts || (opts = {}); - - (function walk(src, dest) { - if (!fs.existsSync(src)) return; - - fs.readdirSync(src).forEach(function (name) { - var srcFile = path.join(src, name); - var destFile = path.join(dest, name); - - if (!fs.existsSync(srcFile)) return; - - if (fs.statSync(srcFile).isDirectory()) { - fs.existsSync(destFile) || fs.mkdirpSync(destFile); - chmodr.sync(destFile, 0755); - return walk(srcFile, destFile); - } - - if (!fs.existsSync(destFile)) { - logger.debug('Writing ' + destFile.yellow); - return U.copyFileSync(srcFile, destFile); - } - - if (!/\.xml$/.test(srcFile)) { - return; - } - - // merge! - var existing = {}; - var destXml = U.XML.parseFromFile(destFile); - var destDoc = destXml.documentElement; - var srcXml = U.XML.parseFromFile(srcFile); - var srcDoc = srcXml.documentElement; - - if (!destDoc) { - U.die('Error processing "' + destFile + '"'); - } - - if (!srcDoc) { - U.die('Error processing "' + srcFile + '"'); - } - - _.each(destDoc.getElementsByTagName('string'), function (node) { - var name = node.getAttribute('name'); - existing[name] = node; - }); - - _.each(srcDoc.getElementsByTagName('string'), function (node) { - var name = node.getAttribute('name'); - if (!existing.hasOwnProperty(name)) { - destDoc.appendChild(destXml.createTextNode('\t')); - destDoc.appendChild(node); - destDoc.appendChild(destXml.createTextNode('\n')); - } else if (opts.override) { - destDoc.replaceChild(node, existing[name]); - } - }); - - logger.debug('Merging ' + srcFile.yellow + ' --> ' + destFile.yellow); - fs.writeFileSync(destFile, serializer.serializeToString(destXml), 'utf8'); - }); - }(src, dest)); -}; - -function updateImplicitNamspaces(platform) { - switch (platform) { - case 'android': - break; - case 'ios': - break; - case 'mobileweb': - CONST.IMPLICIT_NAMESPACES.NavigationGroup = 'Ti.UI.MobileWeb'; - break; - } -} - -exports.createCompileConfig = function(inputPath, outputPath, alloyConfig, buildLog) { - var dirs = ['assets', 'config', 'controllers', 'lib', 'migrations', 'models', 'styles', 'themes', 'vendor', 'views', 'widgets']; - var libDirs = ['builtins', 'template']; - var resources = path.resolve(path.join(outputPath, 'Resources')); - - var obj = { - alloyConfig: alloyConfig, - dir: { - home: path.resolve(inputPath), - project: path.resolve(outputPath), - resources: resources, - resourcesAlloy: path.join(resources, 'alloy') - }, - buildLog: buildLog - }; - - // create list of dirs - _.each(dirs, function(dir) { - obj.dir[dir] = path.resolve(path.join(inputPath, dir)); - }); - _.each(libDirs, function(dir) { - obj.dir[dir] = path.resolve(path.join(alloyRoot, dir)); - }); - - // ensure the generated directories exist - U.ensureDir(obj.dir.resources); - - // process and normalize the config.json file - var configs = _.defaults(generateConfig(obj), { - // sets the theme - theme: undefined, - - // are we going to generate sourcemaps? - sourcemap: true, - - // are we enabling dynamic styling for all generated components? - autoStyle: false, - - // the list of widget dependencies - dependencies: {}, - - // TODO: Include no adapters by default - adapters: CONST.ADAPTERS - }); - - // normalize adapters - if (!configs.adapters) { - configs.adapters = []; - } else if (!_.isArray(configs.adapters)) { - configs.adapters = [configs.adapters]; - } - - logger.debug(JSON.stringify(configs, null, ' ').split(os.EOL)); - - // update implicit namespaces, if possible - updateImplicitNamspaces(alloyConfig.platform); - - // keep a copy of the config for this module - compilerConfig = _.extend(obj, configs); - - return obj; -}; - -function generateConfig(obj) { - var buildLog = obj.buildLog; - var o = {}; - var alloyConfig = obj.alloyConfig; - var platform = require('../../../platforms/' + alloyConfig.platform + '/index').titaniumFolder; - //var defaultCfg = 'module.exports=' + JSON.stringify(o) + ';'; - - // get the app and resources locations - var appCfg = path.join(obj.dir.home, 'config.' + CONST.FILE_EXT.CONFIG); - var resourcesBase = (function() { - var base = obj.dir.resources; - if (platform) { base = path.join(base, platform); } - return path.join(base, 'alloy'); - })(); - var resourcesCfg = path.join(resourcesBase, 'CFG.js'); - - // parse config.json, if it exists - if (path.existsSync(appCfg)) { - o = exports.parseConfig(appCfg, alloyConfig, o); - - if (o.theme) { - var themeCfg = path.join(obj.dir.home, 'themes', o.theme, 'config.' + CONST.FILE_EXT.CONFIG); - - // parse theme config.json, if it exists - if (path.existsSync(themeCfg)) { - o = exports.parseConfig(themeCfg, alloyConfig, o); - } - } - } - - // only regenerate the CFG.js when necessary - var hash = U.createHashFromString(JSON.stringify(o)); - if (buildLog.data.cfgHash && buildLog.data.cfgHash === hash && fs.existsSync(path.join(obj.dir.resources, 'alloy', 'CFG.js'))) { - // use cached CFG.js file - logger.info(' [config.json] config.json unchanged, using cached config.json...'); - } else { - // cached CFG.js is out of sync with config.json, regenerate and save - logger.info(' [config.json] regenerating CFG.js from config.json...'); - buildLog.data.cfgHash = hash; - // write out the config runtime module - fs.mkdirpSync(resourcesBase); - chmodr.sync(resourcesBase, 0755); - - //logger.debug('Writing "Resources/' + (platform ? platform + '/' : '') + 'alloy/CFG.js"...'); - var output = 'module.exports=' + JSON.stringify(o) + ';'; - fs.writeFileSync(resourcesCfg, output); - - // TODO: deal with TIMOB-14884 - var baseFolder = path.join(obj.dir.resources, 'alloy'); - if (!fs.existsSync(baseFolder)) { - fs.mkdirpSync(baseFolder); - chmodr.sync(baseFolder, 0755); - } - fs.writeFileSync(path.join(baseFolder, 'CFG.js'), output); - } - - return o; -} - -exports.parseConfig = function(file, alloyConfig, o) { - var j, distType; - try { - j = jsonlint.parse(fs.readFileSync(file, 'utf8')); - } catch (e) { - U.die('Error processing "config.' + CONST.FILE_EXT.CONFIG + '"', e); - } - - _.each(j, function(v, k) { - if (!/^(?:env\:|os\:|dist\:)/.test(k) && k !== 'global') { - logger.debug(k + ' = ' + JSON.stringify(v)); - o[k] = v; - } - }); - - if (alloyConfig) { - o = _.extend(o, j['global']); - o = _.extend(o, j['env:' + alloyConfig.deploytype]); - o = _.extend(o, j['os:' + alloyConfig.platform]); - o = _.extend(o, j['env:' + alloyConfig.deploytype + ' os:' + alloyConfig.platform]); - o = _.extend(o, j['os:' + alloyConfig.platform + ' env:' + alloyConfig.deploytype]); - - if (alloyConfig.deploytype === 'production' && alloyConfig.target) { - distType = _.find(CONST.DIST_TYPES, function (obj) { return obj.value.indexOf(alloyConfig.target) !== -1; }); - if (distType) { - distType = distType.key.toLowerCase().replace('_', ':'); - o = _.extend(o, j[distType]); - o = _.extend(o, j['os:' + alloyConfig.platform + ' ' + distType]); - } - } - if (alloyConfig.theme) { - o.theme = alloyConfig.theme; - } - } - - return o; -}; - -exports.loadController = function(file) { - var code = { - parentControllerName: '', - controller: '', - pre: '', - es6mods: '' - }, - contents; - - // Read the controller file - try { - if (!path.existsSync(file)) { - return code; - } - contents = fs.readFileSync(file, 'utf8'); - } catch (e) { - U.die('Error reading controller file "' + file + '".', e); - } - - // get the base controller for this controller, also process import/export statements - var controller = astController.processController(contents, file); - code.controller = controller.code; - code.parentControllerName = controller.base; - code.es6mods = controller.es6mods; - - return code; -}; - -exports.validateNodeName = function(node, names) { - var fullname = exports.getNodeFullname(node); - var ret = null; - if (!_.isArray(names)) { names = [names]; } - - // Is the node name in the given list of valid names? - ret = _.find(names, function(name) { return name === fullname; }); - if (ret) { return ret; } - - // Is it an Alloy.Require? - if (fullname === 'Alloy.Require' || fullname === 'Alloy.Widget') { - var inspect = exports.inspectRequireNode(node); - ret = _.find(inspect.children, function(n) { - return _.includes(names, exports.getNodeFullname(n)); - }); - if (ret) { - return exports.getNodeFullname(ret); - } - } - - return null; -}; - -exports.generateCollectionBindingTemplate = function(args) { - var code = ''; - var COLLECTION_BINDING_EVENTS = CONST.COLLECTION_BINDING_EVENTS_092; - - // Check if not 0.9.2 and if it's a supported version as we'll default to 0.9.2 if the version is not supported - if (compilerConfig.backbone !== '0.9.2' && CONST.SUPPORTED_BACKBONE_VERSIONS.includes(compilerConfig.backbone)) { - COLLECTION_BINDING_EVENTS = CONST.COLLECTION_BINDING_EVENTS; - } - - // Determine the collection variable to use - var obj = { name: args[CONST.BIND_COLLECTION] }; - var col = _.template((exports.currentManifest ? CONST.WIDGET_OBJECT : 'Alloy') + ".Collections['<%= name %>'] || <%= name %>")(obj); - var colVar = exports.generateUniqueId(); - - // Create the code for the filter and transform functions - var where = args[CONST.BIND_WHERE]; - var transform = args[CONST.BIND_TRANSFORM]; - var whereCode = where ? where + '(' + colVar + ')' : colVar + '.models'; - var transformCode = transform ? transform + '(<%= localModel %>)' : '_.isFunction(<%= localModel %>.transform)?<%= localModel %>.transform():<%= localModel %>.toJSON()'; - var handlerFunc = args[CONST.BIND_FUNCTION] || exports.generateUniqueId(); - if (args.parentFormFactor) { - if (!exports.dataFunctionNames[handlerFunc]) { - exports.dataFunctionNames[handlerFunc] = []; - } - exports.dataFunctionNames[handlerFunc].push(args.parentFormFactor); - // append the form factor for the code below - handlerFunc += U.ucfirst(args.parentFormFactor); - } - // construct code template - code += 'var ' + colVar + '=' + col + ';'; - code += 'function ' + handlerFunc + '(e) {'; - code += ' if (e && e.fromAdapter) { return; }'; - code += ' var opts = ' + handlerFunc + '.opts || {};'; - code += ' var models = ' + whereCode + ';'; - code += ' var len = models.length;'; - code += '<%= pre %>'; - code += ' for (var i = 0; i < len; i++) {'; - code += ' var <%= localModel %> = models[i];'; - if (!args.isDataBoundMap) { - code += ' <%= localModel %>.' + CONST.BIND_TRANSFORM_VAR + ' = ' + transformCode + ';'; - } else { - // because (ti.map).annotations[] doesn't accept an array of anonymous objects - // we convert them to actual Annotations before pushing them to the array - code += " <%= annotationArray %>.push(require('ti.map').createAnnotation(" + transformCode + '));'; - } - code += '<%= items %>'; - code += ' }'; - code += '<%= post %>'; - code += '};'; - code += colVar + ".on('" + COLLECTION_BINDING_EVENTS + "'," + handlerFunc + ');'; - - exports.destroyCode += colVar + ' && ' + ((args.parentFormFactor) ? 'Alloy.is' + U.ucfirst(args.parentFormFactor) + ' && ' : '' ) + - colVar + ".off('" + COLLECTION_BINDING_EVENTS + "'," + handlerFunc + ');'; - - return code; -}; diff --git a/Alloy/commands/compile/index.js b/Alloy/commands/compile/index.js index 83804ce7a..f21ba3763 100755 --- a/Alloy/commands/compile/index.js +++ b/Alloy/commands/compile/index.js @@ -15,6 +15,7 @@ var ejs = require('ejs'), const { BuildLog, + configureBabelPlugins, createCompileConfig, createCompiler, sourceMapper, @@ -103,7 +104,7 @@ module.exports = function(args, program) { ]); } titaniumFolder = platforms[buildPlatform].titaniumFolder; - otherPlatforms = _.without(CONST.PLATFORM_FOLDERS, titaniumFolder); + otherPlatforms = _.without(platforms.constants.PLATFORM_FOLDERS, titaniumFolder); // check the platform and i18n to see if it was generated by us last time var destI18NDir = path.join(paths.project, 'i18n'); @@ -237,7 +238,6 @@ module.exports = function(args, program) { if (restrictionPath === null) { // Generate alloy.js from template var libAlloyJsDest = path.join(paths.resources, titaniumFolder, 'alloy.js'); - var pkginfo = require('pkginfo')(module, 'version'); logger.trace('Generating ' + path.relative(titaniumFolder, libAlloyJsDest).yellow); fs.writeFileSync( libAlloyJsDest, @@ -248,11 +248,10 @@ module.exports = function(args, program) { ); } - // NOTE: copies `common/constants.js` from Alloy into `/Resources//alloy` - updateFilesWithBuildLog( - path.join(alloyRoot, 'common'), - path.join(paths.resources, titaniumFolder, 'alloy'), - { rootDir: paths.project, restrictionPath: restrictionPath } + // NOTE: copies `alloy-utils/lib/constants.js` into `/Resources//alloy` + U.copyFileSync( + path.join(path.dirname(require.resolve('alloy-utils')), 'constants.js'), + path.join(paths.resources, titaniumFolder, 'alloy', 'constants.js') ); // create runtime folder structure for alloy @@ -422,7 +421,7 @@ module.exports = function(args, program) { // Create a regex for determining which platform-specific // folders should be used in the compile process - var filteredPlatforms = _.reject(CONST.PLATFORM_FOLDERS_ALLOY, function(p) { + var filteredPlatforms = _.reject(platforms.constants.PLATFORM_FOLDERS_ALLOY, function(p) { return p === buildPlatform; }); filteredPlatforms = _.map(filteredPlatforms, function(p) { return p + '[\\\\\\/]'; }); @@ -814,14 +813,11 @@ function optimizeCompiledCode(alloyConfig, paths) { }); } + // TODO: Remove once @titanium-sdk/babel-preset-app is in place while ((files = _.difference(getJsFiles(), lastFiles)).length > 0) { _.each(files, function(file) { var options = _.extend(_.clone(sourceMapper.OPTIONS_OUTPUT), { - plugins: [ - [require('./ast/builtins-plugin'), compileConfig], - [require('./ast/handle-alloy-globals')], - [require('./ast/optimizer-plugin'), compileConfig.alloyConfig], - ] + plugins: configureBabelPlugins(compileConfig) }), fullpath = path.join(compileConfig.dir.resources, file); @@ -830,7 +826,7 @@ function optimizeCompiledCode(alloyConfig, paths) { var result = babel.transformFileSync(fullpath, options); fs.writeFileSync(fullpath, result.code); } catch (e) { - U.die('Error transforming JS file', e); + U.die(`Error transforming JS file ${fullpath}`, e); } }); lastFiles = _.union(lastFiles, files); diff --git a/Alloy/commands/compile/parsers/Alloy.Abstract.Actions.js b/Alloy/commands/compile/parsers/Alloy.Abstract.Actions.js deleted file mode 100644 index 8f926d0a1..000000000 --- a/Alloy/commands/compile/parsers/Alloy.Abstract.Actions.js +++ /dev/null @@ -1,16 +0,0 @@ -var _ = require('lodash'); - -exports.parse = function(node, state) { - _.extend(state, { - itemArrayDefinition: { - parents: [ - 'Ti.UI.iOS.PreviewContext' - ], - children: [ - 'ALL' - ], - property: 'actions' - } - }); - return require('./Alloy.Abstract._ItemArray').parse(node, state); -}; diff --git a/Alloy/commands/compile/parsers/Alloy.Abstract.BarItemType.js b/Alloy/commands/compile/parsers/Alloy.Abstract.BarItemType.js deleted file mode 100644 index c7d2b0c6a..000000000 --- a/Alloy/commands/compile/parsers/Alloy.Abstract.BarItemType.js +++ /dev/null @@ -1,46 +0,0 @@ -var U = require('../../../utils'), - styler = require('../styler'); - -exports.parse = function(node, state) { - return require('./base').parse(node, state, parse); -}; - -function parse(node, state, args) { - if (!state.itemsArray) { - U.die('Invalid use of diff --git a/test/apps/testing/ALOY-1092/_generated/blackberry/alloy/controllers/childWindow.js b/test/apps/testing/ALOY-1092/_generated/blackberry/alloy/controllers/childWindow.js deleted file mode 100644 index 3bc6e8e1e..000000000 --- a/test/apps/testing/ALOY-1092/_generated/blackberry/alloy/controllers/childWindow.js +++ /dev/null @@ -1,35 +0,0 @@ -function __processArg(obj, key) { - var arg = null; - if (obj) { - arg = obj[key] || null; - delete obj[key]; - } - return arg; -} - -function Controller() { - require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments)); - this.__controllerPath = "childWindow"; - this.args = arguments[0] || {}; - if (arguments[0]) { - { - __processArg(arguments[0], "__parentSymbol"); - } - { - __processArg(arguments[0], "$model"); - } - { - __processArg(arguments[0], "__itemTemplate"); - } - } - var $ = this; - var exports = {}; - exports.destroy = function() {}; - _.extend($, $.__views); - arguments[0] || {}; - _.extend($, exports); -} - -var Alloy = require("alloy"), Backbone = Alloy.Backbone, _ = Alloy._; - -module.exports = Controller; \ No newline at end of file diff --git a/test/apps/testing/ALOY-1092/_generated/blackberry/alloy/controllers/index.js b/test/apps/testing/ALOY-1092/_generated/blackberry/alloy/controllers/index.js deleted file mode 100644 index ac92a9742..000000000 --- a/test/apps/testing/ALOY-1092/_generated/blackberry/alloy/controllers/index.js +++ /dev/null @@ -1,132 +0,0 @@ -function __processArg(obj, key) { - var arg = null; - if (obj) { - arg = obj[key] || null; - delete obj[key]; - } - return arg; -} - -function Controller() { - function myFunction() { - return true; - } - require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments)); - this.__controllerPath = "index"; - this.args = arguments[0] || {}; - if (arguments[0]) { - { - __processArg(arguments[0], "__parentSymbol"); - } - { - __processArg(arguments[0], "$model"); - } - { - __processArg(arguments[0], "__itemTemplate"); - } - } - var $ = this; - var exports = {}; - $.__views.index = Ti.UI.createWindow({ - layout: "vertical", - backgroundColor: "white", - id: "index" - }); - $.__views.index && $.addTopLevelView($.__views.index); - $.__views.label1 = Ti.UI.createLabel(function() { - var o = {}; - _.extend(o, { - top: 20, - left: 0, - font: { - fontSize: "14dp" - }, - color: "black" - }); - Alloy.Globals.isiPhone6 && _.extend(o, { - font: { - fontSize: "16dp" - }, - color: "green" - }); - _.extend(o, { - color: "blue", - text: "This is a label", - id: "label1" - }); - return o; - }()); - $.__views.index.add($.__views.label1); - $.__views.label2 = Ti.UI.createLabel(function() { - var o = {}; - _.extend(o, { - top: 20, - left: 0, - font: { - fontSize: "14dp" - }, - color: "black" - }); - Alloy.Globals.isiPhone6 && _.extend(o, { - font: { - fontSize: "16dp" - }, - color: "green" - }); - _.extend(o, { - color: "blue", - text: "This is also a label", - id: "label2" - }); - return o; - }()); - $.__views.index.add($.__views.label2); - $.__views.label3 = Ti.UI.createLabel(function() { - var o = {}; - _.extend(o, { - top: 20, - left: 0, - font: { - fontSize: "14dp" - }, - color: "black" - }); - Alloy.Globals.isiPhone6 && _.extend(o, { - font: { - fontSize: "16dp" - }, - color: "green" - }); - _.extend(o, { - color: "blue", - text: "Tap for new Window" - }); - myFunction() && _.extend(o, { - font: { - fontSize: "18dp" - }, - color: "red" - }); - _.extend(o, { - id: "label3" - }); - return o; - }()); - $.__views.index.add($.__views.label3); - exports.destroy = function() {}; - _.extend($, $.__views); - $.label3.addEventListener("click", function() { - var child = Alloy.createController("childWindow", { - someProperty: true - }); - console.log("__controllerPath = " + child.__controllerPath); - console.log("args = " + JSON.stringify(child.args)); - child.getView().open(); - }); - $.index.open(); - _.extend($, exports); -} - -var Alloy = require("alloy"), Backbone = Alloy.Backbone, _ = Alloy._; - -module.exports = Controller; \ No newline at end of file diff --git a/test/apps/testing/ALOY-1092/_generated/mobileweb/alloy/controllers/childWindow.js b/test/apps/testing/ALOY-1092/_generated/mobileweb/alloy/controllers/childWindow.js deleted file mode 100644 index ce2b3da73..000000000 --- a/test/apps/testing/ALOY-1092/_generated/mobileweb/alloy/controllers/childWindow.js +++ /dev/null @@ -1,96 +0,0 @@ -function __processArg(obj, key) { - var arg = null; - if (obj) { - arg = obj[key] || null; - delete obj[key]; - } - return arg; -} - -function Controller() { - function doClose() { - $.navWin.close(); - } - require("/alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments)); - this.__controllerPath = "childWindow"; - this.args = arguments[0] || {}; - if (arguments[0]) { - __processArg(arguments[0], "__parentSymbol"); - __processArg(arguments[0], "$model"); - __processArg(arguments[0], "__itemTemplate"); - } - var $ = this; - var exports = {}; - var __defers = {}; - $.__views.childWindow = Ti.UI.createWindow({ - backgroundColor: "#fff", - layout: "vertical", - id: "childWindow" - }); - $.__views.childWindow && $.addTopLevelView($.__views.childWindow); - $.__views.navWin = Ti.UI.createWindow({ - backgroundColor: "#fff", - layout: "vertical", - title: "Child window", - id: "navWin" - }); - $.__views.close = Ti.UI.createButton({ - id: "close", - title: "Close" - }); - doClose ? $.addListener($.__views.close, "click", doClose) : __defers["$.__views.close!click!doClose"] = true; - $.__views.navWin.leftNavButton = $.__views.close; - $.__views.argLabel = Ti.UI.createLabel(function() { - var o = {}; - Alloy.deepExtend(true, o, { - height: Ti.UI.SIZE, - width: Ti.UI.SIZE, - color: "#000", - textAlign: "center", - font: { - fontSize: "24dp", - fontWeight: "bold" - }, - text: "args.someProperty is falsey", - top: 25 - }); - $.args.someProperty && Alloy.deepExtend(true, o, { - text: "args.someProperty is truthy" - }); - Alloy.deepExtend(true, o, { - id: "argLabel" - }); - return o; - }()); - $.__views.navWin.add($.__views.argLabel); - if ($.args.someProperty) { - $.__views.argLabelTwo = Ti.UI.createLabel({ - height: Ti.UI.SIZE, - width: Ti.UI.SIZE, - color: "#000", - textAlign: "center", - font: { - fontSize: "24dp", - fontWeight: "bold" - }, - text: "XML-based if condition", - top: 25, - id: "argLabelTwo" - }); - $.__views.navWin.add($.__views.argLabelTwo); - } - $.__views.__alloyId0 = Ti.UI.MobileWeb.createNavigationGroup({ - window: $.__views.navWin, - id: "__alloyId0" - }); - $.__views.childWindow.add($.__views.__alloyId0); - exports.destroy = function() {}; - _.extend($, $.__views); - arguments[0] || {}; - __defers["$.__views.close!click!doClose"] && $.addListener($.__views.close, "click", doClose); - _.extend($, exports); -} - -var Alloy = require("/alloy"), Backbone = Alloy.Backbone, _ = Alloy._; - -module.exports = Controller; \ No newline at end of file diff --git a/test/apps/testing/ALOY-1092/_generated/mobileweb/alloy/controllers/index.js b/test/apps/testing/ALOY-1092/_generated/mobileweb/alloy/controllers/index.js deleted file mode 100644 index b73f1df67..000000000 --- a/test/apps/testing/ALOY-1092/_generated/mobileweb/alloy/controllers/index.js +++ /dev/null @@ -1,126 +0,0 @@ -function __processArg(obj, key) { - var arg = null; - if (obj) { - arg = obj[key] || null; - delete obj[key]; - } - return arg; -} - -function Controller() { - function myFunction() { - return true; - } - require("/alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments)); - this.__controllerPath = "index"; - this.args = arguments[0] || {}; - if (arguments[0]) { - __processArg(arguments[0], "__parentSymbol"); - __processArg(arguments[0], "$model"); - __processArg(arguments[0], "__itemTemplate"); - } - var $ = this; - var exports = {}; - $.__views.index = Ti.UI.createWindow({ - layout: "vertical", - backgroundColor: "white", - id: "index" - }); - $.__views.index && $.addTopLevelView($.__views.index); - $.__views.label1 = Ti.UI.createLabel(function() { - var o = {}; - Alloy.deepExtend(true, o, { - top: 20, - left: 0, - font: { - fontSize: "14dp" - }, - color: "black" - }); - Alloy.Globals.isiPhone6 && Alloy.deepExtend(true, o, { - font: { - fontSize: "16dp" - }, - color: "green" - }); - Alloy.deepExtend(true, o, { - color: "blue", - text: "This is a label", - id: "label1" - }); - return o; - }()); - $.__views.index.add($.__views.label1); - $.__views.label2 = Ti.UI.createLabel(function() { - var o = {}; - Alloy.deepExtend(true, o, { - top: 20, - left: 0, - font: { - fontSize: "14dp" - }, - color: "black" - }); - Alloy.Globals.isiPhone6 && Alloy.deepExtend(true, o, { - font: { - fontSize: "16dp" - }, - color: "green" - }); - Alloy.deepExtend(true, o, { - color: "blue", - text: "This is also a label", - id: "label2" - }); - return o; - }()); - $.__views.index.add($.__views.label2); - $.__views.label3 = Ti.UI.createLabel(function() { - var o = {}; - Alloy.deepExtend(true, o, { - top: 20, - left: 0, - font: { - fontSize: "14dp" - }, - color: "black" - }); - Alloy.Globals.isiPhone6 && Alloy.deepExtend(true, o, { - font: { - fontSize: "16dp" - }, - color: "green" - }); - Alloy.deepExtend(true, o, { - color: "blue", - text: "Tap for new Window" - }); - myFunction() && Alloy.deepExtend(true, o, { - font: { - fontSize: "18dp" - }, - color: "red" - }); - Alloy.deepExtend(true, o, { - id: "label3" - }); - return o; - }()); - $.__views.index.add($.__views.label3); - exports.destroy = function() {}; - _.extend($, $.__views); - $.label3.addEventListener("click", function() { - var child = Alloy.createController("childWindow", { - someProperty: true - }); - console.log("__controllerPath = " + child.__controllerPath); - console.log("args = " + JSON.stringify(child.args)); - child.getView().open(); - }); - $.index.open(); - _.extend($, exports); -} - -var Alloy = require("/alloy"), Backbone = Alloy.Backbone, _ = Alloy._; - -module.exports = Controller; \ No newline at end of file diff --git a/test/apps/testing/ALOY-1092/views/childWindow.xml b/test/apps/testing/ALOY-1092/views/childWindow.xml index 4cc581ebd..aae3d333d 100644 --- a/test/apps/testing/ALOY-1092/views/childWindow.xml +++ b/test/apps/testing/ALOY-1092/views/childWindow.xml @@ -13,18 +13,4 @@