diff --git a/core/app/engine/angular.json b/core/app/engine/angular.json index c6a59ba63..2f65a1a05 100644 --- a/core/app/engine/angular.json +++ b/core/app/engine/angular.json @@ -1,5 +1,5 @@ { - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "$schema": "../../../node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "projects": { @@ -23,7 +23,7 @@ ], "scripts": [], "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" ] }, @@ -72,7 +72,7 @@ "tsConfig": "src/tsconfig.spec.json", "karmaConfig": "src/karma.conf.js", "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" ], "scripts": [], @@ -135,4 +135,4 @@ "prefix": "app" } } -} \ No newline at end of file +} diff --git a/core/app/engine/tsconfig.json b/core/app/engine/tsconfig.json index 1586adc9a..b43aa7ff2 100644 --- a/core/app/engine/tsconfig.json +++ b/core/app/engine/tsconfig.json @@ -6,10 +6,10 @@ "types/*" ], "core-js/es7/reflect": [ - "node_modules/core-js/proposals/reflect-metadata" + "../../../node_modules/core-js/proposals/reflect-metadata" ], "core-js/es6/*": [ - "node_modules/core-js/es" + "../../../node_modules/core-js/es" ] }, "baseUrl": "./", @@ -23,7 +23,7 @@ "importHelpers": true, "target": "es2015", "typeRoots": [ - "node_modules/@types" + "../../../node_modules/@types" ], "lib": [ "es2018", diff --git a/core/modules/Administration/Cli/App/AppRebuildCommand.php b/core/modules/Administration/Cli/App/AppRebuildCommand.php index f7e8bcae6..cd03da973 100644 --- a/core/modules/Administration/Cli/App/AppRebuildCommand.php +++ b/core/modules/Administration/Cli/App/AppRebuildCommand.php @@ -51,7 +51,6 @@ class AppRebuildCommand extends SuiteCommand */ public function execute(InputInterface $input, OutputInterface $output) { - $filesToLeave = []; $optionValue = $input->getOption('hard'); $hardRebuild = ($optionValue !== false); @@ -67,10 +66,6 @@ class AppRebuildCommand extends SuiteCommand $this->file->makeDir($rebuildEnginePath, 0755); - if ($hardRebuild === false) { - $filesToLeave = [$rebuildEnginePath . '/node_modules']; - } - $appPath = BASE_PATH . 'core/app/'; $enginePath = $appPath . 'engine'; $themesPath = BASE_PATH . 'core/app/themes'; @@ -100,10 +95,14 @@ class AppRebuildCommand extends SuiteCommand // Delete ui stored files 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'); } + 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 $this->file->recurseCopy($enginePath, $rebuildEnginePath); @@ -323,10 +322,8 @@ EOT; if (file_put_contents($rebuildEnginePath . '/src/app/app-manifest/manifest.module.ts', $manifestModule)) { $appDir = getcwd(); - chdir($rebuildEnginePath); - // 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"; $npmCmd = 'npm update'; shell_exec($npmCmd); diff --git a/core/modules/Administration/Cli/App/AppThemeRebuildCommand.php b/core/modules/Administration/Cli/App/AppThemeRebuildCommand.php index 889c928fe..47344c2cb 100644 --- a/core/modules/Administration/Cli/App/AppThemeRebuildCommand.php +++ b/core/modules/Administration/Cli/App/AppThemeRebuildCommand.php @@ -51,7 +51,7 @@ class AppThemeRebuildCommand extends SuiteCommand chdir(BASE_PATH . '/cache/app/engine/'); 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/'; diff --git a/core/app/engine/package-lock.json b/package-lock.json similarity index 99% rename from core/app/engine/package-lock.json rename to package-lock.json index b2e52aed2..992094a88 100644 --- a/core/app/engine/package-lock.json +++ b/package-lock.json @@ -1088,9 +1088,9 @@ } }, "@types/chart.js": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/@types/chart.js/-/chart.js-2.9.3.tgz", - "integrity": "sha512-R5F39GIQ54fZJ04pmgbLrx0/dOEhyS8LRQNdlAmZd5zWZiFJ0v9zNNSBJ9WOTBRrMjeV53s0qhnRRvhcs6dfyQ==" + "version": "2.9.7", + "resolved": "https://registry.npmjs.org/@types/chart.js/-/chart.js-2.9.7.tgz", + "integrity": "sha512-T+oRIWLPu6cXWYSTwihkeZLKk5V4U4O09Uqx4padQto1XVH7YafX4Z4YV1OIWnKbkqMn/4Cuj9ZwWcG6fnKK3A==" }, "@types/jasmine": { "version": "3.5.0", @@ -1108,9 +1108,9 @@ } }, "@types/node": { - "version": "10.17.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.6.tgz", - "integrity": "sha512-0a2X6cgN3RdPBL2MIlR6Lt0KlM7fOFsutuXcdglcOq6WvLnYXgPQSh0Mx6tO1KCAE8MxbHSOSTWDoUxRq+l3DA==" + "version": "10.17.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.11.tgz", + "integrity": "sha512-dNd2pp8qTzzNLAs3O8nH3iU9DG9866KHq9L3ISPB7DOGERZN81nW/5/g/KzMJpCU8jrbCiMRBzV9/sCEdRosig==" }, "@types/object-hash": { "version": "1.3.0", @@ -3045,9 +3045,9 @@ } }, "core-js": { - "version": "3.4.7", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.4.7.tgz", - "integrity": "sha512-qaPVGw30J1wQ0GR3GvoPqlGf9GZfKKF4kFC7kiHlcsPTqH3txrs9crCp3ZiMAXuSenhz89Jnl4GZs/67S5VOSg==" + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.0.tgz", + "integrity": "sha512-AHPTNKzyB+YwgDWoSOCaid9PUSEF6781vsfiK8qUz62zRR448/XgK2NtCbpiUGizbep8Lrpt0Du19PpGGZvw3Q==" }, "core-util-is": { "version": "1.0.2", diff --git a/core/app/engine/package.json b/package.json similarity index 94% rename from core/app/engine/package.json rename to package.json index 5b18b8db5..f2156292d 100644 --- a/core/app/engine/package.json +++ b/package.json @@ -23,18 +23,18 @@ "@angular/platform-browser-dynamic": "^7.2.2", "@angular/router": "^7.2.2", "@ng-bootstrap/ng-bootstrap": "^4.2.2", - "bootstrap-css-only": "^4.3.1", "@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", "chartjs-plugin-annotation": "^0.5.7", - "core-js": "^3.4.5", + "core-js": "^3.6.0", "ng2-charts": "^2.2.3", + "nyc": "~14.1.1", "object-hash": "^1.3.1", "rxjs": "^6.3.3", "tslib": "^1.9.3", - "zone.js": "~0.8.26", - "ajv": "~6.9.1" + "zone.js": "~0.8.26" }, "devDependencies": { "@angular-devkit/build-angular": "0.12.4", @@ -43,7 +43,7 @@ "@angular/language-service": "^7.2.2", "@types/jasmine": "^3.3.7", "@types/jasminewd2": "^2.0.6", - "@types/node": "^10.12.18", + "@types/node": "^10.17.11", "codelyzer": "^4.5.0", "jasmine-core": "~3.3.0", "jasmine-spec-reporter": "^4.2.1",