Skip to content

Commit

Permalink
chore: cleanup lint errors, format files etc
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Jul 12, 2021
1 parent a7a0808 commit 8f925f5
Show file tree
Hide file tree
Showing 21 changed files with 66 additions and 35 deletions.
17 changes: 9 additions & 8 deletions apps/docs-site/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const features = [
imageUrl: 'img/undraw_coding.svg',
description: (
<>
nx-dotnet was designed from the ground up to allow developers to
develop how they want to. Easily stick with Visual Studio or other IDE's,
or switch to a more lightweight environment such as VS Code.
nx-dotnet was designed from the ground up to allow developers to develop
how they want to. Easily stick with Visual Studio or other IDE's, or
switch to a more lightweight environment such as VS Code.
</>
),
},
Expand All @@ -23,8 +23,8 @@ const features = [
imageUrl: 'img/undraw_adventure_map.svg',
description: (
<>
All of the power of nx, brought to the .NET workflow.
Easily build, test, and publish only what was changed in CI.
All of the power of nx, brought to the .NET workflow. Easily build,
test, and publish only what was changed in CI.
</>
),
},
Expand All @@ -33,9 +33,10 @@ const features = [
imageUrl: 'img/undraw_code_thinking.svg',
description: (
<>
Built using the .NET SDK + CLI, nx-dotnet is easy to update and should never break due
to a new relase of .NET. Using a preview version? No worry, since nx-dotnet uses your
installed CLI you can choose exactly what to run.
Built using the .NET SDK + CLI, nx-dotnet is easy to update and should
never break due to a new relase of .NET. Using a preview version? No
worry, since nx-dotnet uses your installed CLI you can choose exactly
what to run.
</>
),
},
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/executors/format/executor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ExecutorContext } from '@nrwl/devkit';

import {
DotNetClient,
dotnetFactory,
Expand All @@ -8,6 +9,7 @@ import {
getExecutedProjectConfiguration,
getProjectFileForNxProject,
} from '@nx-dotnet/utils';

import { FormatExecutorSchema } from './schema';

function normalizeOptions(
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/generators/init/generator.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { readJson, Tree, writeJson } from '@nrwl/devkit';
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
import { DotNetClient, mockDotnetFactory } from '@nx-dotnet/dotnet';

import { DotNetClient, mockDotnetFactory } from '@nx-dotnet/dotnet';
import { CONFIG_FILE_PATH, NxDotnetConfig } from '@nx-dotnet/utils';

import generator from './generator';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/generators/init/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
WorkspaceConfiguration,
writeJson,
} from '@nrwl/devkit';
import { DotNetClient, dotnetFactory } from '@nx-dotnet/dotnet';

import { DotNetClient, dotnetFactory } from '@nx-dotnet/dotnet';
import { CONFIG_FILE_PATH, NxDotnetConfig } from '@nx-dotnet/utils';

export default async function (
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/generators/restore/generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';

import { prompt } from 'inquirer';

import { updateConfig, getNxDotnetProjects } from '@nx-dotnet/utils';
import { getNxDotnetProjects, updateConfig } from '@nx-dotnet/utils';

import generator from './generator';

Expand Down
1 change: 1 addition & 0 deletions packages/core/src/generators/restore/generator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Tree } from '@nrwl/devkit';

import { DotNetClient, dotnetFactory } from '@nx-dotnet/dotnet';
import {
getNxDotnetProjects,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/generators/sync/generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';

import { prompt } from 'inquirer';

import { updateConfig, getNxDotnetProjects } from '@nx-dotnet/utils';
import { getNxDotnetProjects, updateConfig } from '@nx-dotnet/utils';

import generator from './generator';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { XmlDocument } from 'xmldoc';
import {
DotNetClient,
dotnetFactory,
dotnetNewOptions,
mockDotnetFactory,
} from '@nx-dotnet/dotnet';
import { findProjectFileInPath, NXDOTNET_TAG, rimraf } from '@nx-dotnet/utils';
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/generators/utils/generate-test-project.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { addProjectConfiguration, Tree } from '@nrwl/devkit';

import { DotNetClient, dotnetNewOptions } from '@nx-dotnet/dotnet';
import { findProjectFileInPath, isDryRun } from '@nx-dotnet/utils';

import {
GetBuildExecutorConfiguration,
GetLintExecutorConfiguration,
GetTestExecutorConfig,
NxDotnetTestGeneratorSchema,
} from '../../models';
import {
addDryRunParameter,
NormalizedSchema,
normalizeOptions,
addDryRunParameter,
SetOutputPath,
} from './generate-project';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { formatFiles, Tree, updateProjectConfiguration } from '@nrwl/devkit';

import { getNxDotnetProjects } from '@nx-dotnet/utils';

import { GetLintExecutorConfiguration } from '../../models';

export default function update(host: Tree) {
Expand Down
5 changes: 3 additions & 2 deletions packages/nx-ghpages/src/executors/deploy/executor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { BuildExecutorSchema } from './schema';
import executor from './executor';
import * as fs from 'fs';

import executor from './executor';
import { BuildExecutorSchema } from './schema';

jest.mock('child_process', () => ({
exec: (
cmd: string,
Expand Down
6 changes: 4 additions & 2 deletions packages/nx-ghpages/src/executors/deploy/executor.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { BuildExecutorSchema } from './schema';
import { logger } from '@nrwl/devkit';

import { exec as execCallback } from 'child_process';
import { stat } from 'fs';
import { dirname, join } from 'path';
import { promisify } from 'util';
import { logger } from '@nrwl/devkit';

import { BuildExecutorSchema } from './schema';

const exec = promisify(execCallback);

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
label: '<%=packageName%>'
label: '<%=packageName%>'
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
sidebar_position: 0
slug: /
---<%}%>

# Our Plugins

<% packageDetails.forEach(pkg => {%>

## [<%= pkg.packageName %>](./<%=pkg.projectFileName%>)

<%if (pkg.executors > 0 ) {%>- <%= pkg.executors %> Executor<%= pkg.executors > 1 ? 's' : '' %> <%}%>
<%if (pkg.generators > 0 ) {%>- <%= pkg.generators %> Generator<%= pkg.generators > 1 ? 's' : '' %> <%}%>
<%})%>
<%})%>
2 changes: 1 addition & 1 deletion packages/utils/src/lib/utility-functions/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '@nrwl/devkit';

import { readFileSync } from 'fs';
import { isAbsolute, resolve, dirname } from 'path';
import { dirname, isAbsolute, resolve } from 'path';
import { XmlDocument, XmlElement } from 'xmldoc';

import { NXDOTNET_TAG } from '../constants';
Expand Down
1 change: 1 addition & 0 deletions tools/generators/generate-docs/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { formatFiles, Tree } from '@nrwl/devkit';

import { execSync } from 'child_process';
import { resolve } from 'path';

Expand Down
7 changes: 4 additions & 3 deletions tools/scripts/e2e.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { execSync, ChildProcess, spawn } from 'child_process';
import { readdirSync } from 'fs';
import { ChildProcess, execSync, spawn } from 'child_process';
import { readdirSync, readFileSync } from 'fs';
import { copySync, removeSync, writeFileSync } from 'fs-extra';
import { readFileSync } from 'fs';

import { e2eRoot } from '../../e2e/utils';

const kill = require('tree-kill');

let verdaccioInstance: ChildProcess;
Expand Down
4 changes: 3 additions & 1 deletion tools/scripts/patch-package-versions/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { WorkspaceJsonConfiguration } from '@nrwl/devkit';
import { Workspaces } from '@nrwl/tao/src/shared/workspace';

import { execSync } from 'child_process';
import { join } from 'path';

import {
existsSync,
readJson,
writeJson,
readWorkspaceJson,
writeJson,
} from '../../utils';

export function PatchPackageVersions(newVersion: string, updateGit = true) {
Expand Down
4 changes: 3 additions & 1 deletion tools/scripts/publish-all/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { WorkspaceJsonConfiguration } from '@nrwl/devkit';

import { execSync } from 'child_process';
import { existsSync } from 'fs';

import { readJson, readWorkspaceJson } from '../../utils';
import { PatchPackageVersions } from '../patch-package-versions';

Expand All @@ -17,7 +19,7 @@ export function PublishAll(version: string, tag = 'latest') {
const projects = Object.values(workspace.projects);
const environment = {
...process.env,
NPM_CONFIG_REGISTRY: 'http://localhost:4872',
NPM_CONFIG_REGISTRY: undefined,
};

projects.forEach((projectConfiguration, idx) => {
Expand Down
28 changes: 19 additions & 9 deletions tools/scripts/publish-docs-site/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
import { joinPathFragments } from "@nrwl/devkit";
import { execSync } from "child_process";
import { joinPathFragments } from '@nrwl/devkit';

import { execSync } from 'child_process';

if (require.main === module) {
const path = joinPathFragments(__dirname, '../../../dist/apps/docs-site');
execSync('git init ', {cwd: path, stdio: 'inherit'})
execSync('git checkout -b "gh-pages"', {cwd: path, stdio: 'inherit'})
execSync('git add . && git commit -m "chore: deploy docs site"', {cwd: path, stdio: 'inherit'})
execSync(`git remote add origin https://github-actions:${process.env.GITHUB_TOKEN}@github.com/nx-dotnet/nx-dotnet`, {cwd: path, stdio: 'inherit'})
execSync('git push -f --set-upstream origin gh-pages', {cwd: path, stdio: 'inherit'})
}
const path = joinPathFragments(__dirname, '../../../dist/apps/docs-site');
execSync('git init ', { cwd: path, stdio: 'inherit' });
execSync('git checkout -b "gh-pages"', { cwd: path, stdio: 'inherit' });
execSync('git add . && git commit -m "chore: deploy docs site"', {
cwd: path,
stdio: 'inherit',
});
execSync(
`git remote add origin https://github-actions:${process.env.GITHUB_TOKEN}@github.com/nx-dotnet/nx-dotnet`,
{ cwd: path, stdio: 'inherit' },
);
execSync('git push -f --set-upstream origin gh-pages', {
cwd: path,
stdio: 'inherit',
});
}
1 change: 1 addition & 0 deletions tools/utils/fs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Workspaces } from '@nrwl/tao/src/shared/workspace';

import { readFileSync, statSync, writeFileSync } from 'fs';
import { join } from 'path';

Expand Down

0 comments on commit 8f925f5

Please sign in to comment.