Skip to content

Commit

Permalink
dropped support for node12
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Duda committed May 28, 2024
2 parents 53078a0 + c70012e commit a684df9
Show file tree
Hide file tree
Showing 41 changed files with 2,516 additions and 672 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test-and-deploy-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- uses: actions/setup-node@v4
with:
node-version: '18.17.1'
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ importMap.json
commitfile.txt
logs.html
buildData.json
__temporaryTestData__/
__temporaryTestData__/
*.html
9 changes: 8 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@
"type": "node-terminal"
},
{
"command": "npm run build && scope --report-for-commit 0417cc011a9c53b308584e2cc79e47d5568cf99b",
"command": "npm run build && scope --report-for-commit 161671d540ffe9de3b1480efb4e2dff35ee677e5",
"name": "Run test of --report-for-commit",
"request": "launch",
"type": "node-terminal"
},
{
"command": "scope --find-refs src/ts/models/Model.ts",
"name": "scope --find-refs",
"request": "launch",
"type": "node-terminal",
"cwd": "${workspaceFolder}/test/_repo"
},
{
"name": "Debug Jest Tests (Windows)",
"type": "node",
Expand Down
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ From the repository you want to test the package run
npm i scope-tags -D
```

Make sure your Git configuration has case-sensitivity enabled
```
git config --global core.ignorecase false
```

### How to run

From the repository you want to test the package run
Expand Down Expand Up @@ -112,20 +117,19 @@ Publishing is made automatically by pushing a commit to the main branch, see [gi

The mock repo can be updated automatically by running `./pushTestRepo.sh`

### Features to do
### Features to do in order of importance

- [ ] Add keyboard shortcut hints when selecting tags and files -> https://github.com/enquirer/enquirer#select-choices
- [ ] Add groups on select prompt:
- [ ] Group files based on common path (files from same directory sould be grouped)
- [ ] Group tags based on parent modules
- [ ] Add remove hanging tags option to tag manager - search for tags not assigned to any module and ask the user if they want to delete them
- [ ] Unit tests for common actions:
- [ ] Find a way to clone test repository locally - this will make unit testing much quicker
- [ ] Unit tests for:
- [ ] The basic actions which can be performed on files - adding, deleting, modifying, renaming. After initial database entry the script should automatically handle all cases.
- [ ] Testing if files are correstly updated in database depending on changes in git
- [ ] On loading `tags.json` assert that all parents exist in database, if not then these modules won't be displayed
- [ ] Add unit tests for even the basic stuff - reading and parsing JSON files, synchronization between the database and repository, etc.
- [ ] Add unit tests for the basic actions which can be performed on files - adding, deleting, modifying, renaming. After initial database entry the script should automatically handle all cases.
- [ ] Add [adf-validator](https://github.com/torifat/adf-validator/tree/master) which would give more specific errors (right now comments are just not being posted)
- [ ] Add remove hanging tags option to tag manager - search for tags not assigned to any module and ask the user if they want to delete them
- [ ] Add keyboard shortcut hints when selecting tags and files -> https://github.com/enquirer/enquirer#select-choices

### Special thanks

- [adf-validator](https://github.com/torifat/adf-validator) for showing how to validate Jira's ADF
- [adf-validator](https://github.com/torifat/adf-validator) for showing how to validate Jira's ADF
1 change: 1 addition & 0 deletions adf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"doc","version":1,"content":[{"type":"expand","attrs":{"title":"'Project' scope tags v0.3.0 │ 20.05.2024 13:57 │ -"},"content":[{"type":"table","content":[{"type":"tableRow","content":[{"type":"tableHeader","content":[{"type":"paragraph","content":[{"type":"text","text":"Affected tags","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","attrs":{"colwidth":[20]},"content":[{"type":"paragraph","content":[{"type":"text","text":"Lines","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","content":[{"type":"paragraph","content":[{"type":"text","text":"Used by module","marks":[{"type":"strong"}]}]}]},{"type":"tableHeader","content":[{"type":"paragraph","content":[{"type":"text","text":"Used by tags","marks":[{"type":"strong"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Default module / Tag"}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"++ 60\n-- 27"}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"nestedExpand","attrs":{"title":"Default module"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Tag"}]}]},{"type":"nestedExpand","attrs":{"title":"Third module"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Some new tag"}]}]},{"type":"nestedExpand","attrs":{"title":"Fourth module"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Fourth tag"}]}]},{"type":"nestedExpand","attrs":{"title":"5 untagged files"},"content":[{"type":"paragraph","content":[{"type":"text","text":"src/Relevancy/RelevancyManager.ts\nsrc/References/TSReferenceFinder.ts\nsrc/Logger/Logger.ts\nsrc/Git/Types.ts\nsrc/HTMLCreator/HTMLCreator.ts"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"nestedExpand","attrs":{"title":"Tag"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Default module"}]}]},{"type":"nestedExpand","attrs":{"title":"Some new tag"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Third module"}]}]},{"type":"nestedExpand","attrs":{"title":"Fourth tag"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Fourth module"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Fourth module / Fourth tag"}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"++ 56\n-- 21"}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"1 modules hidden by low relevancy"}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"1 tags hidden by low relevancy"}]}]}]},{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"Third module / Some new tag"}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"++ 21\n-- 12"}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"nestedExpand","attrs":{"title":"Default module"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Tag"}]}]},{"type":"nestedExpand","attrs":{"title":"Fourth module"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Fourth tag"}]}]},{"type":"nestedExpand","attrs":{"title":"Second module"},"content":[{"type":"paragraph","content":[{"type":"text","text":"asdflkj"}]}]},{"type":"nestedExpand","attrs":{"title":"2 untagged files"},"content":[{"type":"paragraph","content":[{"type":"text","text":"src/Logger/Logger.ts\nsrc/HTMLCreator/HTMLCreator.ts"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"nestedExpand","attrs":{"title":"Tag"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Default module"}]}]},{"type":"nestedExpand","attrs":{"title":"Fourth tag"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Fourth module"}]}]},{"type":"nestedExpand","attrs":{"title":"asdflkj"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Second module"}]}]}]}]},{"type":"tableRow","content":[{"type":"tableHeader","attrs":{},"content":[{"type":"nestedExpand","attrs":{"title":"1 untagged file"},"content":[{"type":"paragraph","content":[{"type":"text","text":"src/Relevancy/RelevancyManager.ts"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"paragraph","content":[{"type":"text","text":"++ 1\n-- 1"}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"nestedExpand","attrs":{"title":"Default module"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Tag"}]}]},{"type":"nestedExpand","attrs":{"title":"Fourth module"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Fourth tag"}]}]},{"type":"nestedExpand","attrs":{"title":"Second module"},"content":[{"type":"paragraph","content":[{"type":"text","text":"asdflkj"}]}]},{"type":"nestedExpand","attrs":{"title":"5 untagged files"},"content":[{"type":"paragraph","content":[{"type":"text","text":"src/Git/GitRepository.ts\nsrc/Commands/runVerifyCommand.ts\nsrc/Commands/runVerifyUnpushedCommitsCommand.ts\nsrc/Logger/Logger.ts\nsrc/Commands/runLogCommitCommand.ts"}]}]}]},{"type":"tableHeader","attrs":{},"content":[{"type":"nestedExpand","attrs":{"title":"Tag"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Default module"}]}]},{"type":"nestedExpand","attrs":{"title":"Fourth tag"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Fourth module"}]}]},{"type":"nestedExpand","attrs":{"title":"asdflkj"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Second module"}]}]}]}]}],"attrs":{"layout":"full-width"}}]}]}
23 changes: 11 additions & 12 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
transformIgnorePatterns: ["<rootDir>/node_modules/"],
roots: ["<rootDir>/test/", "<rootDir>/src/"],
collectCoverage: true,
collectCoverageFrom: ["**/src/**", "!**/node_modules/**"],
coverageDirectory: "./coverage",
coverageReporters: ["json", "lcovonly", "text", "clover"],
testPathIgnorePatterns: ["/_utils/"],
globalSetup: "<rootDir>/test/setup.js",
globalTeardown: "<rootDir>/test/teardown.js",
preset: 'ts-jest',
testEnvironment: 'node',
transformIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/__temporaryTestData__/'],
roots: ["<rootDir>/test/", "<rootDir>/src/"],
collectCoverage: false,
collectCoverageFrom: ["src/**", "!**/node_modules/**"],
coverageDirectory: './coverage',
coverageReporters: ['json', 'lcovonly', 'text', 'clover'],
testPathIgnorePatterns: ['/_utils/'],
globalSetup: '<rootDir>/test/setup.js',
globalTeardown: '<rootDir>/test/teardown.js',
setupFilesAfterEnv: ["./jest.setup.js"],
};
Loading

0 comments on commit a684df9

Please sign in to comment.