Skip to content

Commit 8e60a13

Browse files
author
Craigory V Coppola
committed
feat(core): support for single version principle #6 (#32)
* feat(core): #6 schematic to sync nuget packages across workspace
1 parent 1620667 commit 8e60a13

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+581
-259
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: "[BUG] "
4+
title: '[BUG] '
55
labels: bug, needs-triage
66
assignees: ''
7-
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,9 +24,10 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Environment:**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
27+
28+
- OS: [e.g. iOS]
29+
- Browser [e.g. chrome, safari]
30+
- Version [e.g. 22]
3031
- Affected Packages
3132

3233
**Additional context**

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: "[Feature]"
4+
title: '[Feature]'
55
labels: enhancement, needs-triage
66
assignees: ''
7-
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ env:
1010
NX_RUN_GROUP: ${{ github.run_id }}
1111

1212
jobs:
13-
1413
build:
1514
runs-on: ubuntu-latest
1615
name: Building affected apps

.prettierrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"singleQuote": true
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"arrowParens": "always"
35
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"cSpell.words": [
3+
"NXDOTNET",
34
"bahmutov",
45
"chockidar",
56
"classlib",
7+
"devkit",
68
"nologo",
79
"nuget",
10+
"nunit",
811
"webapi",
912
"writefile"
1013
],

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# [0.3.0](https://github.com/nx-dotnet/nx-dotnet/compare/v0.2.1...v0.3.0) (2021-04-28)
22

3-
43
### Bug Fixes
54

65
* **core:** [#20](https://github.com/nx-dotnet/nx-dotnet/issues/20) test template arg cannot be passed from command line ([e9e47e0](https://github.com/nx-dotnet/nx-dotnet/commit/e9e47e01e227f458cef41c3511bba69032dcf449))

e2e/core-e2e/tests/nx-dotnet.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ describe('nx-dotnet e2e', () => {
1212
ensureNxProject('@nx-dotnet/core', 'dist/packages/core');
1313

1414
await runNxCommandAsync(
15-
`generate @nx-dotnet/core:app ${testApp} --language="C#" --template="webapi"`
15+
`generate @nx-dotnet/core:app ${testApp} --language="C#" --template="webapi"`,
1616
);
1717

1818
await runNxCommandAsync(
19-
`generate @nx-dotnet/core:lib ${testLib} --language="C#" --template="classlib"`
19+
`generate @nx-dotnet/core:lib ${testLib} --language="C#" --template="classlib"`,
2020
);
2121

2222
const output = await runNxCommandAsync(
23-
`generate @nx-dotnet/core:project-reference ${testApp} ${testLib}`
23+
`generate @nx-dotnet/core:project-reference ${testApp} ${testLib}`,
2424
);
2525

2626
expect(output.stdout).toMatch(/Reference .* added to the project/);
@@ -32,7 +32,7 @@ describe('nx-dotnet e2e', () => {
3232
it('should obey dry-run', async () => {
3333
const app = uniq('app');
3434
await runNxCommandAsync(
35-
`generate @nx-dotnet/core:app ${app} --language="C#" --template="webapi" --dry-run`
35+
`generate @nx-dotnet/core:app ${app} --language="C#" --template="webapi" --dry-run`,
3636
);
3737

3838
let exists = true;
@@ -48,7 +48,7 @@ describe('nx-dotnet e2e', () => {
4848
it('should generate an app', async () => {
4949
const app = uniq('app');
5050
await runNxCommandAsync(
51-
`generate @nx-dotnet/core:app ${app} --language="C#" --template="webapi"`
51+
`generate @nx-dotnet/core:app ${app} --language="C#" --template="webapi"`,
5252
);
5353

5454
let exists = true;
@@ -66,7 +66,7 @@ describe('nx-dotnet e2e', () => {
6666
it('should obey dry-run', async () => {
6767
const lib = uniq('lib');
6868
await runNxCommandAsync(
69-
`generate @nx-dotnet/core:lib ${lib} --language="C#" --template="webapi" --dry-run`
69+
`generate @nx-dotnet/core:lib ${lib} --language="C#" --template="webapi" --dry-run`,
7070
);
7171

7272
let exists = true;
@@ -82,7 +82,7 @@ describe('nx-dotnet e2e', () => {
8282
it('should generate an lib', async () => {
8383
const lib = uniq('lib');
8484
await runNxCommandAsync(
85-
`generate @nx-dotnet/core:lib ${lib} --language="C#" --template="webapi"`
85+
`generate @nx-dotnet/core:lib ${lib} --language="C#" --template="webapi"`,
8686
);
8787

8888
let exists = true;

e2e/utils/index.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function workspaceConfigName() {
4242
}
4343

4444
export function updateWorkspaceConfig(
45-
callback: (json: { [key: string]: any }) => Object
45+
callback: (json: { [key: string]: any }) => Object,
4646
) {
4747
const file = workspaceConfigName();
4848
updateFile(file, JSON.stringify(callback(readJson(file)), null, 2));
@@ -66,7 +66,7 @@ export function runCreateWorkspace(
6666
packageManager?: 'npm' | 'yarn' | 'pnpm';
6767
cli?: string;
6868
extraArgs?: string;
69-
}
69+
},
7070
) {
7171
projName = name;
7272

@@ -197,7 +197,7 @@ export function runCommandAsync(
197197
opts: RunCmdOpts = {
198198
silenceError: false,
199199
env: process.env,
200-
}
200+
},
201201
): Promise<{ stdout: string; stderr: string; combinedOutput: string }> {
202202
return new Promise((resolve, reject) => {
203203
exec(
@@ -211,15 +211,15 @@ export function runCommandAsync(
211211
reject(err);
212212
}
213213
resolve({ stdout, stderr, combinedOutput: `${stdout}${stderr}` });
214-
}
214+
},
215215
);
216216
});
217217
}
218218

219219
export function runCommandUntil(
220220
command: string,
221221
criteria: (output: string) => boolean,
222-
{ kill = true } = {}
222+
{ kill = true } = {},
223223
): Promise<{ process: ChildProcess }> {
224224
const pm = getPackageManagerCommand();
225225
const p = exec(`${pm.runNx} ${command}`, {
@@ -259,12 +259,12 @@ export function runCLIAsync(
259259
silenceError: false,
260260
env: process.env,
261261
silent: false,
262-
}
262+
},
263263
): Promise<{ stdout: string; stderr: string; combinedOutput: string }> {
264264
const pm = getPackageManagerCommand();
265265
return runCommandAsync(
266266
`${opts.silent ? pm.runNxSilent : pm.runNx} ${command}`,
267-
opts
267+
opts,
268268
);
269269
}
270270

@@ -274,7 +274,7 @@ export function runNgAdd(
274274
silenceError: false,
275275
env: process.env,
276276
cwd: tmpProjPath(),
277-
}
277+
},
278278
): string {
279279
try {
280280
packageInstall('@nrwl/workspace');
@@ -283,12 +283,12 @@ export function runNgAdd(
283283
{
284284
cwd: tmpProjPath(),
285285
env: opts.env as any,
286-
}
286+
},
287287
)
288288
.toString()
289289
.replace(
290290
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
291-
''
291+
'',
292292
);
293293
} catch (e) {
294294
if (opts.silenceError) {
@@ -305,7 +305,7 @@ export function runCLI(
305305
opts: RunCmdOpts = {
306306
silenceError: false,
307307
env: process.env,
308-
}
308+
},
309309
): string {
310310
try {
311311
const pm = getPackageManagerCommand();
@@ -315,7 +315,7 @@ export function runCLI(
315315
}).toString();
316316
r = r.replace(
317317
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
318-
''
318+
'',
319319
);
320320
if (process.env.VERBOSE_OUTPUT) {
321321
console.log(r);
@@ -402,15 +402,15 @@ export function createFile(f: string, content: string = ''): void {
402402

403403
export function updateFile(
404404
f: string,
405-
content: string | ((content: string) => string)
405+
content: string | ((content: string) => string),
406406
): void {
407407
ensureDirSync(path.dirname(tmpProjPath(f)));
408408
if (typeof content === 'string') {
409409
writeFileSync(tmpProjPath(f), content);
410410
} else {
411411
writeFileSync(
412412
tmpProjPath(f),
413-
content(readFileSync(tmpProjPath(f)).toString())
413+
content(readFileSync(tmpProjPath(f)).toString()),
414414
);
415415
}
416416
}

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,17 @@
2828
"e2e-registry": "yarn verdaccio --config ./tools/scripts/local-registry/config.yml --listen 4872",
2929
"e2e-tests": "ts-node -P ./tools/scripts/tsconfig.e2e.json ./tools/scripts/e2e.ts",
3030
"e2e": "run-p -r e2e-registry \"e2e-tests {@}\" --",
31-
"semantic-release": "semantic-release"
31+
"publish-local": "run-p \"rimraf tmp\" e2e-registry \"ts-node ./tools/scripts/publish-all 99.99.99 local\"",
32+
"semantic-release": "semantic-release",
33+
"ts-node": "ts-node",
34+
"rimraf": "rimraf"
3235
},
3336
"private": false,
3437
"dependencies": {
3538
"@types/xmldoc": "^1.1.5",
3639
"chokidar": "^3.5.1",
3740
"glob": "^7.1.6",
41+
"inquirer": "^8.0.0",
3842
"rimraf": "^3.0.2",
3943
"rxjs": "^6.6.6",
4044
"xmldoc": "^1.1.2"
@@ -58,6 +62,7 @@
5862
"@semantic-release/exec": "^5.0.0",
5963
"@semantic-release/git": "^9.0.0",
6064
"@semantic-release/release-notes-generator": "^9.0.2",
65+
"@types/inquirer": "^7.3.1",
6166
"@types/jest": "26.0.8",
6267
"@types/node": "14.14.33",
6368
"@types/rimraf": "^3.0.0",
@@ -88,4 +93,4 @@
8893
"url": "https://github.com/nx-dotnet/nx-dotnet.git"
8994
},
9095
"version": "0.3.0-dev.4"
91-
}
96+
}

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
"bugs": {
2222
"url": "https://github.com/nx-dotnet/nx-dotnet/issues/new?assignees=&labels=bug%2C+needs-triage&template=bug_report.md&title=%5BBUG%5D+"
2323
}
24-
}
24+
}

0 commit comments

Comments
 (0)