-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: cleanup git status in folders that are checked in
- Loading branch information
Showing
33 changed files
with
617 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Code PushUp (fork) | ||
|
||
# separated from code-pushup.yml for security reasons | ||
# => requires permissions to create PR comment | ||
# => for PRs from forks, needs to run on `pull_request_target`, not `pull_request` | ||
# => `pull_request_target` is a security risk when secrets are being used | ||
# => secrets needed for code-pushup upload | ||
# => code-pushup for forks runs in separate workflow with no secrets access | ||
|
||
on: | ||
pull_request_target: | ||
branches: [main] | ||
|
||
env: | ||
NX_NON_NATIVE_HASHER: true | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
code-pushup: | ||
runs-on: ubuntu-latest | ||
name: Code PushUp | ||
if: github.event.pull_request.head.repo.fork | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: .nvmrc | ||
cache: npm | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run Code PushUp action | ||
uses: code-pushup/github-action@v0 | ||
with: | ||
bin: npx nx code-pushup -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"extends": ["../../../.eslintrc.base.json", "../../../.eslintrc.base.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.json"], | ||
"parser": "jsonc-eslint-parser", | ||
"rules": { | ||
"@nx/dependency-checks": [ | ||
"error", | ||
{ | ||
"ignoredFiles": ["{projectRoot}/vite.config.{js,ts,mjs,mts}"] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "plugin-1-e2e", | ||
"$schema": "../../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "projects/cli-e2e/test", | ||
"projectType": "application", | ||
"tags": ["type:e2e", "type:e2e-vi", "type:example"], | ||
"implicitDependencies": ["cli", "plugin-1"], | ||
"targets": { | ||
"lint": {}, | ||
"e2e": { | ||
"executor": "@nx/vite:test", | ||
"inputs": ["default", "^production"], | ||
"outputs": ["{options.reportsDirectory}"], | ||
"options": { | ||
"reportsDirectory": "../../../coverage/projects/cli-e2e" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { dirname, join, basename } from 'node:path'; | ||
import { afterEach, describe, expect, it } from 'vitest'; | ||
import { mkdir, readFile, rm, writeFile } from 'node:fs/promises'; | ||
import { executeProcess, objectToCliArgs } from '@push-based/test-utils'; | ||
import { | ||
getTestFixturesDist, | ||
getTestEnvironmentRoot, | ||
} from '@push-based/test-utils'; | ||
|
||
describe('CLI command - sort -p plugin-1', () => { | ||
const fixturesDist = getTestFixturesDist('cli-command-sort', { | ||
root: getTestEnvironmentRoot(process.env['NX_TASK_TARGET_PROJECT']), | ||
}); | ||
|
||
afterEach(async () => { | ||
await rm(fixturesDist, { recursive: true, force: true }); | ||
}); | ||
|
||
it('should execute CLI command sort when param file is given', async () => { | ||
const testPath = join( | ||
fixturesDist, | ||
'execute-sort-command-with-plugin', | ||
'users.json' | ||
); | ||
await mkdir(dirname(testPath), { recursive: true }); | ||
await writeFile( | ||
testPath, | ||
JSON.stringify([{ name: 'B' }, { name: 'A' }, { name: 'C' }]) | ||
); | ||
|
||
const { code } = await executeProcess({ | ||
command: 'npx', | ||
args: objectToCliArgs({ | ||
_: ['cli', 'sort', '-p @push-based/plugin-1'], | ||
filePath: basename(testPath), | ||
}), | ||
cwd: dirname(testPath), | ||
verbose: true, | ||
}); | ||
|
||
expect(code).toBe(0); | ||
|
||
const content = (await readFile(testPath)).toString(); | ||
expect(JSON.parse(content)).toStrictEqual([ | ||
{ name: 'C' }, | ||
{ name: 'B' }, | ||
{ name: 'A' }, | ||
]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"extends": "../../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"module": "esnext", | ||
"forceConsistentCasingInFileNames": true, | ||
"strict": true, | ||
"noImplicitOverride": true, | ||
"noPropertyAccessFromIndexSignature": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true | ||
}, | ||
"files": [], | ||
"include": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.spec.json" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../../dist/out-tsc", | ||
"types": [ | ||
"vitest/globals", | ||
"vitest/importMeta", | ||
"vite/client", | ||
"node", | ||
"vitest" | ||
] | ||
}, | ||
"include": [ | ||
"vite.config.ts", | ||
"vitest.config.ts", | ||
"test/**/*.test.ts", | ||
"test/**/*.spec.ts", | ||
"test/**/*.test.tsx", | ||
"test/**/*.spec.tsx", | ||
"test/**/*.test.js", | ||
"test/**/*.spec.js", | ||
"test/**/*.test.jsx", | ||
"test/**/*.spec.jsx", | ||
"test/**/*.d.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { defineConfig } from 'vite'; | ||
|
||
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; | ||
|
||
export default defineConfig({ | ||
root: __dirname, | ||
cacheDir: '../../../node_modules/.vite/projects/cli-e2e', | ||
|
||
plugins: [nxViteTsPaths()], | ||
|
||
// Uncomment this if you are using workers. | ||
// worker: { | ||
// plugins: [ nxViteTsPaths() ], | ||
// }, | ||
|
||
test: { | ||
globals: true, | ||
cache: { dir: '../../../node_modules/.vitest' }, | ||
environment: 'node', | ||
include: ['test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], | ||
reporters: ['default'], | ||
coverage: { | ||
reportsDirectory: '../../../coverage/projects/cli-e2e', | ||
provider: 'v8', | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.