Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@typescript-eslint/no-non-null-assertion": "off",
"unused-imports/no-unused-imports": "error",
"no-duplicate-imports": "error",
"unused-imports/no-unused-vars": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/naming-convention": [
"error",
{
Expand All @@ -41,13 +41,16 @@
"selector": "enumMember",
"format": ["PascalCase"]
}
]
],
"no-extra-semi": "error"
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
"rules": {
"no-extra-semi": "error"
}
},
{
"files": [
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:

- name: Test
shell: bash
run: npx nx affected --target=test --base=${{ env.NX_BASE }} --head=HEAD
run: npx nx affected --target=test --base=${{ env.NX_BASE }} --head=HEAD ${{ runner.os == 'Windows' && '--maxWorkers=1' }}

- name: E2E Tests
# TODO: temporary disabled e2e on windows
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,7 @@ Thumbs.db

# Nx
.nx/cache
migrations.json
.nx/workspace-data
migrations.json
vite.config.*.timestamp*
vitest.config.*.timestamp*
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/dist
/coverage
CHANGELOG.md
/.nx/cache
/.nx/cache
/.nx/workspace-data
12 changes: 6 additions & 6 deletions e2e/qwik-nx-e2e/tests/application-basic-behavior.suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { names } from '@nx/devkit';
export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
const isPreset = generator === 'preset';
const appPathPrefix = isPreset ? 'apps/' : '';
const libPathPrefix = isPreset ? 'libs/' : '';
const libPathPrefix = '';
const devServerPort = 4212;
const previewServerPort = 4232;
describe(`Basic behavior with ${generator} generator`, () => {
Expand Down Expand Up @@ -77,7 +77,7 @@ export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
'should create qwik-nx',
async () => {
const result = await runNxCommandAsync(`build ${project}`);
expect(result.stdout).toContain(
expect(stripConsoleColors(result.stdout)).toContain(
`Running type check for the "${project}"..`
);
expect(
Expand All @@ -91,7 +91,7 @@ export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
.join('')
.replace(/\n|\s/g, '')
);
expect(result.stdout).toContain(
expect(stripConsoleColors(result.stdout)).toContain(
`Successfully ran target build for project ${project}`
);
expect(() =>
Expand Down Expand Up @@ -167,7 +167,7 @@ export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
'unit tests should pass in the created app',
async () => {
const result = await runNxCommandAsync(`test ${project}`);
expect(result.stdout).toContain(
expect(stripConsoleColors(result.stdout)).toContain(
`Successfully ran target test for project ${project}`
);
},
Expand All @@ -186,7 +186,7 @@ export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
const result = await runNxCommandAsync(`test ${project}`, {
silenceError: true,
});
expect(result.stdout).toContain(
expect(stripConsoleColors(result.stdout)).toContain(
`Running target test for project ${project} failed`
);
},
Expand All @@ -211,7 +211,7 @@ export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
.join('')
.replace(/\n|\s/g, '')
);
expect(result.stdout).toContain(
expect(stripConsoleColors(result.stdout)).toContain(
`Successfully ran target build for project ${project}`
);
},
Expand Down
8 changes: 4 additions & 4 deletions e2e/qwik-nx-e2e/tests/chore.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ describe('misc checks', () => {
expect(packageJson.dependencies).toBeUndefined();
expect(packageJson.devDependencies).toBeUndefined();
expect(packageJson.peerDependencies).toEqual({
'@nx/devkit': '^17.0.0 || ^18.0.0 || ^19.0.0',
'@nx/js': '^17.0.0 || ^18.0.0 || ^19.0.0',
'@nx/eslint': '^17.0.0 || ^18.0.0 || ^19.0.0',
'@nx/vite': '^17.0.0 || ^18.0.0 || ^19.0.0',
'@nx/devkit': '^20.0.0',
'@nx/js': '^20.0.0',
'@nx/eslint': '^20.0.0',
'@nx/vite': '^20.0.0',
});
},
DEFAULT_E2E_TIMEOUT
Expand Down
4 changes: 2 additions & 2 deletions e2e/qwik-nx-e2e/tests/micro-frontends.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('Micro-frontends e2e', () => {
async () => {
const checkProject = async (name: string) => {
const result = await runNxCommandAsync(`build ${name}`);
expect(result.stdout).toContain(
expect(stripConsoleColors(result.stdout)).toContain(
`Successfully ran target build for project ${name}`
);
expect(() =>
Expand Down Expand Up @@ -152,7 +152,7 @@ describe('Micro-frontends e2e', () => {
`generate qwik-nx:remote ${remote3} --host=${project} --port=5176 --no-interactive`
);
const result = await runNxCommandAsync(`build ${remote3}`);
expect(result.stdout).toContain(
expect(stripConsoleColors(result.stdout)).toContain(
`Successfully ran target build for project ${remote3}`
);
expect(() =>
Expand Down
3 changes: 2 additions & 1 deletion e2e/qwik-nx-e2e/tests/qwik-nx-cloudflare.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
killPort,
killPorts,
DEFAULT_E2E_TIMEOUT,
stripConsoleColors,
} from '@qwikifiers/e2e/utils';

const CLOUDFLARE_PREVIEW_PORT = 4173;
Expand Down Expand Up @@ -49,7 +50,7 @@ describe('qwik nx cloudflare generator', () => {
'should be able to successfully build the application',
async () => {
const result = await runNxCommandAsync(`build-cloudflare ${project}`);
expect(result.stdout).toContain(
expect(stripConsoleColors(result.stdout)).toContain(
`Successfully ran target build for project ${project}`
);
expect(() =>
Expand Down
3 changes: 2 additions & 1 deletion e2e/qwik-nx-e2e/tests/qwik-nx-netlify.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
killPort,
killPorts,
DEFAULT_E2E_TIMEOUT,
stripConsoleColors,
} from '@qwikifiers/e2e/utils';

const NETLIFY_PREVIEW_PORT = 8888;
Expand Down Expand Up @@ -41,7 +42,7 @@ describe('qwik nx netlify generator', () => {
'should be able to successfully build the application',
async () => {
const result = await runNxCommandAsync(`build-netlify ${project}`);
expect(result.stdout).toContain(
expect(stripConsoleColors(result.stdout)).toContain(
`Successfully ran target build for project ${project}`
);
expect(() =>
Expand Down
3 changes: 2 additions & 1 deletion e2e/qwik-nx-e2e/tests/qwik-nx-vite.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
removeFile,
killPorts,
DEFAULT_E2E_TIMEOUT,
stripConsoleColors,
} from '@qwikifiers/e2e/utils';

describe('qwikNxVite plugin e2e', () => {
Expand Down Expand Up @@ -109,7 +110,7 @@ describe('qwikNxVite plugin e2e', () => {
'should be able to successfully build the application',
async () => {
const result = await runNxCommandAsync(`build ${project}`);
expect(result.stdout).toContain(
expect(stripConsoleColors(result.stdout)).toContain(
`Successfully ran target build for project ${project}`
);
expect(() =>
Expand Down
10 changes: 6 additions & 4 deletions e2e/qwik-nx-e2e/tests/storybook.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
killPort,
killPorts,
DEFAULT_E2E_TIMEOUT,
stripConsoleColors,
} from '@qwikifiers/e2e/utils';
import { normalize } from 'path';

Expand Down Expand Up @@ -43,12 +44,13 @@ describe('qwikNxVite plugin e2e', () => {
);
await addAdditionalStories(appProject);
}, DEFAULT_E2E_TIMEOUT);

checkStorybookIsBuiltAndServed(appProject);
});
describe('Applying storybook for existing library', () => {
beforeAll(async () => {
await runNxCommandAsync(
`generate qwik-nx:library ${libProject} --no-interactive`
`generate qwik-nx:library --directory=${libProject} --no-interactive`
);
await runNxCommandAsync(
`generate qwik-nx:storybook-configuration ${libProject} --no-interactive`
Expand All @@ -61,7 +63,7 @@ describe('qwikNxVite plugin e2e', () => {
describe('Generating a new library with storybook configuration', () => {
beforeAll(async () => {
await runNxCommandAsync(
`generate qwik-nx:library ${secondLibProject} --storybookConfiguration=true --no-interactive`
`generate qwik-nx:library --directory=${secondLibProject} --storybookConfiguration=true --no-interactive`
);
await addAdditionalStories(secondLibProject);
}, DEFAULT_E2E_TIMEOUT);
Expand All @@ -84,7 +86,7 @@ function checkStorybookIsBuiltAndServed(projectName: string) {
`should be able to build storybook for the "${projectName}"`,
async () => {
const result = await runNxCommandAsync(`build-storybook ${projectName}`);
expect(result.stdout).toContain(
expect(stripConsoleColors(result.stdout)).toContain(
`Successfully ran target build-storybook for project ${projectName}`
);
expect(() =>
Expand All @@ -105,7 +107,7 @@ function checkStorybookIsBuiltAndServed(projectName: string) {
output.includes('Local:') &&
output.includes(`:${STORYBOOK_PORT}`)
) {
resultOutput = output;
resultOutput = stripConsoleColors(output);
return true;
}
return false;
Expand Down
3 changes: 2 additions & 1 deletion e2e/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as treeKill from 'tree-kill';
import {
detectPackageManager,
getPackageManagerCommand,
PackageManager,
} from 'nx/src/utils/package-manager';

export const DEFAULT_E2E_TIMEOUT = 3 * 60 * 1000;
Expand All @@ -26,7 +27,7 @@ function getAdditionalPackageManagerCommands(): {
createWorkspace: string;
runNx: string;
} {
const pm = detectPackageManager();
const pm = detectPackageManager() as Exclude<PackageManager, 'bun'>;
const [npmMajorVersion] = execSync(`npm -v`).toString().split('.');
const publishedVersion = execSync('npm view nx version');
switch (pm) {
Expand Down
8 changes: 4 additions & 4 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getJestProjects } from '@nx/jest';
import { getJestProjectsAsync } from '@nx/jest';

export default {
projects: getJestProjects(),
};
export default async () => ({
projects: await getJestProjectsAsync(),
});
3 changes: 2 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@
"libsDir": "packages"
},
"nxCloudAccessToken": "MmI5MzJhMDctNGYwMi00OTI1LWJiZjUtNWIwNTQ4NmY2ZjhjfHJlYWQtd3JpdGU=",
"useInferencePlugins": false
"useInferencePlugins": false,
"useLegacyCache": true
}
47 changes: 25 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,29 @@
"@commitlint/config-angular": "^17.8.1",
"@commitlint/config-conventional": "^17.8.1",
"@jscutlery/semver": "^4.2.0",
"@nx/cypress": "19.0.6",
"@nx/devkit": "19.0.6",
"@nx/eslint": "19.0.6",
"@nx/eslint-plugin": "19.0.6",
"@nx/jest": "19.0.6",
"@nx/js": "19.0.6",
"@nx/playwright": "19.0.6",
"@nx/plugin": "19.0.6",
"@nx/storybook": "19.0.6",
"@nx/vite": "19.0.6",
"@nx/workspace": "19.0.6",
"@swc-node/register": "1.8.0",
"@nx/cypress": "20.3.0",
"@nx/devkit": "20.3.0",
"@nx/eslint": "20.3.0",
"@nx/eslint-plugin": "20.3.0",
"@nx/jest": "20.3.0",
"@nx/js": "20.3.0",
"@nx/playwright": "20.3.0",
"@nx/plugin": "20.3.0",
"@nx/storybook": "20.3.0",
"@nx/vite": "20.3.0",
"@nx/workspace": "20.3.0",
"@swc-node/register": "1.9.2",
"@swc/cli": "0.3.12",
"@swc/core": "^1.4.1",
"@swc/core": "1.5.7",
"@types/fs-extra": "11.0.1",
"@types/jest": "29.4.0",
"@types/jest": "29.5.13",
"@types/node": "18.19.15",
"@types/semver": "7.5.6",
"@types/tcp-port-used": "1.0.1",
"@types/yargs": "17.0.24",
"@typescript-eslint/eslint-plugin": "7.9.0",
"@typescript-eslint/parser": "7.9.0",
"@typescript-eslint/eslint-plugin": "^8.19.1",
"@typescript-eslint/parser": "8.19.1",
"@typescript-eslint/utils": "^8.19.1",
"all-contributors-cli": "^6.26.1",
"chalk": "^4.1.2",
"commitizen": "^4.3.0",
Expand All @@ -55,17 +56,17 @@
"enquirer": "2.3.6",
"eslint": "8.57.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-unused-imports": "2.0.0",
"eslint-plugin-unused-imports": "^4.1.4",
"fs-extra": "11.1.0",
"husky": "^8.0.3",
"is-windows": "1.0.2",
"isomorphic-fetch": "3.0.0",
"jest": "29.4.3",
"jest-environment-jsdom": "29.4.3",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"jsonc-eslint-parser": "^2.4.0",
"kill-port": "2.0.1",
"ngx-deploy-npm": "8.0.1",
"nx": "19.0.6",
"nx": "20.3.0",
"prettier": "^2.8.8",
"pretty-quick": "^3.3.1",
"semver": "7.6.0",
Expand All @@ -74,13 +75,15 @@
"ts-jest": "29.1.0",
"ts-morph": "17.0.1",
"ts-node": "10.9.1",
"typescript": "4.9.5",
"typescript": "5.6.3",
"verdaccio": "5.21.1",
"vite": "~5.0.12",
"yargs": "17.7.1"
},
"dependencies": {
"@swc/helpers": "0.5.1",
"@storybook/addon-interactions": "8.4.7",
"@swc/helpers": "0.5.13",
"storybook": "^8.2.8",
"tslib": "^2.6.2"
},
"config": {
Expand Down
1 change: 1 addition & 0 deletions packages/create-qwik-nx/bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

import { commandsObject } from './create-qwik-nx';

// eslint-disable-next-line @typescript-eslint/no-unused-expressions
commandsObject.argv;
Loading
Loading