Skip to content

Commit

Permalink
feat(core): #6 support for SVP
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Apr 29, 2021
1 parent b28ee64 commit 4bbe390
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 18 deletions.
21 changes: 10 additions & 11 deletions packages/core/src/generators/init/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@ import {
Tree,
writeJson,
} from '@nrwl/devkit';
import { CONFIG_FILE_PATH, NxDotnetConfig } from '@nx-dotnet/utils';

export default async function (host: Tree) {
const initialized = host.isFile('nx-dotnet.config.js');
if (initialized) {
return;
}
const initialized = host.isFile(CONFIG_FILE_PATH);

host.write(
'nx-dotnet.config.js',
`
module.exports = {
let configObject: NxDotnetConfig = initialized
? readJson(host, CONFIG_FILE_PATH)
: {
nugetPackages: {},
};

}
`
);
configObject.nugetPackages = configObject.nugetPackages || {};

host.write(CONFIG_FILE_PATH, JSON.stringify(configObject, null, 2));

updateNxJson(host);
updateGitIgnore(host);
Expand Down
1 change: 1 addition & 0 deletions packages/utils/src/lib/constants/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './paths';
1 change: 1 addition & 0 deletions packages/utils/src/lib/constants/paths.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const CONFIG_FILE_PATH = '.nx-dotnet.rc.json';
8 changes: 2 additions & 6 deletions packages/utils/src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
export * from './args';
export * from './executors';
export * from './glob';
export * from './parameters';
export * from './rimraf';
export * from './workspace';
export * from './constants';
export * from './models';
export * from './utility-functions';
1 change: 1 addition & 0 deletions packages/utils/src/lib/models/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './cmd-line-parameter';
export * from './nx-dotnet-config.interface';
8 changes: 8 additions & 0 deletions packages/utils/src/lib/models/nx-dotnet-config.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export interface NxDotnetConfig {
/**
* Map of package -> version, used for Single Version Principle.
*/
nugetPackages: {
[key: string]: string;
};
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions packages/utils/src/lib/utility-functions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export * from './args';
export * from './executors';
export * from './glob';
export * from './parameters';
export * from './rimraf';
export * from './workspace';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cmdLineParameter } from './models';
import { cmdLineParameter } from '../models';

/**
* Transforms an array of cmdLineParameter into a string.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4bbe390

Please sign in to comment.