@nstudio/xplat
Advanced tools
Comparing version 13.0.1 to 13.4.0
@@ -5,5 +5,5 @@ "use strict"; | ||
function default_1() { | ||
return schematics_1.chain([ | ||
return (0, schematics_1.chain)([ | ||
(tree, context) => { | ||
return schematics_1.noop(); | ||
return (0, schematics_1.noop)(); | ||
}, | ||
@@ -10,0 +10,0 @@ ]); |
@@ -7,4 +7,4 @@ "use strict"; | ||
function default_1() { | ||
return schematics_1.chain([ | ||
xplat_utils_1.prerun({ | ||
return (0, schematics_1.chain)([ | ||
(0, xplat_utils_1.prerun)({ | ||
framework: 'angular', | ||
@@ -11,0 +11,0 @@ }, true), |
@@ -14,4 +14,4 @@ "use strict"; | ||
function default_1() { | ||
return schematics_1.chain([ | ||
xplat_utils_1.prerun({ | ||
return (0, schematics_1.chain)([ | ||
(0, xplat_utils_1.prerun)({ | ||
framework: 'angular', | ||
@@ -53,10 +53,10 @@ }, true), | ||
const path = 'nx.json'; | ||
const nxJson = xplat_utils_1.getJsonFromFile(tree, path); | ||
const nxJson = (0, xplat_utils_1.getJsonFromFile)(tree, path); | ||
if (nxJson && nxJson.projects) { | ||
delete nxJson.projects['libs']; | ||
delete nxJson.projects['xplat']; | ||
return xplat_utils_1.updateJsonFile(tree, path, nxJson); | ||
return (0, xplat_utils_1.updateJsonFile)(tree, path, nxJson); | ||
} | ||
else { | ||
return schematics_1.noop(); | ||
return (0, schematics_1.noop)(); | ||
} | ||
@@ -66,11 +66,11 @@ }, | ||
(tree) => { | ||
const workspacePath = workspace_1.getWorkspacePath(tree); | ||
const workspaceJson = xplat_utils_1.getJsonFromFile(tree, workspacePath); | ||
const workspacePath = (0, workspace_1.getWorkspacePath)(tree); | ||
const workspaceJson = (0, xplat_utils_1.getJsonFromFile)(tree, workspacePath); | ||
if (workspaceJson && workspaceJson.projects) { | ||
delete workspaceJson.projects['libs']; | ||
delete workspaceJson.projects['xplat']; | ||
return xplat_utils_1.updateJsonFile(tree, workspacePath, workspaceJson); | ||
return (0, xplat_utils_1.updateJsonFile)(tree, workspacePath, workspaceJson); | ||
} | ||
else { | ||
return schematics_1.noop(); | ||
return (0, schematics_1.noop)(); | ||
} | ||
@@ -80,3 +80,3 @@ }, | ||
(tree, context) => { | ||
return xplat_1.updateTsConfig(tree, (tsConfig) => { | ||
return (0, xplat_1.updateTsConfig)(tree, (tsConfig) => { | ||
if (tsConfig) { | ||
@@ -86,3 +86,3 @@ if (!tsConfig.compilerOptions) { | ||
} | ||
const npmScope = xplat_utils_1.getNpmScope(); | ||
const npmScope = (0, xplat_utils_1.getNpmScope)(); | ||
delete tsConfig.compilerOptions.paths[`@${npmScope}/*`]; | ||
@@ -168,4 +168,4 @@ delete tsConfig.compilerOptions.paths[`@${npmScope}/electron`]; | ||
const packagePath = 'package.json'; | ||
const packageJson = xplat_utils_1.getJsonFromFile(tree, packagePath); | ||
const npmScope = xplat_utils_1.getNpmScope(); | ||
const packageJson = (0, xplat_utils_1.getJsonFromFile)(tree, packagePath); | ||
const npmScope = (0, xplat_utils_1.getNpmScope)(); | ||
delete packageJson.dependencies[`@${npmScope}/scss`]; | ||
@@ -183,3 +183,3 @@ packageJson.dependencies[`@${npmScope}/xplat-scss`] = | ||
} | ||
return xplat_utils_1.updateJsonFile(tree, packagePath, packageJson); | ||
return (0, xplat_utils_1.updateJsonFile)(tree, packagePath, packageJson); | ||
}; | ||
@@ -189,3 +189,3 @@ } | ||
return (tree, context) => { | ||
const webAppsPaths = xplat_utils_1.getAppPaths(tree, 'web'); | ||
const webAppsPaths = (0, xplat_utils_1.getAppPaths)(tree, 'web'); | ||
for (const dirPath of webAppsPaths) { | ||
@@ -199,3 +199,3 @@ const relativePath = dirPath | ||
if (tree.exists(`${dirPath}/tsconfig.json`)) { | ||
const tsConfig = xplat_utils_1.getJsonFromFile(tree, `${dirPath}/tsconfig.json`); | ||
const tsConfig = (0, xplat_utils_1.getJsonFromFile)(tree, `${dirPath}/tsconfig.json`); | ||
if (tsConfig.angularCompilerOptions) { | ||
@@ -205,3 +205,3 @@ customOptionsAppend = `,\n"angularCompilerOptions": ${JSON.stringify(tsConfig.angularCompilerOptions)}`; | ||
} | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.json`, `{ | ||
"extends": "${relativePath}/tsconfig.base.json", | ||
@@ -222,3 +222,3 @@ "files": [], | ||
}`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.app.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.app.json`, `{ | ||
"extends": "./tsconfig.json", | ||
@@ -242,3 +242,3 @@ "compilerOptions": { | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.editor.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.editor.json`, `{ | ||
"extends": "./tsconfig.json", | ||
@@ -251,3 +251,3 @@ "include": ["**/*.ts"], | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.spec.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.spec.json`, `{ | ||
"extends": "./tsconfig.json", | ||
@@ -264,4 +264,4 @@ "compilerOptions": { | ||
} | ||
const nativeScriptAppsPaths = xplat_utils_1.getAppPaths(tree, 'nativescript'); | ||
const npmScope = xplat_utils_1.getNpmScope(); | ||
const nativeScriptAppsPaths = (0, xplat_utils_1.getAppPaths)(tree, 'nativescript'); | ||
const npmScope = (0, xplat_utils_1.getNpmScope)(); | ||
// update {N} apps and configs | ||
@@ -277,3 +277,3 @@ for (const dirPath of nativeScriptAppsPaths) { | ||
const cwd = process.cwd(); | ||
const webpackConfigPath = path_1.join(cwd, 'node_modules/@nstudio/nativescript-angular/src/schematics/application/_files/webpack.config.js'); | ||
const webpackConfigPath = (0, path_1.join)(cwd, 'node_modules/@nstudio/nativescript-angular/src/schematics/application/_files/webpack.config.js'); | ||
// console.log('webpackConfigPath:', webpackConfigPath); | ||
@@ -283,6 +283,6 @@ const webpackConfig = fs.readFileSync(webpackConfigPath, { | ||
}); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/webpack.config.js`, webpackConfig.replace('<%= pathOffset %>', relativePath)); | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/webpack.config.js`, webpackConfig.replace('<%= pathOffset %>', relativePath)); | ||
// update {N} app deps | ||
const packagePath = `${dirPath}/package.json`; | ||
const packageJson = xplat_utils_1.getJsonFromFile(tree, packagePath); | ||
const packageJson = (0, xplat_utils_1.getJsonFromFile)(tree, packagePath); | ||
if (packageJson) { | ||
@@ -306,3 +306,3 @@ packageJson.dependencies = packageJson.dependencies || {}; | ||
// console.log('packageJson overwrite:', JSON.stringify(packageJson)); | ||
tree = xplat_utils_1.updateJsonFile(tree, packagePath, packageJson); | ||
tree = (0, xplat_utils_1.updateJsonFile)(tree, packagePath, packageJson); | ||
} | ||
@@ -320,3 +320,3 @@ const gitIgnorePath = `${dirPath}/.gitignore`; | ||
scssUpdate = scssUpdate.replace('/nativescript-scss', '/xplat-nativescript-scss'); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/src/app.android.scss`, scssUpdate); | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/src/app.android.scss`, scssUpdate); | ||
} | ||
@@ -328,3 +328,3 @@ if (tree.exists(`${dirPath}/src/app.ios.scss`)) { | ||
scssUpdate = scssUpdate.replace('/nativescript-scss', '/xplat-nativescript-scss'); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/src/app.ios.scss`, scssUpdate); | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/src/app.ios.scss`, scssUpdate); | ||
} | ||
@@ -334,3 +334,3 @@ if (tree.exists(`${dirPath}/tsconfig.env.json`)) { | ||
} | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.app.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.app.json`, `{ | ||
"extends": "./tsconfig.json", | ||
@@ -346,3 +346,3 @@ "compilerOptions": { | ||
}`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.editor.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.editor.json`, `{ | ||
"extends": "./tsconfig.json", | ||
@@ -355,3 +355,3 @@ "include": ["**/*.ts"], | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.json`, `{ | ||
"extends": "${relativePath}/tsconfig.base.json", | ||
@@ -373,3 +373,3 @@ "files": [], | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.spec.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.spec.json`, `{ | ||
"extends": "./tsconfig.json", | ||
@@ -385,5 +385,5 @@ "compilerOptions": { | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/src/test-setup.ts`, `import 'jest-preset-angular';`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/references.d.ts`, `/// <reference path="${relativePath}/references.d.ts" />`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/jest.config.js`, `module.exports = { | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/src/test-setup.ts`, `import 'jest-preset-angular';`); | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/references.d.ts`, `/// <reference path="${relativePath}/references.d.ts" />`); | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/jest.config.js`, `module.exports = { | ||
preset: '${relativePath}/jest.preset.js', | ||
@@ -410,3 +410,3 @@ setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'], | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/.eslintrc.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/.eslintrc.json`, `{ | ||
"extends": "${relativePath}/.eslintrc.json", | ||
@@ -484,3 +484,3 @@ "ignorePatterns": [ | ||
} | ||
return xplat_utils_1.updateFile(tree, gitIgnorePath, gitIgnore); | ||
return (0, xplat_utils_1.updateFile)(tree, gitIgnorePath, gitIgnore); | ||
}; | ||
@@ -492,3 +492,3 @@ } | ||
tree.exists('/libs/features/index.ts')) { | ||
const npmScope = xplat_utils_1.getNpmScope(); | ||
const npmScope = (0, xplat_utils_1.getNpmScope)(); | ||
if (!oldDirectoriesToMove.includes('/libs/core')) { | ||
@@ -505,3 +505,3 @@ oldDirectoriesToMove.push('/libs/core'); | ||
newDirectoriesToEmpty.push('/libs/xplat/scss/src'); | ||
workspace_1.createOrUpdate(tree, `/libs/scss/package.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `/libs/scss/package.json`, `{ | ||
"name": "@${npmScope}/xplat-scss", | ||
@@ -540,3 +540,3 @@ "version": "1.0.0" | ||
newDirectoriesToEmpty.push('/libs/xplat/ionic/scss/src'); | ||
workspace_1.createOrUpdate(tree, `/xplat/ionic/scss/package.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `/xplat/ionic/scss/package.json`, `{ | ||
"name": "@${npmScope}/xplat-ionic-scss", | ||
@@ -550,3 +550,3 @@ "version": "1.0.0" | ||
scssUpdate = scssUpdate.replace(`@${npmScope}/scss/index`, `@${npmScope}/xplat-scss/index`); | ||
workspace_1.createOrUpdate(tree, `/xplat/ionic/scss/_index.scss`, scssUpdate); | ||
(0, workspace_1.createOrUpdate)(tree, `/xplat/ionic/scss/_index.scss`, scssUpdate); | ||
} | ||
@@ -573,3 +573,3 @@ } | ||
newDirectoriesToEmpty.push('/libs/xplat/nativescript/scss/src'); | ||
workspace_1.createOrUpdate(tree, `/xplat/nativescript/scss/package.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `/xplat/nativescript/scss/package.json`, `{ | ||
"name": "@${npmScope}/xplat-nativescript-scss", | ||
@@ -583,3 +583,3 @@ "version": "1.0.0" | ||
scssUpdate = scssUpdate.replace(`@${npmScope}/scss/index`, `@${npmScope}/xplat-scss/index`); | ||
workspace_1.createOrUpdate(tree, `/xplat/nativescript/scss/_common.scss`, scssUpdate); | ||
(0, workspace_1.createOrUpdate)(tree, `/xplat/nativescript/scss/_common.scss`, scssUpdate); | ||
} | ||
@@ -610,3 +610,3 @@ } | ||
newDirectoriesToEmpty.push('/libs/xplat/web/scss/src'); | ||
workspace_1.createOrUpdate(tree, `/xplat/web/scss/package.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `/xplat/web/scss/package.json`, `{ | ||
"name": "@${npmScope}/xplat-web-scss", | ||
@@ -620,3 +620,3 @@ "version": "1.0.0" | ||
scssUpdate = scssUpdate.replace(`@${npmScope}/scss/index`, `@${npmScope}/xplat-scss/index`); | ||
workspace_1.createOrUpdate(tree, `/xplat/web/scss/_index.scss`, scssUpdate); | ||
(0, workspace_1.createOrUpdate)(tree, `/xplat/web/scss/_index.scss`, scssUpdate); | ||
} | ||
@@ -623,0 +623,0 @@ } |
@@ -10,4 +10,4 @@ "use strict"; | ||
function default_1() { | ||
return schematics_1.chain([ | ||
xplat_utils_1.prerun({ | ||
return (0, schematics_1.chain)([ | ||
(0, xplat_utils_1.prerun)({ | ||
framework: 'angular', | ||
@@ -26,7 +26,7 @@ }, true), | ||
return (tree, _context) => { | ||
const npmScope = xplat_utils_1.getNpmScope(); | ||
const npmScope = (0, xplat_utils_1.getNpmScope)(); | ||
const coreIndexPath = `/libs/xplat/core/src/lib/index.ts`; | ||
let coreIndex = tree.read(coreIndexPath).toString('utf-8'); | ||
coreIndex = coreIndex.replace(`./environments/environment`, `./environments`); | ||
workspace_1.createOrUpdate(tree, coreIndexPath, coreIndex); | ||
(0, workspace_1.createOrUpdate)(tree, coreIndexPath, coreIndex); | ||
const envInterfacePath = `/libs/xplat/core/src/lib/environments/environment.interface.ts`; | ||
@@ -39,7 +39,7 @@ const envInterface = `/** | ||
}`; | ||
workspace_1.createOrUpdate(tree, envInterfacePath, envInterface); | ||
(0, workspace_1.createOrUpdate)(tree, envInterfacePath, envInterface); | ||
const envIndexPath = `/libs/xplat/core/src/lib/environments/index.ts`; | ||
const envIndex = `export * from './environment.interface'; | ||
export * from './environment';`; | ||
workspace_1.createOrUpdate(tree, envIndexPath, envIndex); | ||
(0, workspace_1.createOrUpdate)(tree, envIndexPath, envIndex); | ||
const envBasePath = `/libs/xplat/core/src/lib/environments/base/environment.base.ts`; | ||
@@ -54,3 +54,3 @@ const envBase = `import { IEnvironment } from '../environment.interface'; | ||
};`; | ||
workspace_1.createOrUpdate(tree, envBasePath, envBase); | ||
(0, workspace_1.createOrUpdate)(tree, envBasePath, envBase); | ||
const envDevPath = `/libs/xplat/core/src/lib/environments/base/environment.dev.ts`; | ||
@@ -65,3 +65,3 @@ const envDev = `import { IEnvironment } from '@${npmScope}/xplat/core'; | ||
`; | ||
workspace_1.createOrUpdate(tree, envDevPath, envDev); | ||
(0, workspace_1.createOrUpdate)(tree, envDevPath, envDev); | ||
const envProdPath = `/libs/xplat/core/src/lib/environments/base/environment.prod.ts`; | ||
@@ -77,3 +77,3 @@ const envProd = `import { IEnvironment } from '@${npmScope}/xplat/core'; | ||
`; | ||
workspace_1.createOrUpdate(tree, envProdPath, envProd); | ||
(0, workspace_1.createOrUpdate)(tree, envProdPath, envProd); | ||
const envBaseIndexPath = `/libs/xplat/core/src/lib/environments/base/index.ts`; | ||
@@ -84,3 +84,3 @@ const envBaseIndex = `export * from './environment.base'; | ||
`; | ||
workspace_1.createOrUpdate(tree, envBaseIndexPath, envBaseIndex); | ||
(0, workspace_1.createOrUpdate)(tree, envBaseIndexPath, envBaseIndex); | ||
const utilsObjPath = `/libs/xplat/utils/src/lib/objects.ts`; | ||
@@ -118,3 +118,3 @@ let utilsObj = ''; | ||
} | ||
workspace_1.createOrUpdate(tree, utilsObjPath, utilsObj); | ||
(0, workspace_1.createOrUpdate)(tree, utilsObjPath, utilsObj); | ||
}; | ||
@@ -125,4 +125,4 @@ } | ||
return (tree, _context) => { | ||
const nativeScriptAppsPaths = xplat_utils_1.getAppPaths(tree, 'nativescript'); | ||
const npmScope = xplat_utils_1.getNpmScope(); | ||
const nativeScriptAppsPaths = (0, xplat_utils_1.getAppPaths)(tree, 'nativescript'); | ||
const npmScope = (0, xplat_utils_1.getNpmScope)(); | ||
// update {N} apps and configs | ||
@@ -139,3 +139,3 @@ for (const dirPath of nativeScriptAppsPaths) { | ||
const cwd = process.cwd(); | ||
const webpackConfigPath = path_1.join(cwd, 'node_modules/@nstudio/nativescript-angular/src/schematics/application/_files/webpack.config.js'); | ||
const webpackConfigPath = (0, path_1.join)(cwd, 'node_modules/@nstudio/nativescript-angular/src/schematics/application/_files/webpack.config.js'); | ||
// console.log('webpackConfigPath:', webpackConfigPath); | ||
@@ -146,4 +146,4 @@ let webpackConfig = fs.readFileSync(webpackConfigPath, { | ||
webpackConfig = webpackConfig.replace('if (isXplatWorkspace) {', `// opt in when ready to use in your workspace\n const xplatEnvBaseEnabled = false;\n if (xplatEnvBaseEnabled && isXplatWorkspace) {`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/webpack.config.js`, webpackConfig.replace('<%= pathOffset %>', relativePath)); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/src/environments/environment.base.ts`, `import { IEnvironment } from '@${npmScope}/xplat/core'; | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/webpack.config.js`, webpackConfig.replace('<%= pathOffset %>', relativePath)); | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/src/environments/environment.base.ts`, `import { IEnvironment } from '@${npmScope}/xplat/core'; | ||
import { deepMerge } from '@${npmScope}/xplat/utils'; | ||
@@ -164,3 +164,3 @@ | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/src/environments/environment.dev.ts`, `import { environmentBase } from './environment.base'; | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/src/environments/environment.dev.ts`, `import { environmentBase } from './environment.base'; | ||
import { IEnvironment } from '@${npmScope}/xplat/core'; | ||
@@ -173,3 +173,3 @@ import { environmentDev } from '@${npmScope}/xplat/environments'; | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/src/environments/environment.prod.ts`, `import { environmentBase } from './environment.base'; | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/src/environments/environment.prod.ts`, `import { environmentBase } from './environment.base'; | ||
import { IEnvironment } from '@${npmScope}/xplat/core'; | ||
@@ -188,4 +188,4 @@ import { environmentProd } from '@${npmScope}/xplat/environments'; | ||
return (tree, _context) => { | ||
const workspacePath = workspace_1.getWorkspacePath(tree); | ||
const workspaceJson = xplat_utils_1.getJsonFromFile(tree, workspacePath); | ||
const workspacePath = (0, workspace_1.getWorkspacePath)(tree); | ||
const workspaceJson = (0, xplat_utils_1.getJsonFromFile)(tree, workspacePath); | ||
if (workspaceJson && workspaceJson.projects) { | ||
@@ -296,6 +296,6 @@ const projectNames = Object.keys(workspaceJson.projects); | ||
} | ||
return xplat_utils_1.updateJsonFile(tree, workspacePath, workspaceJson); | ||
return (0, xplat_utils_1.updateJsonFile)(tree, workspacePath, workspaceJson); | ||
} | ||
else { | ||
return schematics_1.noop(); | ||
return (0, schematics_1.noop)(); | ||
} | ||
@@ -302,0 +302,0 @@ }; |
@@ -13,4 +13,4 @@ "use strict"; | ||
function default_1() { | ||
return schematics_1.chain([ | ||
xplat_utils_1.prerun({ | ||
return (0, schematics_1.chain)([ | ||
(0, xplat_utils_1.prerun)({ | ||
framework: 'angular', | ||
@@ -25,3 +25,3 @@ }, true), | ||
return (tree, _context) => { | ||
const npmScope = xplat_utils_1.getNpmScope(); | ||
const npmScope = (0, xplat_utils_1.getNpmScope)(); | ||
importsToUpdateMapping[`@${npmScope}/core`] = `@${npmScope}/xplat/core`; | ||
@@ -143,3 +143,3 @@ importsToUpdateMapping[`@${npmScope}/core/*`] = `@${npmScope}/xplat/core`; | ||
} | ||
const nodes = xplat_1.findNodes(astSource, ts.SyntaxKind.ImportDeclaration); | ||
const nodes = (0, xplat_1.findNodes)(astSource, ts.SyntaxKind.ImportDeclaration); | ||
return nodes | ||
@@ -168,3 +168,3 @@ .filter((node) => { | ||
// update the file in the tree | ||
xplat_1.insert(tree, file, changes); | ||
(0, xplat_1.insert)(tree, file, changes); | ||
} | ||
@@ -171,0 +171,0 @@ } |
@@ -32,4 +32,4 @@ "use strict"; | ||
const cwd = process.cwd(); | ||
const nativeScriptAppsPaths = xplat_utils_1.getAppPaths(tree, 'nativescript'); | ||
const npmScope = xplat_utils_1.getNpmScope(); | ||
const nativeScriptAppsPaths = (0, xplat_utils_1.getAppPaths)(tree, 'nativescript'); | ||
const npmScope = (0, xplat_utils_1.getNpmScope)(); | ||
const appsNames = []; | ||
@@ -53,3 +53,3 @@ // update {N} apps and configs | ||
const cwd = process.cwd(); | ||
const webpackConfigPath = path_1.join(cwd, 'node_modules/@nstudio/nativescript-angular/src/schematics/application/_files/webpack.config.js'); | ||
const webpackConfigPath = (0, path_1.join)(cwd, 'node_modules/@nstudio/nativescript-angular/src/schematics/application/_files/webpack.config.js'); | ||
// console.log('webpackConfigPath:', webpackConfigPath); | ||
@@ -59,3 +59,3 @@ const webpackConfig = fs.readFileSync(webpackConfigPath, { | ||
}); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/webpack.config.js`, webpackConfig | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/webpack.config.js`, webpackConfig | ||
.replace(/<%= pathOffset %>/gi, relativePath + '/') | ||
@@ -65,3 +65,3 @@ .replace(/<%= npmScope %>/gi, npmScope)); | ||
const packagePath = `${dirPath}/package.json`; | ||
const packageJson = xplat_utils_1.getJsonFromFile(tree, packagePath); | ||
const packageJson = (0, xplat_utils_1.getJsonFromFile)(tree, packagePath); | ||
if (packageJson) { | ||
@@ -100,3 +100,3 @@ packageJson.main = './src/main.ts'; | ||
// console.log('packageJson overwrite:', JSON.stringify(packageJson)); | ||
tree = xplat_utils_1.updateJsonFile(tree, packagePath, packageJson); | ||
tree = (0, xplat_utils_1.updateJsonFile)(tree, packagePath, packageJson); | ||
} | ||
@@ -109,3 +109,3 @@ if (tree.exists(`${dirPath}/tsconfig.env.json`)) { | ||
} | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tools/xplat-postinstall.js`, `//#!/usr/bin/env node | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tools/xplat-postinstall.js`, `//#!/usr/bin/env node | ||
@@ -134,3 +134,3 @@ const fs = require('fs-extra'); | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.app.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.app.json`, `{ | ||
"extends": "./tsconfig.json", | ||
@@ -151,3 +151,3 @@ "compilerOptions": { | ||
}`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.editor.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.editor.json`, `{ | ||
"extends": "./tsconfig.json", | ||
@@ -160,3 +160,3 @@ "include": ["**/*.ts"], | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.json`, `{ | ||
"extends": "${relativePath}/tsconfig.base.json", | ||
@@ -178,3 +178,3 @@ "files": [], | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.spec.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.spec.json`, `{ | ||
"extends": "./tsconfig.json", | ||
@@ -190,4 +190,4 @@ "compilerOptions": { | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/src/test-setup.ts`, `import 'jest-preset-angular';`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/src/polyfills.ts`, `/** | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/src/test-setup.ts`, `import 'jest-preset-angular';`); | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/src/polyfills.ts`, `/** | ||
* NativeScript Polyfills | ||
@@ -213,3 +213,3 @@ */ | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/.eslintrc.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/.eslintrc.json`, `{ | ||
"extends": "${relativePath}/.eslintrc.json", | ||
@@ -238,3 +238,3 @@ "ignorePatterns": [ | ||
"type": "attribute", | ||
"prefix": "${xplat_utils_1.getPrefix()}", | ||
"prefix": "${(0, xplat_utils_1.getPrefix)()}", | ||
"style": "camelCase" | ||
@@ -247,3 +247,3 @@ } | ||
"type": "element", | ||
"prefix": "${xplat_utils_1.getPrefix()}", | ||
"prefix": "${(0, xplat_utils_1.getPrefix)()}", | ||
"style": "kebab-case" | ||
@@ -281,3 +281,3 @@ } | ||
function updateRootPackage(tree, context) { | ||
return workspace_1.updateJsonInTree('package.json', (json) => { | ||
return (0, workspace_1.updateJsonInTree)('package.json', (json) => { | ||
json.scripts = json.scripts || {}; | ||
@@ -307,4 +307,4 @@ const nativeScriptDeps = { | ||
function default_1() { | ||
return schematics_1.chain([ | ||
xplat_utils_1.prerun({ | ||
return (0, schematics_1.chain)([ | ||
(0, xplat_utils_1.prerun)({ | ||
framework: 'angular', | ||
@@ -311,0 +311,0 @@ }, true), |
@@ -14,4 +14,4 @@ "use strict"; | ||
function updateNativeScriptApps(tree, context) { | ||
const nativeScriptAppsPaths = xplat_utils_1.getAppPaths(tree, 'nativescript'); | ||
const npmScope = xplat_utils_1.getNpmScope(); | ||
const nativeScriptAppsPaths = (0, xplat_utils_1.getAppPaths)(tree, 'nativescript'); | ||
const npmScope = (0, xplat_utils_1.getNpmScope)(); | ||
const appsNames = []; | ||
@@ -31,3 +31,3 @@ // update {N} apps and configs | ||
const packagePath = `${dirPath}/package.json`; | ||
const packageJson = xplat_utils_1.getJsonFromFile(tree, packagePath); | ||
const packageJson = (0, xplat_utils_1.getJsonFromFile)(tree, packagePath); | ||
if (packageJson) { | ||
@@ -68,3 +68,3 @@ packageJson.main = './src/main.ts'; | ||
// console.log('packageJson overwrite:', JSON.stringify(packageJson)); | ||
tree = xplat_utils_1.updateJsonFile(tree, packagePath, packageJson); | ||
tree = (0, xplat_utils_1.updateJsonFile)(tree, packagePath, packageJson); | ||
} | ||
@@ -77,3 +77,3 @@ if (tree.exists(`${dirPath}/tsconfig.env.json`)) { | ||
} | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tools/xplat-postinstall.js`, `//#!/usr/bin/env node | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tools/xplat-postinstall.js`, `//#!/usr/bin/env node | ||
@@ -118,3 +118,3 @@ const fs = require('fs-extra'); | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.app.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.app.json`, `{ | ||
"extends": "./tsconfig.json", | ||
@@ -135,3 +135,3 @@ "compilerOptions": { | ||
}`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.editor.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.editor.json`, `{ | ||
"extends": "./tsconfig.json", | ||
@@ -144,3 +144,3 @@ "include": ["**/*.ts"], | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.json`, `{ | ||
"extends": "${relativePath}/tsconfig.base.json", | ||
@@ -162,3 +162,3 @@ "files": [], | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/tsconfig.spec.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/tsconfig.spec.json`, `{ | ||
"extends": "./tsconfig.json", | ||
@@ -174,4 +174,4 @@ "compilerOptions": { | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/src/test-setup.ts`, `import 'jest-preset-angular/setup-jest';`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/src/polyfills.ts`, `/** | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/src/test-setup.ts`, `import 'jest-preset-angular/setup-jest';`); | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/src/polyfills.ts`, `/** | ||
* NativeScript Polyfills | ||
@@ -197,3 +197,3 @@ */ | ||
`); | ||
workspace_1.createOrUpdate(tree, `${dirPath}/.eslintrc.json`, `{ | ||
(0, workspace_1.createOrUpdate)(tree, `${dirPath}/.eslintrc.json`, `{ | ||
"extends": "${relativePath}/.eslintrc.json", | ||
@@ -222,3 +222,3 @@ "ignorePatterns": [ | ||
"type": "attribute", | ||
"prefix": "${xplat_utils_1.getPrefix()}", | ||
"prefix": "${(0, xplat_utils_1.getPrefix)()}", | ||
"style": "camelCase" | ||
@@ -231,3 +231,3 @@ } | ||
"type": "element", | ||
"prefix": "${xplat_utils_1.getPrefix()}", | ||
"prefix": "${(0, xplat_utils_1.getPrefix)()}", | ||
"style": "kebab-case" | ||
@@ -265,3 +265,3 @@ } | ||
function updateRootPackage(tree, context) { | ||
return workspace_1.updateJsonInTree('package.json', (json) => { | ||
return (0, workspace_1.updateJsonInTree)('package.json', (json) => { | ||
json.scripts = json.scripts || {}; | ||
@@ -299,4 +299,4 @@ const nativeScriptDeps = { | ||
function default_1() { | ||
return schematics_1.chain([ | ||
xplat_utils_1.prerun({ | ||
return (0, schematics_1.chain)([ | ||
(0, xplat_utils_1.prerun)({ | ||
framework: 'angular', | ||
@@ -307,3 +307,3 @@ }, true), | ||
(tree) => { | ||
return schematics_1.externalSchematic('@nrwl/workspace', 'convert-to-nx-project', { | ||
return (0, schematics_1.externalSchematic)('@nrwl/workspace', 'convert-to-nx-project', { | ||
all: true | ||
@@ -310,0 +310,0 @@ }); |
{ | ||
"name": "@nstudio/xplat", | ||
"version": "13.0.1", | ||
"version": "13.4.0", | ||
"description": "Cross-platform (xplat) tools for Nx workspaces.", | ||
@@ -44,4 +44,4 @@ "homepage": "https://nstudio.io/xplat", | ||
"dependencies": { | ||
"@nstudio/focus": "13.0.1", | ||
"@nstudio/xplat-utils": "13.0.1" | ||
"@nstudio/focus": "13.4.0", | ||
"@nstudio/xplat-utils": "13.4.0" | ||
}, | ||
@@ -48,0 +48,0 @@ "author": "Nathan Walker", |
@@ -31,5 +31,5 @@ <h1 align="center">Cross-platform (xplat) tools for Nx workspaces</h1> | ||
> provide a name | ||
> What to create in the new workspace | ||
> choose `empty` | ||
> choose `apps` | ||
@@ -36,0 +36,0 @@ ``` |
@@ -9,7 +9,7 @@ "use strict"; | ||
const externalChains = utils_1.XplatHelpers.getExternalChainsForGenerator(options, 'app', packagesToRunXplat); | ||
return schematics_1.chain([ | ||
xplat_utils_1.prerun(options, true), | ||
(tree, context) => schematics_1.chain(externalChains), | ||
return (0, schematics_1.chain)([ | ||
(0, xplat_utils_1.prerun)(options, true), | ||
(tree, context) => (0, schematics_1.chain)(externalChains), | ||
]); | ||
} | ||
exports.default = default_1; |
@@ -9,4 +9,4 @@ "use strict"; | ||
const externalChains = utils_1.XplatHelpers.getExternalChainsForApplication(options, 'app', packagesToRun); | ||
return schematics_1.chain([xplat_utils_1.prerun(options, true), (tree) => schematics_1.chain(externalChains)]); | ||
return (0, schematics_1.chain)([(0, xplat_utils_1.prerun)(options, true), (tree) => (0, schematics_1.chain)(externalChains)]); | ||
} | ||
exports.default = default_1; |
@@ -17,3 +17,3 @@ "use strict"; | ||
const testing_3 = require("@nrwl/workspace/testing"); | ||
xplat_utils_1.setTest(); | ||
(0, xplat_utils_1.setTest)(); | ||
describe('xplat schematic', () => { | ||
@@ -28,3 +28,3 @@ let appTree; | ||
appTree = schematics_1.Tree.empty(); | ||
appTree = testing_1.createEmptyWorkspace(appTree); | ||
appTree = (0, testing_1.createEmptyWorkspace)(appTree); | ||
}); | ||
@@ -35,3 +35,3 @@ it('should create web angular app', () => __awaiter(void 0, void 0, void 0, function* () { | ||
options.framework = 'angular'; | ||
const tree = yield testing_2.runSchematic('app', options, appTree); | ||
const tree = yield (0, testing_2.runSchematic)('app', options, appTree); | ||
const files = tree.files; | ||
@@ -49,3 +49,3 @@ // console.log('files:', files); | ||
options.framework = 'angular'; | ||
const tree = yield testing_2.runSchematic('app', options, appTree); | ||
const tree = yield (0, testing_2.runSchematic)('app', options, appTree); | ||
const files = tree.files; | ||
@@ -61,10 +61,10 @@ // console.log('files:', files); | ||
appTree = schematics_1.Tree.empty(); | ||
appTree = testing_1.createEmptyWorkspace(appTree); | ||
appTree = (0, testing_1.createEmptyWorkspace)(appTree); | ||
const options = Object.assign({}, defaultOptions); | ||
options.platforms = 'express'; | ||
const tree = yield testing_2.runSchematic('app', options, appTree); | ||
const tree = yield (0, testing_2.runSchematic)('app', options, appTree); | ||
const files = tree.files; | ||
// console.log('files:', files); | ||
expect(tree.exists('/apps/express-sample/src/main.ts')).toBeTruthy(); | ||
let fileContent = testing_3.getFileContent(tree, '/apps/express-sample/src/main.ts'); | ||
let fileContent = (0, testing_3.getFileContent)(tree, '/apps/express-sample/src/main.ts'); | ||
// console.log(fileContent); | ||
@@ -75,3 +75,3 @@ expect(fileContent.indexOf(`from 'express'`)).toBeGreaterThan(0); | ||
appTree = schematics_1.Tree.empty(); | ||
appTree = testing_1.createEmptyWorkspace(appTree); | ||
appTree = (0, testing_1.createEmptyWorkspace)(appTree); | ||
const options = Object.assign({}, defaultOptions); | ||
@@ -81,7 +81,7 @@ options.platforms = 'nest'; | ||
delete options.isTesting; | ||
const tree = yield testing_2.runSchematic('app', options, appTree); | ||
const tree = yield (0, testing_2.runSchematic)('app', options, appTree); | ||
const files = tree.files; | ||
// console.log('files:', files); | ||
expect(tree.exists('/apps/nest-sample/src/main.ts')).toBeTruthy(); | ||
let fileContent = testing_3.getFileContent(tree, '/apps/nest-sample/src/main.ts'); | ||
let fileContent = (0, testing_3.getFileContent)(tree, '/apps/nest-sample/src/main.ts'); | ||
// console.log(fileContent); | ||
@@ -92,3 +92,3 @@ expect(fileContent.indexOf(`from '@nestjs/core'`)).toBeGreaterThan(0); | ||
appTree = schematics_1.Tree.empty(); | ||
appTree = testing_1.createEmptyWorkspace(appTree); | ||
appTree = (0, testing_1.createEmptyWorkspace)(appTree); | ||
const options = Object.assign({}, defaultOptions); | ||
@@ -98,7 +98,7 @@ options.platforms = 'node'; | ||
delete options.isTesting; | ||
const tree = yield testing_2.runSchematic('app', options, appTree); | ||
const tree = yield (0, testing_2.runSchematic)('app', options, appTree); | ||
const files = tree.files; | ||
// console.log('files:', files); | ||
expect(tree.exists('/apps/node-sample/src/main.ts')).toBeTruthy(); | ||
let fileContent = testing_3.getFileContent(tree, '/apps/node-sample/src/main.ts'); | ||
let fileContent = (0, testing_3.getFileContent)(tree, '/apps/node-sample/src/main.ts'); | ||
// console.log(fileContent); | ||
@@ -105,0 +105,0 @@ expect(fileContent.indexOf(`console.log('Hello World!')`)).toBeGreaterThanOrEqual(0); |
@@ -9,4 +9,4 @@ "use strict"; | ||
const externalChains = utils_1.XplatHelpers.getExternalChainsForGenerator(options, 'component', packagesToRunXplat); | ||
return schematics_1.chain([xplat_utils_1.prerun(options, true), (tree) => schematics_1.chain(externalChains)]); | ||
return (0, schematics_1.chain)([(0, xplat_utils_1.prerun)(options, true), (tree) => (0, schematics_1.chain)(externalChains)]); | ||
} | ||
exports.default = default_1; |
@@ -27,7 +27,7 @@ "use strict"; | ||
appTree = schematics_1.Tree.empty(); | ||
appTree = testing_1.createXplatWithNativeScriptWeb(appTree, false, 'angular'); | ||
appTree = (0, testing_1.createXplatWithNativeScriptWeb)(appTree, false, 'angular'); | ||
}); | ||
it('should create component for specified platforms', () => __awaiter(void 0, void 0, void 0, function* () { | ||
// console.log('appTree:', appTree); | ||
let tree = yield testing_2.runSchematic('feature', { | ||
let tree = yield (0, testing_2.runSchematic)('feature', { | ||
name: 'foo', | ||
@@ -39,3 +39,3 @@ platforms: 'nativescript,web', | ||
const options = Object.assign({}, defaultOptions); | ||
tree = yield testing_2.runSchematic('component', options, tree); | ||
tree = yield (0, testing_2.runSchematic)('component', options, tree); | ||
const files = tree.files; | ||
@@ -51,3 +51,3 @@ // console.log(files.slice(91,files.length)); | ||
let barrelPath = '/libs/features/foo/base/index.ts'; | ||
let barrelIndex = testing_1.getFileContent(tree, barrelPath); | ||
let barrelIndex = (0, testing_1.getFileContent)(tree, barrelPath); | ||
// console.log(barrelPath + ':'); | ||
@@ -59,3 +59,3 @@ // console.log(barrelIndex); | ||
barrelPath = '/xplat/nativescript/features/foo/components/index.ts'; | ||
barrelIndex = testing_1.getFileContent(tree, barrelPath); | ||
barrelIndex = (0, testing_1.getFileContent)(tree, barrelPath); | ||
// console.log(barrelPath + ':'); | ||
@@ -67,3 +67,3 @@ // console.log(barrelIndex); | ||
barrelPath = '/xplat/web/features/foo/components/index.ts'; | ||
barrelIndex = testing_1.getFileContent(tree, barrelPath); | ||
barrelIndex = (0, testing_1.getFileContent)(tree, barrelPath); | ||
// console.log(barrelPath + ':'); | ||
@@ -76,5 +76,5 @@ // console.log(barrelIndex); | ||
appTree = schematics_1.Tree.empty(); | ||
appTree = testing_1.createXplatWithNativeScriptWeb(appTree); | ||
appTree = (0, testing_1.createXplatWithNativeScriptWeb)(appTree); | ||
// console.log('appTree:', appTree); | ||
let tree = yield testing_2.runSchematic('feature', { | ||
let tree = yield (0, testing_2.runSchematic)('feature', { | ||
name: 'foo', | ||
@@ -86,3 +86,3 @@ platforms: 'nativescript,web', | ||
delete options.framework; | ||
tree = yield testing_2.runSchematic('component', options, tree); | ||
tree = yield (0, testing_2.runSchematic)('component', options, tree); | ||
const files = tree.files; | ||
@@ -99,3 +99,3 @@ // console.log(files);//.slice(91,files.length)); | ||
// console.log('appTree:', appTree); | ||
let tree = yield testing_2.runSchematic('feature', { | ||
let tree = yield (0, testing_2.runSchematic)('feature', { | ||
name: 'foo', | ||
@@ -108,3 +108,3 @@ platforms: 'nativescript,web', | ||
options.subFolder = 'registration'; | ||
tree = yield testing_2.runSchematic('component', options, tree); | ||
tree = yield (0, testing_2.runSchematic)('component', options, tree); | ||
const files = tree.files; | ||
@@ -120,3 +120,3 @@ // console.log(files.slice(91,files.length)); | ||
let barrelPath = '/libs/features/foo/base/registration/index.ts'; | ||
let barrelIndex = testing_1.getFileContent(tree, barrelPath); | ||
let barrelIndex = (0, testing_1.getFileContent)(tree, barrelPath); | ||
// console.log(barrelPath + ':'); | ||
@@ -126,3 +126,3 @@ // console.log(barrelIndex); | ||
barrelPath = '/libs/features/foo/base/index.ts'; | ||
barrelIndex = testing_1.getFileContent(tree, barrelPath); | ||
barrelIndex = (0, testing_1.getFileContent)(tree, barrelPath); | ||
// console.log(barrelPath + ':'); | ||
@@ -135,3 +135,3 @@ // console.log(barrelIndex); | ||
'/xplat/nativescript/features/foo/components/registration/index.ts'; | ||
barrelIndex = testing_1.getFileContent(tree, barrelPath); | ||
barrelIndex = (0, testing_1.getFileContent)(tree, barrelPath); | ||
// console.log(barrelPath + ':'); | ||
@@ -143,3 +143,3 @@ // console.log(barrelIndex); | ||
barrelPath = '/xplat/web/features/foo/components/registration/index.ts'; | ||
barrelIndex = testing_1.getFileContent(tree, barrelPath); | ||
barrelIndex = (0, testing_1.getFileContent)(tree, barrelPath); | ||
// console.log(barrelPath + ':'); | ||
@@ -151,3 +151,3 @@ // console.log(barrelIndex); | ||
barrelPath = '/xplat/nativescript/features/foo/components/index.ts'; | ||
barrelIndex = testing_1.getFileContent(tree, barrelPath); | ||
barrelIndex = (0, testing_1.getFileContent)(tree, barrelPath); | ||
// console.log(barrelPath + ':'); | ||
@@ -158,3 +158,3 @@ // console.log(barrelIndex); | ||
barrelPath = '/xplat/web/features/foo/components/index.ts'; | ||
barrelIndex = testing_1.getFileContent(tree, barrelPath); | ||
barrelIndex = (0, testing_1.getFileContent)(tree, barrelPath); | ||
// console.log(barrelPath + ':'); | ||
@@ -166,3 +166,3 @@ // console.log(barrelIndex); | ||
// console.log('appTree:', appTree); | ||
let tree = yield testing_2.runSchematic('feature', { | ||
let tree = yield (0, testing_2.runSchematic)('feature', { | ||
name: 'foo', | ||
@@ -180,3 +180,3 @@ projects: 'nativescript-viewer,web-viewer', | ||
}; | ||
tree = yield testing_2.runSchematic('component', options, tree); | ||
tree = yield (0, testing_2.runSchematic)('component', options, tree); | ||
const files = tree.files; | ||
@@ -197,3 +197,3 @@ // console.log(files. slice(91,files.length)); | ||
let barrelPath = '/apps/nativescript-viewer/src/features/foo/components/index.ts'; | ||
let barrelIndex = testing_1.getFileContent(tree, barrelPath); | ||
let barrelIndex = (0, testing_1.getFileContent)(tree, barrelPath); | ||
// console.log(barrelPath + ':'); | ||
@@ -211,3 +211,3 @@ // console.log(barrelIndex); | ||
barrelPath = '/apps/web-viewer/src/app/features/foo/components/index.ts'; | ||
barrelIndex = testing_1.getFileContent(tree, barrelPath); | ||
barrelIndex = (0, testing_1.getFileContent)(tree, barrelPath); | ||
// console.log(barrelPath + ':'); | ||
@@ -226,4 +226,4 @@ // console.log(barrelIndex); | ||
}; | ||
yield expect(testing_2.runSchematic('component', options, appTree)).rejects.toThrow(`apps/nativescript-viewer/src/features/foo/foo.module.ts does not exist. Create the feature module first. For example: nx g @nstudio/angular:feature foo --projects=nativescript-viewer --onlyModule`); | ||
yield expect((0, testing_2.runSchematic)('component', options, appTree)).rejects.toThrow(`apps/nativescript-viewer/src/features/foo/foo.module.ts does not exist. Create the feature module first. For example: nx g @nstudio/angular:feature foo --projects=nativescript-viewer --onlyModule`); | ||
})); | ||
}); |
@@ -9,7 +9,7 @@ "use strict"; | ||
const externalChains = utils_1.XplatHelpers.getExternalChainsForGenerator(options, 'feature', packagesToRunXplat); | ||
return schematics_1.chain([ | ||
xplat_utils_1.prerun(options, true), | ||
(tree, context) => schematics_1.chain(externalChains), | ||
return (0, schematics_1.chain)([ | ||
(0, xplat_utils_1.prerun)(options, true), | ||
(tree, context) => (0, schematics_1.chain)(externalChains), | ||
]); | ||
} | ||
exports.default = default_1; |
@@ -28,3 +28,3 @@ "use strict"; | ||
appTree = schematics_1.Tree.empty(); | ||
appTree = testing_utils_1.createXplatWithNativeScriptWeb(appTree, null, 'angular'); | ||
appTree = (0, testing_utils_1.createXplatWithNativeScriptWeb)(appTree, null, 'angular'); | ||
}); | ||
@@ -34,3 +34,3 @@ it('should create feature module with a single starting component', () => __awaiter(void 0, void 0, void 0, function* () { | ||
// console.log('appTree:', appTree); | ||
let tree = yield testing_1.runSchematic('feature', options, appTree); | ||
let tree = yield (0, testing_1.runSchematic)('feature', options, appTree); | ||
const files = tree.files; | ||
@@ -67,12 +67,12 @@ // console.log(files);//.slice(85,files.length)); | ||
let modulePath = '/libs/xplat/nativescript/features/src/lib/foo/foo.module.ts'; | ||
let featureModule = testing_utils_1.getFileContent(tree, modulePath); | ||
let featureModule = (0, testing_utils_1.getFileContent)(tree, modulePath); | ||
// console.log(modulePath + ':'); | ||
// console.log(featureModule); | ||
expect(featureModule).toMatch(testing_utils_1.isInModuleMetadata('FooModule', 'imports', `UIModule`, true)); | ||
expect(featureModule).toMatch((0, testing_utils_1.isInModuleMetadata)('FooModule', 'imports', `UIModule`, true)); | ||
expect(featureModule).toMatch(`import { UIModule } from \'../ui/ui.module\'`); | ||
modulePath = '/libs/xplat/web/features/src/lib/foo/foo.module.ts'; | ||
featureModule = testing_utils_1.getFileContent(tree, modulePath); | ||
featureModule = (0, testing_utils_1.getFileContent)(tree, modulePath); | ||
// console.log(modulePath + ':'); | ||
// console.log(featureModule); | ||
expect(featureModule).toMatch(testing_utils_1.isInModuleMetadata('FooModule', 'imports', `UIModule`, true)); | ||
expect(featureModule).toMatch((0, testing_utils_1.isInModuleMetadata)('FooModule', 'imports', `UIModule`, true)); | ||
expect(featureModule).toMatch(`import { UIModule } from \'../ui/ui.module\'`); | ||
@@ -82,7 +82,7 @@ })); | ||
appTree = schematics_1.Tree.empty(); | ||
appTree = testing_utils_1.createXplatWithNativeScriptWeb(appTree); | ||
appTree = (0, testing_utils_1.createXplatWithNativeScriptWeb)(appTree); | ||
const options = Object.assign({}, defaultOptions); | ||
delete options.framework; | ||
// console.log('appTree:', appTree); | ||
let tree = yield testing_1.runSchematic('feature', options, appTree); | ||
let tree = yield (0, testing_1.runSchematic)('feature', options, appTree); | ||
const files = tree.files; | ||
@@ -119,12 +119,12 @@ // console.log(files.slice(85,files.length)); | ||
let modulePath = '/libs/xplat/nativescript-angular/features/src/lib/foo/foo.module.ts'; | ||
let featureModule = testing_utils_1.getFileContent(tree, modulePath); | ||
let featureModule = (0, testing_utils_1.getFileContent)(tree, modulePath); | ||
// console.log(modulePath + ':'); | ||
// console.log(featureModule); | ||
expect(featureModule).toMatch(testing_utils_1.isInModuleMetadata('FooModule', 'imports', `UIModule`, true)); | ||
expect(featureModule).toMatch((0, testing_utils_1.isInModuleMetadata)('FooModule', 'imports', `UIModule`, true)); | ||
expect(featureModule).toMatch(`import { UIModule } from \'../ui/ui.module\'`); | ||
modulePath = '/libs/xplat/web-angular/features/src/lib/foo/foo.module.ts'; | ||
featureModule = testing_utils_1.getFileContent(tree, modulePath); | ||
featureModule = (0, testing_utils_1.getFileContent)(tree, modulePath); | ||
// console.log(modulePath + ':'); | ||
// console.log(featureModule); | ||
expect(featureModule).toMatch(testing_utils_1.isInModuleMetadata('FooModule', 'imports', `UIModule`, true)); | ||
expect(featureModule).toMatch((0, testing_utils_1.isInModuleMetadata)('FooModule', 'imports', `UIModule`, true)); | ||
expect(featureModule).toMatch(`import { UIModule } from \'../ui/ui.module\'`); | ||
@@ -136,3 +136,3 @@ })); | ||
options.onlyModule = true; | ||
let tree = yield testing_1.runSchematic('feature', options, appTree); | ||
let tree = yield (0, testing_1.runSchematic)('feature', options, appTree); | ||
const files = tree.files; | ||
@@ -160,6 +160,6 @@ // console.log(files.slice(85,files.length)); | ||
let modulePath = '/libs/xplat/nativescript/features/src/lib/foo/foo.module.ts'; | ||
let featureModule = testing_utils_1.getFileContent(tree, modulePath); | ||
let featureModule = (0, testing_utils_1.getFileContent)(tree, modulePath); | ||
// console.log(modulePath + ':'); | ||
// console.log(featureModule); | ||
expect(featureModule).toMatch(testing_utils_1.isInModuleMetadata('FooModule', 'imports', `UIModule`, true)); | ||
expect(featureModule).toMatch((0, testing_utils_1.isInModuleMetadata)('FooModule', 'imports', `UIModule`, true)); | ||
expect(featureModule).toMatch(`import { UIModule } from \'../ui/ui.module\'`); | ||
@@ -169,6 +169,6 @@ expect(featureModule.indexOf('FOO_COMPONENTS')).toBe(-1); | ||
modulePath = '/libs/xplat/nativescript/features/src/lib/foo/foo.module.ts'; | ||
featureModule = testing_utils_1.getFileContent(tree, modulePath); | ||
featureModule = (0, testing_utils_1.getFileContent)(tree, modulePath); | ||
// console.log(modulePath + ':'); | ||
// console.log(featureModule); | ||
expect(featureModule).toMatch(testing_utils_1.isInModuleMetadata('FooModule', 'imports', `UIModule`, true)); | ||
expect(featureModule).toMatch((0, testing_utils_1.isInModuleMetadata)('FooModule', 'imports', `UIModule`, true)); | ||
expect(featureModule).toMatch(`import { UIModule } from \'../ui/ui.module\'`); | ||
@@ -182,3 +182,3 @@ })); | ||
}; | ||
let tree = yield testing_1.runSchematic('feature', options, appTree); | ||
let tree = yield (0, testing_1.runSchematic)('feature', options, appTree); | ||
const files = tree.files; | ||
@@ -204,6 +204,6 @@ // console.log(files.slice(85,files.length)); | ||
let modulePath = '/libs/xplat/web/features/src/lib/foo/foo.module.ts'; | ||
let featureModule = testing_utils_1.getFileContent(tree, modulePath); | ||
let featureModule = (0, testing_utils_1.getFileContent)(tree, modulePath); | ||
// console.log(modulePath + ':'); | ||
// console.log(featureModule); | ||
expect(featureModule).toMatch(testing_utils_1.isInModuleMetadata('FooModule', 'imports', `UIModule`, true)); | ||
expect(featureModule).toMatch((0, testing_utils_1.isInModuleMetadata)('FooModule', 'imports', `UIModule`, true)); | ||
expect(featureModule).toMatch(`import { UIModule } from \'../ui/ui.module\'`); | ||
@@ -213,3 +213,3 @@ expect(featureModule.indexOf('FOO_COMPONENTS')).toBeGreaterThanOrEqual(0); | ||
let compPath = '/libs/xplat/web/features/src/lib/foo/components/foo/foo.component.ts'; | ||
let compContent = testing_utils_1.getFileContent(tree, compPath); | ||
let compContent = (0, testing_utils_1.getFileContent)(tree, compPath); | ||
// console.log(compPath + ':'); | ||
@@ -223,3 +223,3 @@ // console.log(compContent); | ||
options.onlyProject = true; | ||
let tree = yield testing_1.runSchematic('feature', options, appTree); | ||
let tree = yield (0, testing_1.runSchematic)('feature', options, appTree); | ||
const files = tree.files; | ||
@@ -254,12 +254,12 @@ // console.log(files.slice(85,files.length)); | ||
let modulePath = '/apps/nativescript-viewer/src/features/foo/foo.module.ts'; | ||
let featureModule = testing_utils_1.getFileContent(tree, modulePath); | ||
let featureModule = (0, testing_utils_1.getFileContent)(tree, modulePath); | ||
// console.log(modulePath + ':'); | ||
// console.log(featureModule); | ||
expect(featureModule).toMatch(testing_utils_1.isInModuleMetadata('FooModule', 'imports', `SharedModule`, true)); | ||
expect(featureModule).toMatch((0, testing_utils_1.isInModuleMetadata)('FooModule', 'imports', `SharedModule`, true)); | ||
expect(featureModule).toMatch(`import { SharedModule } from \'../shared/shared.module\'`); | ||
modulePath = '/apps/web-viewer/src/app/features/foo/foo.module.ts'; | ||
featureModule = testing_utils_1.getFileContent(tree, modulePath); | ||
featureModule = (0, testing_utils_1.getFileContent)(tree, modulePath); | ||
// console.log(modulePath + ':'); | ||
// console.log(featureModule); | ||
expect(featureModule).toMatch(testing_utils_1.isInModuleMetadata('FooModule', 'imports', `SharedModule`, true)); | ||
expect(featureModule).toMatch((0, testing_utils_1.isInModuleMetadata)('FooModule', 'imports', `SharedModule`, true)); | ||
expect(featureModule).toMatch(`import { SharedModule } from \'../shared/shared.module\'`); | ||
@@ -271,7 +271,7 @@ })); | ||
options.routing = true; | ||
yield expect(testing_1.runSchematic('feature', options, appTree)).rejects.toThrow('When generating a feature with the --routing option, please also specify --onlyProject. Support for shared code routing is under development.'); | ||
yield expect((0, testing_1.runSchematic)('feature', options, appTree)).rejects.toThrow('When generating a feature with the --routing option, please also specify --onlyProject. Support for shared code routing is under development.'); | ||
})); | ||
it('should create feature module (with dashes in name) for specified projects WITH Routing', () => __awaiter(void 0, void 0, void 0, function* () { | ||
appTree = schematics_1.Tree.empty(); | ||
appTree = testing_utils_1.createXplatWithNativeScriptWeb(appTree, true); | ||
appTree = (0, testing_utils_1.createXplatWithNativeScriptWeb)(appTree, true); | ||
const options = Object.assign({}, defaultOptions); | ||
@@ -282,3 +282,3 @@ // console.log('appTree:', appTree); | ||
options.name = 'foo-with-dash'; | ||
let tree = yield testing_1.runSchematic('feature', options, appTree); | ||
let tree = yield (0, testing_1.runSchematic)('feature', options, appTree); | ||
const files = tree.files; | ||
@@ -301,3 +301,3 @@ // console.log(files.slice(85,files.length)); | ||
let modulePath = '/apps/nativescript-viewer/src/features/foo-with-dash/foo-with-dash.module.ts'; | ||
let featureModule = testing_utils_1.getFileContent(tree, modulePath); | ||
let featureModule = (0, testing_utils_1.getFileContent)(tree, modulePath); | ||
// console.log(modulePath + ':'); | ||
@@ -311,3 +311,3 @@ // console.log(featureModule); | ||
'/apps/web-viewer/src/app/features/foo-with-dash/foo-with-dash.module.ts'; | ||
featureModule = testing_utils_1.getFileContent(tree, modulePath); | ||
featureModule = (0, testing_utils_1.getFileContent)(tree, modulePath); | ||
// console.log(modulePath + ':'); | ||
@@ -321,3 +321,3 @@ // console.log(featureModule); | ||
modulePath = '/apps/web-viewer/src/app/app.routing.ts'; | ||
featureModule = testing_utils_1.getFileContent(tree, modulePath); | ||
featureModule = (0, testing_utils_1.getFileContent)(tree, modulePath); | ||
// console.log(modulePath + ':'); | ||
@@ -329,3 +329,3 @@ // console.log(featureModule); | ||
modulePath = '/apps/nativescript-viewer/src/app.routing.ts'; | ||
featureModule = testing_utils_1.getFileContent(tree, modulePath); | ||
featureModule = (0, testing_utils_1.getFileContent)(tree, modulePath); | ||
// console.log(modulePath + ':'); | ||
@@ -338,3 +338,3 @@ // console.log(featureModule); | ||
'/apps/web-viewer/src/app/features/foo-with-dash/components/index.ts'; | ||
featureModule = testing_utils_1.getFileContent(tree, modulePath); | ||
featureModule = (0, testing_utils_1.getFileContent)(tree, modulePath); | ||
// console.log(modulePath + ':'); | ||
@@ -347,6 +347,6 @@ // console.log(featureModule); | ||
appTree = schematics_1.Tree.empty(); | ||
appTree = testing_utils_1.createXplatWithNativeScriptWeb(appTree, true); | ||
appTree = (0, testing_utils_1.createXplatWithNativeScriptWeb)(appTree, true); | ||
// manually update home.component to prep for sandobx | ||
const homeCmpPath = `/apps/nativescript-viewer/src/features/home/components/home.component.html`; | ||
workspace_1.createOrUpdate(appTree, homeCmpPath, sandboxHomeSetup()); | ||
(0, workspace_1.createOrUpdate)(appTree, homeCmpPath, sandboxHomeSetup()); | ||
// console.log('homecmp:', getFileContent(tree, homeCmpPath)); | ||
@@ -357,3 +357,3 @@ options.onlyProject = true; | ||
options.name = 'foo-with-dash'; | ||
let tree = yield testing_1.runSchematic('feature', options, appTree); | ||
let tree = yield (0, testing_1.runSchematic)('feature', options, appTree); | ||
// console.log('---------') | ||
@@ -360,0 +360,0 @@ // console.log('homecmp:', getFileContent(tree, homeCmpPath)); |
@@ -12,5 +12,5 @@ "use strict"; | ||
if (!options.name) { | ||
throw new schematics_1.SchematicsException(xplat_1.missingArgument('name', `Provide a comma delimited list of helpers to generate like this for 'applitools'.`, 'nx g @nstudio/xplat:helpers applitools --target=web-myapp')); | ||
throw new schematics_1.SchematicsException((0, xplat_1.missingArgument)('name', `Provide a comma delimited list of helpers to generate like this for 'applitools'.`, 'nx g @nstudio/xplat:helpers applitools --target=web-myapp')); | ||
} | ||
const platforms = (xplat_utils_1.sanitizeCommaDelimitedArg(options.platforms)); | ||
const platforms = ((0, xplat_utils_1.sanitizeCommaDelimitedArg)(options.platforms)); | ||
const helperChains = []; | ||
@@ -34,5 +34,5 @@ const processHelpers = (platform) => { | ||
if (!platform) { | ||
throw new schematics_1.SchematicsException(xplat_1.helperMissingPlatforms()); | ||
throw new schematics_1.SchematicsException((0, xplat_1.helperMissingPlatforms)()); | ||
} | ||
helperChains.push(schematics_1.externalSchematic(platformToPackage[platform], 'helpers', { | ||
helperChains.push((0, schematics_1.externalSchematic)(platformToPackage[platform], 'helpers', { | ||
name: options.name, | ||
@@ -48,3 +48,3 @@ target: options.target, | ||
else { | ||
throw new schematics_1.SchematicsException(xplat_1.unsupportedPlatformError(platform)); | ||
throw new schematics_1.SchematicsException((0, xplat_1.unsupportedPlatformError)(platform)); | ||
} | ||
@@ -56,4 +56,4 @@ } | ||
} | ||
return schematics_1.chain([ | ||
xplat_utils_1.prerun(), | ||
return (0, schematics_1.chain)([ | ||
(0, xplat_utils_1.prerun)(), | ||
// add helper chains | ||
@@ -60,0 +60,0 @@ ...helperChains, |
@@ -16,3 +16,3 @@ "use strict"; | ||
const testing_2 = require("../../utils/testing"); | ||
xplat_utils_1.setTest(); | ||
(0, xplat_utils_1.setTest)(); | ||
describe('xplat-helper schematic', () => { | ||
@@ -22,3 +22,3 @@ let appTree; | ||
appTree = schematics_1.Tree.empty(); | ||
appTree = testing_1.createEmptyWorkspace(appTree); | ||
appTree = (0, testing_1.createEmptyWorkspace)(appTree); | ||
}); | ||
@@ -31,3 +31,3 @@ it('generating helper for a platform where the helper is not supported should not do anything', () => __awaiter(void 0, void 0, void 0, function* () { | ||
}; | ||
appTree = yield testing_2.runSchematic('init', optionsXplat, appTree); | ||
appTree = yield (0, testing_2.runSchematic)('init', optionsXplat, appTree); | ||
const options = { | ||
@@ -38,3 +38,3 @@ name: 'imports', | ||
// console.log('appTree:', appTree); | ||
const tree = yield testing_2.runSchematic('helpers', options, appTree); | ||
const tree = yield (0, testing_2.runSchematic)('helpers', options, appTree); | ||
const files = tree.files; | ||
@@ -41,0 +41,0 @@ // console.log(files); |
@@ -40,3 +40,3 @@ "use strict"; | ||
else { | ||
throw new schematics_1.SchematicsException(utils_1.unsupportedFrameworkError(framework)); | ||
throw new schematics_1.SchematicsException((0, utils_1.unsupportedFrameworkError)(framework)); | ||
} | ||
@@ -54,3 +54,3 @@ } | ||
else { | ||
const platforms = xplat_utils_1.sanitizeCommaDelimitedArg(platformArg); | ||
const platforms = (0, xplat_utils_1.sanitizeCommaDelimitedArg)(platformArg); | ||
if (frameworks.length) { | ||
@@ -70,3 +70,3 @@ for (const framework of frameworks) { | ||
else if (xplat_utils_1.supportedPlatformsWithNx.includes(platform)) { | ||
throw new schematics_1.SchematicsException(utils_1.unsupportedPlatformErrorWithNxNote(platform, 'xplat')); | ||
throw new schematics_1.SchematicsException((0, utils_1.unsupportedPlatformErrorWithNxNote)(platform, 'xplat')); | ||
} | ||
@@ -76,3 +76,3 @@ } | ||
else { | ||
throw new schematics_1.SchematicsException(utils_1.unsupportedFrameworkError(framework)); | ||
throw new schematics_1.SchematicsException((0, utils_1.unsupportedFrameworkError)(framework)); | ||
} | ||
@@ -89,6 +89,6 @@ } | ||
else if (xplat_utils_1.supportedPlatformsWithNx.includes(platform)) { | ||
throw new schematics_1.SchematicsException(utils_1.unsupportedPlatformErrorWithNxNote(platform, 'xplat')); | ||
throw new schematics_1.SchematicsException((0, utils_1.unsupportedPlatformErrorWithNxNote)(platform, 'xplat')); | ||
} | ||
else { | ||
throw new schematics_1.SchematicsException(xplat_1.unsupportedPlatformError(platform)); | ||
throw new schematics_1.SchematicsException((0, xplat_1.unsupportedPlatformError)(platform)); | ||
} | ||
@@ -101,3 +101,3 @@ } | ||
// check user's package for current version | ||
const packageJson = xplat_utils_1.getJsonFromFile(tree, 'package.json'); | ||
const packageJson = (0, xplat_utils_1.getJsonFromFile)(tree, 'package.json'); | ||
if (packageJson) { | ||
@@ -137,3 +137,3 @@ for (const packageName in devDependencies) { | ||
for (const packageName of packagesToRunXplat) { | ||
externalChains.push(schematics_1.externalSchematic(packageName, 'xplat', options, { | ||
externalChains.push((0, schematics_1.externalSchematic)(packageName, 'xplat', options, { | ||
interactive: false, | ||
@@ -160,13 +160,13 @@ })); | ||
else { | ||
return schematics_1.noop()(tree, context); | ||
return (0, schematics_1.noop)()(tree, context); | ||
} | ||
}); | ||
} | ||
return schematics_1.chain([ | ||
xplat_utils_1.prerun(options, true), | ||
(tree) => schematics_1.chain(externalChains), | ||
return (0, schematics_1.chain)([ | ||
(0, xplat_utils_1.prerun)(options, true), | ||
(tree) => (0, schematics_1.chain)(externalChains), | ||
// addInstallTask(), | ||
focus_1.FocusHelpers.updateIDESettings(options), | ||
// after initializing new platforms always reset dev mode to fullstack to ensure user sees it | ||
schematics_1.externalSchematic('@nstudio/xplat', 'mode', { | ||
(0, schematics_1.externalSchematic)('@nstudio/xplat', 'mode', { | ||
name: 'fullstack', | ||
@@ -173,0 +173,0 @@ }), |
@@ -18,3 +18,3 @@ "use strict"; | ||
const testing_3 = require("@nrwl/workspace/testing"); | ||
xplat_utils_1.setTest(); | ||
(0, xplat_utils_1.setTest)(); | ||
describe('xplat init', () => { | ||
@@ -28,3 +28,3 @@ let appTree; | ||
beforeEach(() => { | ||
appTree = testing_1.createEmptyWorkspace(schematics_1.Tree.empty()); | ||
appTree = (0, testing_1.createEmptyWorkspace)(schematics_1.Tree.empty()); | ||
}); | ||
@@ -35,6 +35,6 @@ it('should init default xplat deps', () => __awaiter(void 0, void 0, void 0, function* () { | ||
options.framework = 'angular'; | ||
const tree = yield testing_2.runSchematic('init', options, appTree); | ||
const tree = yield (0, testing_2.runSchematic)('init', options, appTree); | ||
const files = tree.files; | ||
// console.log('files:', files); | ||
let packageJson = JSON.parse(testing_3.getFileContent(tree, 'package.json')); | ||
let packageJson = JSON.parse((0, testing_3.getFileContent)(tree, 'package.json')); | ||
// console.log(packageJson); | ||
@@ -59,3 +59,3 @@ const devDeps = [ | ||
options.framework = 'angular'; | ||
const tree = yield testing_2.runSchematic('init', options, appTree); | ||
const tree = yield (0, testing_2.runSchematic)('init', options, appTree); | ||
// const files = tree.files; | ||
@@ -67,3 +67,3 @@ // console.log('files:', files); | ||
expect(tree.exists('/libs/xplat/nativescript-angular/core/src/lib/index.ts')).toBeFalsy(); | ||
let packageJson = JSON.parse(testing_3.getFileContent(tree, 'package.json')); | ||
let packageJson = JSON.parse((0, testing_3.getFileContent)(tree, 'package.json')); | ||
// console.log(packageJson); | ||
@@ -75,3 +75,3 @@ expect(packageJson.xplat.framework).toBe('angular'); | ||
options.platforms = 'desktop'; | ||
yield expect(testing_2.runSchematic('init', options, appTree)).rejects.toThrow(`desktop is currently not a supported platform. Supported at the moment: ${xplat_utils_1.supportedPlatforms}. Please request support for this platform if you'd like and/or submit a PR which we would greatly appreciate.`); | ||
yield expect((0, testing_2.runSchematic)('init', options, appTree)).rejects.toThrow(`desktop is currently not a supported platform. Supported at the moment: ${xplat_utils_1.supportedPlatforms}. Please request support for this platform if you'd like and/or submit a PR which we would greatly appreciate.`); | ||
})); | ||
@@ -83,3 +83,3 @@ it('should NOT create unsupported framework xplat option and throw', () => __awaiter(void 0, void 0, void 0, function* () { | ||
let tree; | ||
yield expect(testing_2.runSchematic('init', options, appTree)).rejects.toThrow(`blah is currently not a supported framework. Supported at the moment: ${xplat_utils_1.supportedFrameworks.map((f) => utils_1.stringUtils.capitalize(f))}. Please request support for this framework if you'd like and/or submit a PR which we would greatly appreciate.`); | ||
yield expect((0, testing_2.runSchematic)('init', options, appTree)).rejects.toThrow(`blah is currently not a supported framework. Supported at the moment: ${xplat_utils_1.supportedFrameworks.map((f) => utils_1.stringUtils.capitalize(f))}. Please request support for this framework if you'd like and/or submit a PR which we would greatly appreciate.`); | ||
})); | ||
@@ -86,0 +86,0 @@ /** |
@@ -6,7 +6,7 @@ "use strict"; | ||
function default_1(options) { | ||
return schematics_1.chain([ | ||
xplat_utils_1.prerun(options, true), | ||
(tree, context) => schematics_1.externalSchematic('@nstudio/focus', 'mode', options), | ||
return (0, schematics_1.chain)([ | ||
(0, xplat_utils_1.prerun)(options, true), | ||
(tree, context) => (0, schematics_1.externalSchematic)('@nstudio/focus', 'mode', options), | ||
]); | ||
} | ||
exports.default = default_1; |
@@ -6,7 +6,7 @@ "use strict"; | ||
function default_1(options) { | ||
return schematics_1.chain([ | ||
xplat_utils_1.prerun(options, true), | ||
(tree, context) => schematics_1.externalSchematic('@nstudio/xplat', 'init', options), | ||
return (0, schematics_1.chain)([ | ||
(0, xplat_utils_1.prerun)(options, true), | ||
(tree, context) => (0, schematics_1.externalSchematic)('@nstudio/xplat', 'init', options), | ||
]); | ||
} | ||
exports.default = default_1; |
@@ -286,3 +286,3 @@ "use strict"; | ||
function getProjectConfig(tree, name) { | ||
const workspaceJson = general_1.readWorkspaceJson(tree); | ||
const workspaceJson = (0, general_1.readWorkspaceJson)(tree); | ||
const projectConfig = workspaceJson.projects[name]; | ||
@@ -289,0 +289,0 @@ if (!projectConfig) { |
@@ -38,3 +38,3 @@ "use strict"; | ||
if (tree.exists(packagePath)) { | ||
const packageJson = xplat_utils_1.getJsonFromFile(tree, packagePath); | ||
const packageJson = (0, xplat_utils_1.getJsonFromFile)(tree, packagePath); | ||
if (packageJson) { | ||
@@ -51,3 +51,3 @@ // sync version with what user has store set at | ||
packageJson.devDependencies = Object.assign(Object.assign({}, (packageJson.devDependencies || {})), devDependencies); | ||
return xplat_utils_1.updateJsonFile(tree, packagePath, packageJson); | ||
return (0, xplat_utils_1.updateJsonFile)(tree, packagePath, packageJson); | ||
} | ||
@@ -74,5 +74,5 @@ } | ||
// console.log('tsConfigPath:', tsConfigPath) | ||
const tsConfig = xplat_utils_1.getJsonFromFile(tree, tsConfigPath); | ||
const tsConfig = (0, xplat_utils_1.getJsonFromFile)(tree, tsConfigPath); | ||
callback(tsConfig); | ||
return xplat_utils_1.updateJsonFile(tree, tsConfigPath, tsConfig); | ||
return (0, xplat_utils_1.updateJsonFile)(tree, tsConfigPath, tsConfig); | ||
} | ||
@@ -82,14 +82,14 @@ exports.updateTsConfig = updateTsConfig; | ||
const path = 'package.json'; | ||
const packageJson = xplat_utils_1.getJsonFromFile(tree, path); | ||
const packageJson = (0, xplat_utils_1.getJsonFromFile)(tree, path); | ||
const scriptsMap = Object.assign({}, packageJson.scripts); | ||
packageJson.scripts = Object.assign(scriptsMap, scripts); | ||
return xplat_utils_1.updateJsonFile(tree, path, packageJson); | ||
return (0, xplat_utils_1.updateJsonFile)(tree, path, packageJson); | ||
} | ||
exports.updatePackageScripts = updatePackageScripts; | ||
function readWorkspaceJson(tree) { | ||
return workspace_1.readJsonInTree(tree, workspace_1.getWorkspacePath(tree)); | ||
return (0, workspace_1.readJsonInTree)(tree, (0, workspace_1.getWorkspacePath)(tree)); | ||
} | ||
exports.readWorkspaceJson = readWorkspaceJson; | ||
function updateWorkspace(updates) { | ||
return workspace_1.updateWorkspaceInTree((json) => { | ||
return (0, workspace_1.updateWorkspaceInTree)((json) => { | ||
for (const key in updates) { | ||
@@ -118,4 +118,4 @@ json[key] = Object.assign(Object.assign({}, (json[key] || {})), updates[key]); | ||
utils: exports.stringUtils, | ||
npmScope: xplat_utils_1.getNpmScope(), | ||
prefix: xplat_utils_1.getPrefix(), | ||
npmScope: (0, xplat_utils_1.getNpmScope)(), | ||
prefix: (0, xplat_utils_1.getPrefix)(), | ||
dot: '.', | ||
@@ -122,0 +122,0 @@ }; |
@@ -9,3 +9,3 @@ "use strict"; | ||
if (config.requiresTarget && !options.target) { | ||
throw new schematics_1.SchematicsException(errors_1.helperTargetError(helper)); | ||
throw new schematics_1.SchematicsException((0, errors_1.helperTargetError)(helper)); | ||
} | ||
@@ -12,0 +12,0 @@ if (config.addHelperFiles) { |
@@ -16,5 +16,5 @@ "use strict"; | ||
const util_1 = require("util"); | ||
const fsExists = util_1.promisify(fs.exists); | ||
const fsWriteFile = util_1.promisify(fs.writeFile); | ||
const fsReadFile = util_1.promisify(fs.readFile); | ||
const fsExists = (0, util_1.promisify)(fs.exists); | ||
const fsWriteFile = (0, util_1.promisify)(fs.writeFile); | ||
const fsReadFile = (0, util_1.promisify)(fs.readFile); | ||
function updateConfig() { | ||
@@ -21,0 +21,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -356,5 +356,5 @@ "use strict"; | ||
exports.createNativeScriptAngularApp = createNativeScriptAngularApp; | ||
const isInModuleMetadata = (moduleName, property, value, inArray) => exports.isInDecoratorMetadata(moduleName, property, value, 'NgModule', inArray); | ||
const isInModuleMetadata = (moduleName, property, value, inArray) => (0, exports.isInDecoratorMetadata)(moduleName, property, value, 'NgModule', inArray); | ||
exports.isInModuleMetadata = isInModuleMetadata; | ||
const isInComponentMetadata = (componentName, property, value, inArray) => exports.isInDecoratorMetadata(componentName, property, value, 'Component', inArray); | ||
const isInComponentMetadata = (componentName, property, value, inArray) => (0, exports.isInDecoratorMetadata)(componentName, property, value, 'Component', inArray); | ||
exports.isInComponentMetadata = isInComponentMetadata; | ||
@@ -361,0 +361,0 @@ const isInDecoratorMetadata = (moduleName, property, value, decoratorName, inArray) => new RegExp(`@${decoratorName}\\(\\{([^}]*)` + |
@@ -6,4 +6,4 @@ "use strict"; | ||
const testing_1 = require("@angular-devkit/schematics/testing"); | ||
const testRunner = new testing_1.SchematicTestRunner('@nstudio/xplat', path_1.join(__dirname, '../../collection.json')); | ||
const migrationTestRunner = new testing_1.SchematicTestRunner('@nstudio/xplat/migrations', path_1.join(__dirname, '../../migrations.json')); | ||
const testRunner = new testing_1.SchematicTestRunner('@nstudio/xplat', (0, path_1.join)(__dirname, '../../collection.json')); | ||
const migrationTestRunner = new testing_1.SchematicTestRunner('@nstudio/xplat/migrations', (0, path_1.join)(__dirname, '../../migrations.json')); | ||
function runSchematic(schematicName, options, tree) { | ||
@@ -10,0 +10,0 @@ return testRunner.runSchematicAsync(schematicName, options, tree).toPromise(); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.nxVersion = exports.xplatVersion = void 0; | ||
exports.xplatVersion = '13.0.1'; | ||
exports.xplatVersion = '13.4.0'; | ||
exports.nxVersion = '^13.0.0'; |
@@ -46,10 +46,10 @@ "use strict"; | ||
return (host) => { | ||
const { dependencies, devDependencies } = workspace_1.readJsonInTree(host, 'package.json'); | ||
const { dependencies, devDependencies } = (0, workspace_1.readJsonInTree)(host, 'package.json'); | ||
return dependencies[packageName] || devDependencies[packageName] | ||
? callSchematicIfAdded | ||
? schematics_1.externalSchematic(packageName, callSchematicIfAdded, options, { | ||
? (0, schematics_1.externalSchematic)(packageName, callSchematicIfAdded, options, { | ||
interactive: false, | ||
}) | ||
: schematics_1.noop() | ||
: schematics_1.externalSchematic(packageName, 'ng-add', options, { | ||
: (0, schematics_1.noop)() | ||
: (0, schematics_1.externalSchematic)(packageName, 'ng-add', options, { | ||
interactive: false, | ||
@@ -69,6 +69,6 @@ }); | ||
else { | ||
const platformArgList = xplat_utils_1.sanitizeCommaDelimitedArg(platformArgument); | ||
const platformArgList = (0, xplat_utils_1.sanitizeCommaDelimitedArg)(platformArgument); | ||
if (platformArgList.length === 0) { | ||
if (required) { | ||
throw new Error(errors_1.noPlatformError()); | ||
throw new Error((0, errors_1.noPlatformError)()); | ||
} | ||
@@ -82,3 +82,3 @@ } | ||
else { | ||
throw new Error(errors_1.unsupportedPlatformError(platform)); | ||
throw new Error((0, errors_1.unsupportedPlatformError)(platform)); | ||
} | ||
@@ -97,3 +97,3 @@ } | ||
? xplat_utils_1.supportedFrameworks | ||
: xplat_utils_1.sanitizeCommaDelimitedArg(frameworkArgument))); | ||
: (0, xplat_utils_1.sanitizeCommaDelimitedArg)(frameworkArgument))); | ||
} | ||
@@ -110,3 +110,3 @@ XplatHelpers.getFrameworksFromOptions = getFrameworksFromOptions; | ||
const xplatSettings = { | ||
prefix: xplat_utils_1.getPrefix(), | ||
prefix: (0, xplat_utils_1.getPrefix)(), | ||
}; | ||
@@ -131,4 +131,4 @@ if (frameworkChoice && frameworks.length === 1) { | ||
function getPlatformName(name, platform) { | ||
const nameSanitized = workspace_1.toFileName(name); | ||
return xplat_utils_1.getGroupByName() | ||
const nameSanitized = (0, xplat_utils_1.toFileName)(name); | ||
return (0, xplat_utils_1.getGroupByName)() | ||
? `${nameSanitized}-${platform}` | ||
@@ -146,3 +146,3 @@ : `${platform}-${nameSanitized}`; | ||
function getXplatFoldername(platform, framework) { | ||
const frontendFramework = xplat_utils_1.getFrontendFramework(); | ||
const frontendFramework = (0, xplat_utils_1.getFrontendFramework)(); | ||
// console.log('getXplatFoldername frontendFramework:', frontendFramework); | ||
@@ -173,3 +173,3 @@ // console.log('framework:', framework); | ||
generatorSettings = { | ||
platforms: xplat_utils_1.sanitizeCommaDelimitedArg(options.platforms), | ||
platforms: (0, xplat_utils_1.sanitizeCommaDelimitedArg)(options.platforms), | ||
}; | ||
@@ -223,3 +223,3 @@ break; | ||
else { | ||
throw new schematics_1.SchematicsException(errors_1.unsupportedFrameworkError(framework)); | ||
throw new schematics_1.SchematicsException((0, errors_1.unsupportedFrameworkError)(framework)); | ||
} | ||
@@ -245,3 +245,3 @@ } | ||
else { | ||
throw new schematics_1.SchematicsException(errors_1.unsupportedPlatformError(platform)); | ||
throw new schematics_1.SchematicsException((0, errors_1.unsupportedPlatformError)(platform)); | ||
} | ||
@@ -254,3 +254,3 @@ } | ||
// check user's package for current version | ||
const packageJson = xplat_utils_1.getJsonFromFile(tree, 'package.json'); | ||
const packageJson = (0, xplat_utils_1.getJsonFromFile)(tree, 'package.json'); | ||
if (packageJson) { | ||
@@ -294,3 +294,3 @@ for (const packageName in devDependencies) { | ||
for (const packageName of packagesToRunXplat) { | ||
externalChains.push(schematics_1.externalSchematic(packageName, generator, options, { | ||
externalChains.push((0, schematics_1.externalSchematic)(packageName, generator, options, { | ||
interactive: false, | ||
@@ -317,3 +317,3 @@ })); | ||
let generatorSettings = { | ||
platforms: xplat_utils_1.sanitizeCommaDelimitedArg(options.platforms), | ||
platforms: (0, xplat_utils_1.sanitizeCommaDelimitedArg)(options.platforms), | ||
}; | ||
@@ -338,3 +338,3 @@ const platforms = generatorSettings.platforms; | ||
else { | ||
throw new schematics_1.SchematicsException(errors_1.unsupportedPlatformError(platform)); | ||
throw new schematics_1.SchematicsException((0, errors_1.unsupportedPlatformError)(platform)); | ||
} | ||
@@ -347,3 +347,3 @@ } | ||
// check user's package for current version | ||
const packageJson = xplat_utils_1.getJsonFromFile(tree, 'package.json'); | ||
const packageJson = (0, xplat_utils_1.getJsonFromFile)(tree, 'package.json'); | ||
if (packageJson) { | ||
@@ -386,3 +386,3 @@ for (const packageName in devDependencies) { | ||
if (xplatPlatforms) { | ||
externalChains.push(schematics_1.externalSchematic('@nstudio/xplat', 'app-generate', options, { | ||
externalChains.push((0, schematics_1.externalSchematic)('@nstudio/xplat', 'app-generate', options, { | ||
interactive: false, | ||
@@ -397,5 +397,5 @@ })); | ||
title: 'Note:', | ||
bodyLines: [errors_1.noXplatLayerNote(nxPlatform)], | ||
bodyLines: [(0, errors_1.noXplatLayerNote)(nxPlatform)], | ||
}); | ||
externalChains.push(schematics_1.externalSchematic(packageName, generator, Object.assign(Object.assign({}, options), { name, | ||
externalChains.push((0, schematics_1.externalSchematic)(packageName, generator, Object.assign(Object.assign({}, options), { name, | ||
directory }), { | ||
@@ -409,3 +409,3 @@ interactive: false, | ||
if (xplatPlatforms) { | ||
externalChains.push(schematics_1.externalSchematic('@nstudio/xplat', 'app-generate', options, { | ||
externalChains.push((0, schematics_1.externalSchematic)('@nstudio/xplat', 'app-generate', options, { | ||
interactive: true, | ||
@@ -424,3 +424,3 @@ })); | ||
title: 'Note:', | ||
bodyLines: [errors_1.noXplatLayerNote(nxPlatform)], | ||
bodyLines: [(0, errors_1.noXplatLayerNote)(nxPlatform)], | ||
}); | ||
@@ -443,3 +443,3 @@ context.addTask(new tasks_1.RunSchematicTask(packageName, generator, Object.assign(Object.assign({}, options), { name, | ||
// adjusted name, nothing else to do | ||
return schematics_1.noop()(tree, context); | ||
return (0, schematics_1.noop)()(tree, context); | ||
}; | ||
@@ -452,6 +452,6 @@ } | ||
if (options.directory) { | ||
directory = workspace_1.toFileName(options.directory); | ||
directory = (0, xplat_utils_1.toFileName)(options.directory); | ||
if (directory === platform && | ||
xplat_utils_1.supportedPlatformsWithNx.includes(directory)) { | ||
name = workspace_1.toFileName(options.name); | ||
name = (0, xplat_utils_1.toFileName)(options.name); | ||
} | ||
@@ -473,3 +473,3 @@ else { | ||
return (tree, context) => { | ||
if (!xplat_utils_1.getFrontendFramework() && framework) { | ||
if (!(0, xplat_utils_1.getFrontendFramework)() && framework) { | ||
directory = `${directory}-${framework}`; | ||
@@ -479,3 +479,3 @@ } | ||
// console.log(`externalSchematic('@nrwl/workspace', 'lib') ALREADY EXISTS for:`, `libs/${directory ? directory + '/' : ''}${libName}`) | ||
return schematics_1.noop()(tree, context); | ||
return (0, schematics_1.noop)()(tree, context); | ||
} | ||
@@ -492,3 +492,3 @@ const libOptions = { | ||
// console.log(`CALLING externalSchematic('@nrwl/workspace', 'lib') for:`, `libs/${directory ? directory + '/' : ''}${libName}`) | ||
return schematics_1.chain([schematics_1.externalSchematic('@nrwl/workspace', 'lib', libOptions)]); | ||
return (0, schematics_1.chain)([(0, schematics_1.externalSchematic)('@nrwl/workspace', 'lib', libOptions)]); | ||
}; | ||
@@ -499,3 +499,3 @@ } | ||
return (tree, context) => { | ||
if (!xplat_utils_1.getFrontendFramework() && framework) { | ||
if (!(0, xplat_utils_1.getFrontendFramework)() && framework) { | ||
directory = `${directory}-${framework}`; | ||
@@ -548,3 +548,3 @@ } | ||
if (needsTsConfigUpdate && tsConfig) { | ||
xplat_utils_1.updateJsonFile(tree, tsConfigPath, tsConfig); | ||
(0, xplat_utils_1.updateJsonFile)(tree, tsConfigPath, tsConfig); | ||
} | ||
@@ -557,6 +557,6 @@ return tree; | ||
return (tree, context) => { | ||
let frontendFramework = xplat_utils_1.getFrontendFramework(); | ||
let frontendFramework = (0, xplat_utils_1.getFrontendFramework)(); | ||
if (tree.exists(`libs/xplat/${platform}/${libName}/src/lib/index.ts`)) { | ||
// check if framework had been set | ||
frontendFramework = xplat_utils_1.getFrontendFramework(); | ||
frontendFramework = (0, xplat_utils_1.getFrontendFramework)(); | ||
// console.log('addPlatformFiles frontendFramework:', frontendFramework) | ||
@@ -570,6 +570,6 @@ // console.log('addPlatformFiles options.framework:', options.framework) | ||
// TODO: add schematic to reconfigure workspace to rename xplat folders to support full multi-framework setup | ||
throw new schematics_1.SchematicsException(errors_1.noteAboutXplatSetupWithFramework(frontendFramework, platform)); | ||
throw new schematics_1.SchematicsException((0, errors_1.noteAboutXplatSetupWithFramework)(frontendFramework, platform)); | ||
} | ||
// already added | ||
return schematics_1.noop(); | ||
return (0, schematics_1.noop)(); | ||
} | ||
@@ -581,8 +581,8 @@ const xplatFolderName = XplatHelpers.getXplatFoldername(platform, options.framework); | ||
tree.exists(`libs/xplat/${xplatFolderName}/${libFolder}/${checkExistingFile}`)) { | ||
return schematics_1.noop(); | ||
return (0, schematics_1.noop)(); | ||
} | ||
else { | ||
return schematics_1.branchAndMerge(schematics_1.mergeWith(schematics_1.apply(schematics_1.url(`./_files_${libName}`), [ | ||
schematics_1.template(Object.assign(Object.assign(Object.assign({}, options), general_1.getDefaultTemplateOptions()), { xplatFolderName })), | ||
schematics_1.move(`libs/xplat/${xplatFolderName}${libFolder}`), | ||
return (0, schematics_1.branchAndMerge)((0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)(`./_files_${libName}`), [ | ||
(0, schematics_1.template)(Object.assign(Object.assign(Object.assign({}, options), (0, general_1.getDefaultTemplateOptions)()), { xplatFolderName })), | ||
(0, schematics_1.move)(`libs/xplat/${xplatFolderName}${libFolder}`), | ||
]))); | ||
@@ -596,3 +596,3 @@ } | ||
const packagePath = 'package.json'; | ||
let packageJson = xplat_utils_1.getJsonFromFile(tree, packagePath); | ||
let packageJson = (0, xplat_utils_1.getJsonFromFile)(tree, packagePath); | ||
if (packageJson) { | ||
@@ -607,3 +607,3 @@ // could introduce xplat.json but trying to avoid too much extra overhead so just store in package.json for now | ||
// just update xplat workspace settings | ||
return xplat_utils_1.updateJsonFile(tree, packagePath, packageJson); | ||
return (0, xplat_utils_1.updateJsonFile)(tree, packagePath, packageJson); | ||
} | ||
@@ -614,3 +614,3 @@ else if (updates) { | ||
// console.log('updatePackageForXplat:', serializeJson(packageJson)); | ||
return xplat_utils_1.updateJsonFile(tree, packagePath, packageJson); | ||
return (0, xplat_utils_1.updateJsonFile)(tree, packagePath, packageJson); | ||
} | ||
@@ -648,3 +648,3 @@ } | ||
if (!options.name) { | ||
throw new Error(errors_1.generateOptionError('component')); | ||
throw new Error((0, errors_1.generateOptionError)('component')); | ||
} | ||
@@ -675,5 +675,5 @@ // reset module globals | ||
// building feature in shared code and in projects | ||
projectNames = xplat_utils_1.sanitizeCommaDelimitedArg(projects); | ||
projectNames = (0, xplat_utils_1.sanitizeCommaDelimitedArg)(projects); | ||
for (const fullProjectPath of projectNames) { | ||
const projectName = xplat_utils_1.parseProjectNameFromPath(fullProjectPath); | ||
const projectName = (0, xplat_utils_1.parseProjectNameFromPath)(fullProjectPath); | ||
const projectParts = projectName.split('-'); | ||
@@ -698,9 +698,9 @@ const platPrefix = projectParts[0]; | ||
// building feature in shared code only | ||
platforms = xplat_utils_1.sanitizeCommaDelimitedArg(options.platforms); | ||
platforms = (0, xplat_utils_1.sanitizeCommaDelimitedArg)(options.platforms); | ||
} | ||
if (platforms.length === 0) { | ||
let error = projects | ||
? errors_1.platformAppPrefixError() | ||
: errors_1.generatorError('component'); | ||
throw new Error(errors_1.optionsMissingError(error)); | ||
? (0, errors_1.platformAppPrefixError)() | ||
: (0, errors_1.generatorError)('component'); | ||
throw new Error((0, errors_1.optionsMissingError)(error)); | ||
} | ||
@@ -733,3 +733,3 @@ return { directory, featureName, projectNames, platforms }; | ||
else { | ||
platforms = xplat_utils_1.sanitizeCommaDelimitedArg(options.platforms); | ||
platforms = (0, xplat_utils_1.sanitizeCommaDelimitedArg)(options.platforms); | ||
const projectSandboxNames = []; | ||
@@ -754,5 +754,5 @@ // default to project with sandbox name | ||
// building feature in shared code and in projects | ||
projectNames = xplat_utils_1.sanitizeCommaDelimitedArg(projects); | ||
projectNames = (0, xplat_utils_1.sanitizeCommaDelimitedArg)(projects); | ||
for (const name of projectNames) { | ||
let projectName = xplat_utils_1.parseProjectNameFromPath(name); | ||
let projectName = (0, xplat_utils_1.parseProjectNameFromPath)(name); | ||
const projectParts = projectName.split('-'); | ||
@@ -775,9 +775,9 @@ const platPrefix = projectParts[0]; | ||
// building feature in shared code only | ||
platforms = xplat_utils_1.sanitizeCommaDelimitedArg(options.platforms); | ||
platforms = (0, xplat_utils_1.sanitizeCommaDelimitedArg)(options.platforms); | ||
} | ||
if (platforms.length === 0 && !options.onlyModule) { | ||
let error = projects | ||
? errors_1.platformAppPrefixError() | ||
: errors_1.generatorError('feature'); | ||
throw new schematics_1.SchematicsException(errors_1.optionsMissingError(error)); | ||
? (0, errors_1.platformAppPrefixError)() | ||
: (0, errors_1.generatorError)('feature'); | ||
throw new schematics_1.SchematicsException((0, errors_1.optionsMissingError)(error)); | ||
} | ||
@@ -803,5 +803,5 @@ return { featureName, projectNames, platforms }; | ||
// console.log('add files from:', `${workingDirectory}/${extra}_files`); | ||
return schematics_1.branchAndMerge(schematics_1.mergeWith(schematics_1.apply(schematics_1.url(`./${extra}_files`), [ | ||
schematics_1.template(getTemplateOptions(options, target, framework)), | ||
schematics_1.move(moveTo), | ||
return (0, schematics_1.branchAndMerge)((0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)(`./${extra}_files`), [ | ||
(0, schematics_1.template)(getTemplateOptions(options, target, framework)), | ||
(0, schematics_1.move)(moveTo), | ||
]))); | ||
@@ -815,5 +815,5 @@ } | ||
const indexSource = tree.read(indexFilePath).toString('utf-8'); | ||
const indexSourceFile = typescript_1.createSourceFile(indexFilePath, indexSource, typescript_1.ScriptTarget.Latest, true); | ||
ast_1.insert(tree, indexFilePath, [ | ||
...ast_1.addGlobal(indexSourceFile, indexFilePath, `export * from './${options.directory ? options.directory + '/' : ''}${options.name.toLowerCase()}';`, true), | ||
const indexSourceFile = (0, typescript_1.createSourceFile)(indexFilePath, indexSource, typescript_1.ScriptTarget.Latest, true); | ||
(0, ast_1.insert)(tree, indexFilePath, [ | ||
...(0, ast_1.addGlobal)(indexSourceFile, indexFilePath, `export * from './${options.directory ? options.directory + '/' : ''}${options.name.toLowerCase()}';`, true), | ||
]); | ||
@@ -838,3 +838,3 @@ return tree; | ||
} | ||
return Object.assign(Object.assign(Object.assign({}, options), general_1.getDefaultTemplateOptions()), { name: options.name.toLowerCase(), relativeDirectory, | ||
return Object.assign(Object.assign(Object.assign({}, options), (0, general_1.getDefaultTemplateOptions)()), { name: options.name.toLowerCase(), relativeDirectory, | ||
endingDashName, | ||
@@ -841,0 +841,0 @@ xplatFolderName }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
293506
+ Added@nstudio/focus@13.4.0(transitive)
+ Added@nstudio/xplat-utils@13.4.0(transitive)
- Removed@nstudio/focus@13.0.1(transitive)
- Removed@nstudio/xplat-utils@13.0.1(transitive)
Updated@nstudio/focus@13.4.0
Updated@nstudio/xplat-utils@13.4.0