Skip to content

Commit

Permalink
feat(vue): add missing deps to vue package.json to fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mandarini committed Sep 12, 2023
1 parent ab417e8 commit 2d1c990
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ tmp
*.log
jest.debug.config.js
.tool-versions
/.nx
/.nx-cache
/.verdaccio/build/local-registry
/graph/client/src/assets/environment.js
Expand All @@ -19,7 +20,6 @@ jest.debug.config.js
/graph/client/src/assets/generated-task-graphs
/nx-dev/nx-dev/public/documentation
/nx-dev/nx-dev/public/images/open-graph

# Issues scraper creates these files, stored by github's cache
/scripts/issues-scraper/cached

Expand Down
5 changes: 4 additions & 1 deletion packages/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@
},
"dependencies": {
"tslib": "^2.3.0",
"@nx/cypress": "file:../cypress",
"@nx/devkit": "file:../devkit",
"@nx/jest": "file:../jest",
"@nx/js": "file:../js",
"@nx/linter": "file:../linter",
"@nx/playwright": "file:../playwright",
"@nx/vite": "file:../vite",
"@nx/web": "file:../web"
"@nx/web": "file:../web",
"@phenomnomnominal/tsquery": "~5.0.1"
},
"publishConfig": {
"access": "public"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ exports[`application generator should set up project correctly with given option
"passWithNoTests": true,
"reportsDirectory": "../coverage/test"
}
},
"serve-static": {
"executor": "@nx/web:file-server",
"options": {
"buildTarget": "test:build"
}
}
}
}
Expand Down Expand Up @@ -164,13 +170,22 @@ exports[`application generator should set up project correctly with given option
".prettierrc",
"nx.json",
"package.json",
"test-e2e/.eslintrc.json",
"test-e2e/cypress.config.ts",
"test-e2e/project.json",
"test-e2e/src/e2e/app.cy.ts",
"test-e2e/src/fixtures/example.json",
"test-e2e/src/support/app.po.ts",
"test-e2e/src/support/commands.ts",
"test-e2e/src/support/e2e.ts",
"test-e2e/tsconfig.json",
"test/.eslintrc.json",
"test/index.html",
"test/project.json",
"test/src/__tests__/App.spec.ts",
"test/src/App.vue",
"test/src/components/NxWelcome.vue",
"test/src/main.ts",
"test/src/NxWelcome.vue",
"test/src/styles.css",
"test/tsconfig.app.json",
"test/tsconfig.json",
Expand Down
10 changes: 0 additions & 10 deletions packages/vue/src/generators/component/component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version';
import { logger, readJson, Tree } from '@nx/devkit';
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
import { componentGenerator } from './component';
import { createLib } from '../../utils/test-utils';

// need to mock cypress otherwise it'll use the nx installed version from package.json
// which is v9 while we are testing for the new v10 version
jest.mock('@nx/cypress/src/utils/cypress-version');

describe('component', () => {
let appTree: Tree;
let projectName: string;
let mockedInstalledCypressVersion: jest.Mock<
ReturnType<typeof installedCypressVersion>
> = installedCypressVersion as never;

beforeEach(async () => {
mockedInstalledCypressVersion.mockReturnValue(10);
projectName = 'my-lib';
appTree = createTreeWithEmptyWorkspace();
// await createApp(appTree, 'my-app');
await createLib(appTree, projectName);
jest.spyOn(logger, 'warn').mockImplementation(() => {});
jest.spyOn(logger, 'debug').mockImplementation(() => {});
Expand Down
7 changes: 1 addition & 6 deletions packages/vue/src/generators/library/library.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version';
import {
getProjects,
readJson,
Expand All @@ -13,12 +12,9 @@ import libraryGenerator from './library';
import { Schema } from './schema';
// need to mock cypress otherwise it'll use the nx installed version from package.json
// which is v9 while we are testing for the new v10 version
jest.mock('@nx/cypress/src/utils/cypress-version');
describe('lib', () => {
let tree: Tree;
let mockedInstalledCypressVersion: jest.Mock<
ReturnType<typeof installedCypressVersion>
> = installedCypressVersion as never;

let defaultSchema: Schema = {
name: 'myLib',
linter: Linter.EsLint,
Expand All @@ -31,7 +27,6 @@ describe('lib', () => {
};

beforeEach(() => {
mockedInstalledCypressVersion.mockReturnValue(10);
tree = createTreeWithEmptyWorkspace();
updateJson(tree, '/package.json', (json) => {
json.devDependencies = {
Expand Down

0 comments on commit 2d1c990

Please sign in to comment.