From 2d1c9900af0ddcca1d13ab8038a3bac724fd8e97 Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 12 Sep 2023 10:18:08 +0300 Subject: [PATCH] feat(vue): add missing deps to vue package.json to fix linting --- .gitignore | 2 +- packages/vue/package.json | 5 ++++- .../__snapshots__/application.spec.ts.snap | 17 ++++++++++++++++- .../src/generators/component/component.spec.ts | 10 ---------- .../vue/src/generators/library/library.spec.ts | 7 +------ 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 1ec0aa30b1cf3a..71311c125c8430 100644 --- a/.gitignore +++ b/.gitignore @@ -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 @@ -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 diff --git a/packages/vue/package.json b/packages/vue/package.json index 106a0d7366a834..50ac98eb7a2443 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -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" diff --git a/packages/vue/src/generators/application/__snapshots__/application.spec.ts.snap b/packages/vue/src/generators/application/__snapshots__/application.spec.ts.snap index 93de798a0a2700..103c9bf84f052a 100644 --- a/packages/vue/src/generators/application/__snapshots__/application.spec.ts.snap +++ b/packages/vue/src/generators/application/__snapshots__/application.spec.ts.snap @@ -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" + } } } } @@ -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", diff --git a/packages/vue/src/generators/component/component.spec.ts b/packages/vue/src/generators/component/component.spec.ts index d86a0aacc34899..5b305a15c761ed 100644 --- a/packages/vue/src/generators/component/component.spec.ts +++ b/packages/vue/src/generators/component/component.spec.ts @@ -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 - > = 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(() => {}); diff --git a/packages/vue/src/generators/library/library.spec.ts b/packages/vue/src/generators/library/library.spec.ts index 2f448041e2603c..2dfe6f03919bbd 100644 --- a/packages/vue/src/generators/library/library.spec.ts +++ b/packages/vue/src/generators/library/library.spec.ts @@ -1,4 +1,3 @@ -import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; import { getProjects, readJson, @@ -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 - > = installedCypressVersion as never; + let defaultSchema: Schema = { name: 'myLib', linter: Linter.EsLint, @@ -31,7 +27,6 @@ describe('lib', () => { }; beforeEach(() => { - mockedInstalledCypressVersion.mockReturnValue(10); tree = createTreeWithEmptyWorkspace(); updateJson(tree, '/package.json', (json) => { json.devDependencies = {