Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.
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: 7 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ jobs:
fetch-depth: 0
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v2.0.1
with:
version: 6.18.0
- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"*.{js,json,css,scss,md,ts,html,graphql}": [
"*.{js,json,yaml,yml,css,scss,md,ts,html,graphql}": [
"yarn format"
]
}
8 changes: 4 additions & 4 deletions e2e/stack-e2e/lib/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ function runNxNewCommand(args?: string, silent?: boolean) {
*
* @param paths
*/
export function newNxProject(paths: ProjectDistPath[]): void {
export function newNxProject(paths: ProjectDistPath[], packageManager: string): void {
cleanup()
runNxNewCommand('--package-manager=yarn', true)
runNxNewCommand(`--package-manager=${packageManager}`, true)
patchDistProjects(paths)
for (const path of paths) {
patchPackageJsonForPlugin(path.package, path.path)
Expand Down Expand Up @@ -69,7 +69,7 @@ export function patchDistProjects(paths: ProjectDistPath[]): void {
* Ensures that a project has been setup in the e2e directory
* It will also copy `@nrwl` packages to the e2e directory
*/
export function ensureNxProjects(paths: ProjectDistPath[]): void {
export function ensureNxProjects(paths: ProjectDistPath[], packageManager: string): void {
ensureDirSync(tmpProjPath())
newNxProject(paths)
newNxProject(paths, packageManager)
}
18 changes: 11 additions & 7 deletions e2e/stack-e2e/tests/stack.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ describe('stack e2e', () => {
const nameApi = uniq('api')
const nameMobile = uniq('mobile')
const nameWeb = uniq('web')
const packageManager = 'pnpm'

beforeAll(async () => {
process.env.HUSKY_SKIP_INSTALL = 'true'
console.log('Create workspace')
ensureNxProjects([
{ package: '@nxpm/api', path: 'dist/packages/api' },
{ package: '@nxpm/common', path: 'dist/packages/common' },
{ package: '@nxpm/mobile', path: 'dist/packages/mobile' },
{ package: '@nxpm/stack', path: 'dist/packages/stack' },
{ package: '@nxpm/web', path: 'dist/packages/web' },
])
ensureNxProjects(
[
{ package: '@nxpm/api', path: 'dist/packages/api' },
{ package: '@nxpm/common', path: 'dist/packages/common' },
{ package: '@nxpm/mobile', path: 'dist/packages/mobile' },
{ package: '@nxpm/stack', path: 'dist/packages/stack' },
{ package: '@nxpm/web', path: 'dist/packages/web' },
],
packageManager,
)
const params = ['--api-name', nameApi, '--mobile-name', nameMobile, '--web-name', nameWeb].join(' ')
const command = `generate @nxpm/stack:init ${params}`
console.log(`Generate project: nx ${command}`)
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "nx serve",
"build": "nx run-many --target build --all",
"test": "nx test",
"test:ci": "yarn affected:test && yarn affected:e2e",
"test:ci": "pnpm run affected:test && pnpm run affected:e2e",
"lint": "nx workspace-lint && nx lint",
"e2e": "nx e2e",
"prepare": "husky install",
Expand All @@ -29,6 +29,7 @@
},
"private": true,
"dependencies": {
"@schematics/angular": "^12.2.11",
"nxpm": "^1.18.0",
"tslib": "^2.0.0"
},
Expand All @@ -51,16 +52,20 @@
"@types/node": "14.14.33",
"@typescript-eslint/eslint-plugin": "4.31.2",
"@typescript-eslint/parser": "4.31.2",
"chalk": "^4.1.2",
"dotenv": "10.0.0",
"eslint": "7.22.0",
"eslint-config-prettier": "8.1.0",
"fs-extra": "^10.0.0",
"husky": "^7.0.1",
"jest": "27.2.3",
"lint-staged": "^11.0.1",
"prettier": "^2.3.1",
"ts-jest": "27.0.5",
"ts-node": "~9.1.1",
"tslib": "^2.0.0",
"typescript": "4.3.5"
"typescript": "4.3.5",
"yaml": "^1.10.2",
"yargs": "^17.2.1"
}
}
Loading