Browse Source

Fix/ng template bugs (#13361)

* update feature management project references

* remove logo customization from app nolayers angular styles

* add script for copy abp packages to templates' node_modules folder

* remove logo customization from app template's style
pull/13362/head
Muhammed Altuğ 4 years ago
committed by GitHub
parent
commit
90a50a7bc2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      modules/openiddict/app/OpenIddict.Demo.Server/OpenIddict.Demo.Server.csproj
  2. 82
      npm/ng-packs/scripts/copy-packages-to-templates.ts
  3. 3
      npm/ng-packs/scripts/package.json
  4. 6
      templates/app-nolayers/angular/src/styles.scss
  5. 8
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyCompanyName.MyProjectName.Blazor.Server.Mongo.csproj
  6. 8
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj
  7. 6
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/MyCompanyName.MyProjectName.Host.Mongo.csproj
  8. 6
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/MyCompanyName.MyProjectName.Host.csproj
  9. 8
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/MyCompanyName.MyProjectName.Mvc.Mongo.csproj
  10. 8
      templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyCompanyName.MyProjectName.Mvc.csproj
  11. 6
      templates/app/angular/src/styles.scss

8
modules/openiddict/app/OpenIddict.Demo.Server/OpenIddict.Demo.Server.csproj

@ -40,10 +40,10 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.Application\Volo.Abp.Featuremanagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.EntityFrameworkCore\Volo.Abp.Featuremanagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.HttpApi\Volo.Abp.Featuremanagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.Web\Volo.Abp.Featuremanagement.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Application\Volo.Abp.FeatureManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.EntityFrameworkCore\Volo.Abp.FeatureManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.HttpApi\Volo.Abp.FeatureManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Web\Volo.Abp.FeatureManagement.Web.csproj" />
</ItemGroup>
<ItemGroup>

82
npm/ng-packs/scripts/copy-packages-to-templates.ts

@ -0,0 +1,82 @@
import execa from 'execa';
import fse from 'fs-extra';
import fs from 'fs';
const templates = ['app', 'app-nolayers', 'module'];
const packageMap = {
account: 'ng.account',
'account-core': 'ng.account.core',
components: 'ng.components',
core: 'ng.core',
'feature-management': 'ng.feature-management',
identity: 'ng.identity',
'permission-management': 'ng.permission-management',
'setting-management': 'ng.setting-management',
'tenant-management': 'ng.tenant-management',
'theme-basic': 'ng.theme.basic',
'theme-shared': 'ng.theme.shared',
};
(async () => {
await execa('yarn', ['build'], {
stdout: 'inherit',
});
await installPackages();
await removeAbpPackages();
await copyBuildedPackagesFromDistFolder();
})();
async function runEachTemplate(
handler: (template: string, templatePath?: string) => void | Promise<any>,
) {
for (var template of templates) {
const templatePath = `../../../templates/${template}/angular`;
const result = handler(template, templatePath);
result instanceof Promise ? await result : result;
}
}
async function installPackages() {
await runEachTemplate(async (template, templatePath) => {
if (fse.existsSync(`${templatePath}/yarn.lock`)) {
fse.removeSync(`${templatePath}/yarn.lock`);
}
await execa('yarn', ['install', '--ignore-scripts'], {
stdout: 'inherit',
cwd: templatePath,
});
});
}
async function removeAbpPackages() {
await runEachTemplate(async (template, templatePath) => {
Object.values(packageMap).forEach(value => {
const path = `${templatePath}/node_modules/@abp/${value}`;
if (fs.existsSync(path)) {
fse.removeSync(path);
}
});
if (fs.existsSync(`${templatePath}/.angular`)) {
fse.removeSync(`${templatePath}/.angular`);
}
});
}
function createFolderIfNotExists(destination: string) {
destination.split('/').reduce((acc, dir) => {
if (!fs.existsSync(acc)) {
fs.mkdirSync(acc);
}
return `${acc}/${dir}`;
});
}
async function copyBuildedPackagesFromDistFolder() {
await runEachTemplate(async (template, templatePath) => {
Object.entries(packageMap).forEach(([key, value]) => {
createFolderIfNotExists(`${templatePath}/node_modules/@abp/${value}`);
fse.copySync(`../dist/packages/${key}/`, `${templatePath}/node_modules/@abp/${value}`);
});
});
}

3
npm/ng-packs/scripts/package.json

@ -8,7 +8,8 @@
"build:prod": "ts-node -r tsconfig-paths/register prod-build.ts",
"build:schematics": "ts-node -r tsconfig-paths/register build-schematics.ts",
"publish-packages": "ts-node -r tsconfig-paths/register publish.ts",
"replace-with-tilde": "ts-node -r tsconfig-paths/register replace-with-tilde.ts"
"replace-with-tilde": "ts-node -r tsconfig-paths/register replace-with-tilde.ts",
"copy-to-templates": "ts-node -r tsconfig-paths/register copy-packages-to-templates.ts"
},
"author": "",
"dependencies": {

6
templates/app-nolayers/angular/src/styles.scss

@ -24,9 +24,3 @@
transform: translate(-50%, -50%);
}
}
:root {
--lpx-logo: url('/assets/images/logo.png');
--lpx-logo-icon: url('/assets/images/logo-icon.png');
--lpx-brand: #edae53;
}

8
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/MyCompanyName.MyProjectName.Blazor.Server.Mongo.csproj

@ -63,10 +63,10 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.Application\Volo.Abp.Featuremanagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.MongoDB\Volo.Abp.Featuremanagement.MongoDB.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.HttpApi\Volo.Abp.Featuremanagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.Blazor.Server\Volo.Abp.Featuremanagement.Blazor.Server.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Application\Volo.Abp.FeatureManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.MongoDB\Volo.Abp.FeatureManagement.MongoDB.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.HttpApi\Volo.Abp.FeatureManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Blazor.Server\Volo.Abp.FeatureManagement.Blazor.Server.csproj" />
</ItemGroup>
<ItemGroup>

8
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/MyCompanyName.MyProjectName.Blazor.Server.csproj

@ -64,10 +64,10 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.Application\Volo.Abp.Featuremanagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.EntityFrameworkCore\Volo.Abp.Featuremanagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.HttpApi\Volo.Abp.Featuremanagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.Blazor.Server\Volo.Abp.Featuremanagement.Blazor.Server.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Application\Volo.Abp.FeatureManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.EntityFrameworkCore\Volo.Abp.FeatureManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.HttpApi\Volo.Abp.FeatureManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Blazor.Server\Volo.Abp.FeatureManagement.Blazor.Server.csproj" />
</ItemGroup>
<ItemGroup>

6
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/MyCompanyName.MyProjectName.Host.Mongo.csproj

@ -48,9 +48,9 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.Application\Volo.Abp.Featuremanagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.MongoDB\Volo.Abp.Featuremanagement.MongoDB.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.HttpApi\Volo.Abp.Featuremanagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Application\Volo.Abp.FeatureManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.MongoDB\Volo.Abp.FeatureManagement.MongoDB.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.HttpApi\Volo.Abp.FeatureManagement.HttpApi.csproj" />
</ItemGroup>
<ItemGroup>

6
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/MyCompanyName.MyProjectName.Host.csproj

@ -49,9 +49,9 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.Application\Volo.Abp.Featuremanagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.EntityFrameworkCore\Volo.Abp.Featuremanagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.HttpApi\Volo.Abp.Featuremanagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Application\Volo.Abp.FeatureManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.EntityFrameworkCore\Volo.Abp.FeatureManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.HttpApi\Volo.Abp.FeatureManagement.HttpApi.csproj" />
</ItemGroup>
<ItemGroup>

8
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/MyCompanyName.MyProjectName.Mvc.Mongo.csproj

@ -58,10 +58,10 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.Application\Volo.Abp.Featuremanagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.MongoDB\Volo.Abp.Featuremanagement.MongoDB.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.HttpApi\Volo.Abp.Featuremanagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.Web\Volo.Abp.Featuremanagement.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Application\Volo.Abp.FeatureManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.MongoDB\Volo.Abp.FeatureManagement.MongoDB.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.HttpApi\Volo.Abp.FeatureManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Web\Volo.Abp.FeatureManagement.Web.csproj" />
</ItemGroup>
<ItemGroup>

8
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyCompanyName.MyProjectName.Mvc.csproj

@ -59,10 +59,10 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.Application\Volo.Abp.Featuremanagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.EntityFrameworkCore\Volo.Abp.Featuremanagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.HttpApi\Volo.Abp.Featuremanagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.Featuremanagement.Web\Volo.Abp.Featuremanagement.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Application\Volo.Abp.FeatureManagement.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.EntityFrameworkCore\Volo.Abp.FeatureManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.HttpApi\Volo.Abp.FeatureManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\feature-management\src\Volo.Abp.FeatureManagement.Web\Volo.Abp.FeatureManagement.Web.csproj" />
</ItemGroup>
<ItemGroup>

6
templates/app/angular/src/styles.scss

@ -24,9 +24,3 @@
transform: translate(-50%, -50%);
}
}
:root {
--lpx-logo: url('/assets/images/logo.png');
--lpx-logo-icon: url('/assets/images/logo-icon.png');
--lpx-brand: #edae53;
}
Loading…
Cancel
Save