Skip to content

Commit

Permalink
fix(scripts-generators): migrate away from deprecated nx interfaces t…
Browse files Browse the repository at this point in the history
…o pass lint
  • Loading branch information
Hotell committed May 18, 2023
1 parent acb4830 commit b7ae526
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions scripts/generators/create-component/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as os from 'os';
import * as path from 'path';

import { findGitRoot, getAllPackageInfo, isConvergedPackage } from '@fluentui/scripts-monorepo';
import { WorkspaceJsonConfiguration, names } from '@nrwl/devkit';
import { ProjectsConfigurations, names } from '@nrwl/devkit';
import chalk from 'chalk';
import * as fs from 'fs-extra';
import { Actions } from 'node-plop';
Expand Down Expand Up @@ -173,7 +173,7 @@ const appendToPackageIndex = (data: Data): string => {
//#endregion

function getProjectMetadata(options: { root: string; name: string }) {
const nxWorkspace: WorkspaceJsonConfiguration = JSON.parse(
const nxWorkspace: ProjectsConfigurations = JSON.parse(
fs.readFileSync(path.join(options.root, 'workspace.json'), 'utf-8'),
);

Expand Down
6 changes: 3 additions & 3 deletions scripts/generators/create-package/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { spawnSync } from 'child_process';
import * as path from 'path';

import { PackageJson, findGitRoot } from '@fluentui/scripts-monorepo';
import { WorkspaceJsonConfiguration } from '@nrwl/devkit';
import { ProjectsConfigurations } from '@nrwl/devkit';
import chalk from 'chalk';
import * as fs from 'fs-extra';
import * as jju from 'jju';
Expand Down Expand Up @@ -306,7 +306,7 @@ function updateNxWorkspace(_answers: Answers, config: { root: string; projectNam
};

const nxWorkspaceContent = fs.readFileSync(paths.workspace, 'utf-8');
const nxWorkspace: WorkspaceJsonConfiguration = jju.parse(nxWorkspaceContent);
const nxWorkspace: ProjectsConfigurations = jju.parse(nxWorkspaceContent);
Object.assign(nxWorkspace.projects, templates.workspace);

const updatedNxWorkspace = jju.update(nxWorkspaceContent, nxWorkspace, { mode: 'json', indent: 2 });
Expand All @@ -315,7 +315,7 @@ function updateNxWorkspace(_answers: Answers, config: { root: string; projectNam
}

function getProjectMetadata(options: { root: string; name: string }) {
const nxWorkspace: WorkspaceJsonConfiguration = JSON.parse(
const nxWorkspace: ProjectsConfigurations = JSON.parse(
fs.readFileSync(path.join(options.root, 'workspace.json'), 'utf-8'),
);

Expand Down

0 comments on commit b7ae526

Please sign in to comment.