Add Node_modules to the root project directory

This commit is contained in:
Matt Lorimer 2019-12-19 16:50:08 +00:00 committed by Dillon-Brown
parent 3b8ea00969
commit 8338cae4d1
6 changed files with 29 additions and 32 deletions

View file

@ -1,5 +1,5 @@
{ {
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", "$schema": "../../../node_modules/@angular/cli/lib/config/schema.json",
"version": 1, "version": 1,
"newProjectRoot": "projects", "newProjectRoot": "projects",
"projects": { "projects": {
@ -23,7 +23,7 @@
], ],
"scripts": [], "scripts": [],
"styles": [ "styles": [
"node_modules/bootstrap-css-only/css/bootstrap.min.css", "../../../node_modules/bootstrap-css-only/css/bootstrap.min.css",
"src/assets/themes/suite8/css/style.min.css" "src/assets/themes/suite8/css/style.min.css"
] ]
}, },
@ -72,7 +72,7 @@
"tsConfig": "src/tsconfig.spec.json", "tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js", "karmaConfig": "src/karma.conf.js",
"styles": [ "styles": [
"node_modules/bootstrap-css-only/css/bootstrap.min.css", "../../../node_modules/bootstrap-css-only/css/bootstrap.min.css",
"themes/suite8/css/style.min.css" "themes/suite8/css/style.min.css"
], ],
"scripts": [], "scripts": [],
@ -135,4 +135,4 @@
"prefix": "app" "prefix": "app"
} }
} }
} }

View file

@ -6,10 +6,10 @@
"types/*" "types/*"
], ],
"core-js/es7/reflect": [ "core-js/es7/reflect": [
"node_modules/core-js/proposals/reflect-metadata" "../../../node_modules/core-js/proposals/reflect-metadata"
], ],
"core-js/es6/*": [ "core-js/es6/*": [
"node_modules/core-js/es" "../../../node_modules/core-js/es"
] ]
}, },
"baseUrl": "./", "baseUrl": "./",
@ -23,7 +23,7 @@
"importHelpers": true, "importHelpers": true,
"target": "es2015", "target": "es2015",
"typeRoots": [ "typeRoots": [
"node_modules/@types" "../../../node_modules/@types"
], ],
"lib": [ "lib": [
"es2018", "es2018",

View file

@ -51,7 +51,6 @@ class AppRebuildCommand extends SuiteCommand
*/ */
public function execute(InputInterface $input, OutputInterface $output) public function execute(InputInterface $input, OutputInterface $output)
{ {
$filesToLeave = [];
$optionValue = $input->getOption('hard'); $optionValue = $input->getOption('hard');
$hardRebuild = ($optionValue !== false); $hardRebuild = ($optionValue !== false);
@ -67,10 +66,6 @@ class AppRebuildCommand extends SuiteCommand
$this->file->makeDir($rebuildEnginePath, 0755); $this->file->makeDir($rebuildEnginePath, 0755);
if ($hardRebuild === false) {
$filesToLeave = [$rebuildEnginePath . '/node_modules'];
}
$appPath = BASE_PATH . 'core/app/'; $appPath = BASE_PATH . 'core/app/';
$enginePath = $appPath . 'engine'; $enginePath = $appPath . 'engine';
$themesPath = BASE_PATH . 'core/app/themes'; $themesPath = BASE_PATH . 'core/app/themes';
@ -100,10 +95,14 @@ class AppRebuildCommand extends SuiteCommand
// Delete ui stored files // Delete ui stored files
chmod($rebuildPath, 0755); chmod($rebuildPath, 0755);
if (!$this->file->deleteDirectory($rebuildEnginePath, $filesToLeave)) { if (!$this->file->deleteDirectory($rebuildEnginePath)) {
throw new \RuntimeException('System can\'t delete cached application engine files'); throw new \RuntimeException('System can\'t delete cached application engine files');
} }
if ($hardRebuild && !$this->file->deleteDirectory(BASE_PATH . '/node_modules')) {
throw new \RuntimeException('System can\'t delete node_modules');
}
// Copy all engine files to rebuild path // Copy all engine files to rebuild path
$this->file->recurseCopy($enginePath, $rebuildEnginePath); $this->file->recurseCopy($enginePath, $rebuildEnginePath);
@ -323,10 +322,8 @@ EOT;
if (file_put_contents($rebuildEnginePath . '/src/app/app-manifest/manifest.module.ts', $manifestModule)) { if (file_put_contents($rebuildEnginePath . '/src/app/app-manifest/manifest.module.ts', $manifestModule)) {
$appDir = getcwd(); $appDir = getcwd();
chdir($rebuildEnginePath);
// If node_modules isn't present of --hard was option - run npm install // If node_modules isn't present of --hard was option - run npm install
if (!file_exists($rebuildEnginePath . '/node_modules')) { if (!file_exists( BASE_PATH . '/node_modules')) {
echo "Updating npm...\n\n"; echo "Updating npm...\n\n";
$npmCmd = 'npm update'; $npmCmd = 'npm update';
shell_exec($npmCmd); shell_exec($npmCmd);

View file

@ -51,7 +51,7 @@ class AppThemeRebuildCommand extends SuiteCommand
chdir(BASE_PATH . '/cache/app/engine/'); chdir(BASE_PATH . '/cache/app/engine/');
shell_exec( shell_exec(
"./node_modules/.bin/node-sass $watchCompiler --output-style compressed src/assets/themes/suite8/css/style.scss > src/assets/themes/suite8/css/style.min.css" "../../../node_modules/.bin/node-sass $watchCompiler --output-style compressed src/assets/themes/suite8/css/style.scss > src/assets/themes/suite8/css/style.min.css"
); );
$compiledThemeDir = 'src/assets/themes/*/css/'; $compiledThemeDir = 'src/assets/themes/*/css/';

View file

@ -1088,9 +1088,9 @@
} }
}, },
"@types/chart.js": { "@types/chart.js": {
"version": "2.9.3", "version": "2.9.7",
"resolved": "https://registry.npmjs.org/@types/chart.js/-/chart.js-2.9.3.tgz", "resolved": "https://registry.npmjs.org/@types/chart.js/-/chart.js-2.9.7.tgz",
"integrity": "sha512-R5F39GIQ54fZJ04pmgbLrx0/dOEhyS8LRQNdlAmZd5zWZiFJ0v9zNNSBJ9WOTBRrMjeV53s0qhnRRvhcs6dfyQ==" "integrity": "sha512-T+oRIWLPu6cXWYSTwihkeZLKk5V4U4O09Uqx4padQto1XVH7YafX4Z4YV1OIWnKbkqMn/4Cuj9ZwWcG6fnKK3A=="
}, },
"@types/jasmine": { "@types/jasmine": {
"version": "3.5.0", "version": "3.5.0",
@ -1108,9 +1108,9 @@
} }
}, },
"@types/node": { "@types/node": {
"version": "10.17.6", "version": "10.17.11",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.6.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.11.tgz",
"integrity": "sha512-0a2X6cgN3RdPBL2MIlR6Lt0KlM7fOFsutuXcdglcOq6WvLnYXgPQSh0Mx6tO1KCAE8MxbHSOSTWDoUxRq+l3DA==" "integrity": "sha512-dNd2pp8qTzzNLAs3O8nH3iU9DG9866KHq9L3ISPB7DOGERZN81nW/5/g/KzMJpCU8jrbCiMRBzV9/sCEdRosig=="
}, },
"@types/object-hash": { "@types/object-hash": {
"version": "1.3.0", "version": "1.3.0",
@ -3045,9 +3045,9 @@
} }
}, },
"core-js": { "core-js": {
"version": "3.4.7", "version": "3.6.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.4.7.tgz", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.0.tgz",
"integrity": "sha512-qaPVGw30J1wQ0GR3GvoPqlGf9GZfKKF4kFC7kiHlcsPTqH3txrs9crCp3ZiMAXuSenhz89Jnl4GZs/67S5VOSg==" "integrity": "sha512-AHPTNKzyB+YwgDWoSOCaid9PUSEF6781vsfiK8qUz62zRR448/XgK2NtCbpiUGizbep8Lrpt0Du19PpGGZvw3Q=="
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",

View file

@ -23,18 +23,18 @@
"@angular/platform-browser-dynamic": "^7.2.2", "@angular/platform-browser-dynamic": "^7.2.2",
"@angular/router": "^7.2.2", "@angular/router": "^7.2.2",
"@ng-bootstrap/ng-bootstrap": "^4.2.2", "@ng-bootstrap/ng-bootstrap": "^4.2.2",
"bootstrap-css-only": "^4.3.1",
"@types/object-hash": "^1.3.0", "@types/object-hash": "^1.3.0",
"nyc": "~14.1.1", "ajv": "~6.9.1",
"bootstrap-css-only": "^4.3.1",
"chart.js": "^2.8.0", "chart.js": "^2.8.0",
"chartjs-plugin-annotation": "^0.5.7", "chartjs-plugin-annotation": "^0.5.7",
"core-js": "^3.4.5", "core-js": "^3.6.0",
"ng2-charts": "^2.2.3", "ng2-charts": "^2.2.3",
"nyc": "~14.1.1",
"object-hash": "^1.3.1", "object-hash": "^1.3.1",
"rxjs": "^6.3.3", "rxjs": "^6.3.3",
"tslib": "^1.9.3", "tslib": "^1.9.3",
"zone.js": "~0.8.26", "zone.js": "~0.8.26"
"ajv": "~6.9.1"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "0.12.4", "@angular-devkit/build-angular": "0.12.4",
@ -43,7 +43,7 @@
"@angular/language-service": "^7.2.2", "@angular/language-service": "^7.2.2",
"@types/jasmine": "^3.3.7", "@types/jasmine": "^3.3.7",
"@types/jasminewd2": "^2.0.6", "@types/jasminewd2": "^2.0.6",
"@types/node": "^10.12.18", "@types/node": "^10.17.11",
"codelyzer": "^4.5.0", "codelyzer": "^4.5.0",
"jasmine-core": "~3.3.0", "jasmine-core": "~3.3.0",
"jasmine-spec-reporter": "^4.2.1", "jasmine-spec-reporter": "^4.2.1",