-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Refactor CLI tool #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| { | ||
| "root": true, | ||
| "env": { | ||
| "node": true, | ||
| "es2021": true | ||
| }, | ||
| "extends": [ | ||
| "eslint:recommended", | ||
| "plugin:@typescript-eslint/recommended", | ||
| "plugin:prettier/recommended", | ||
| "plugin:import/errors", | ||
| "plugin:import/typescript", | ||
| "plugin:@typescript-eslint/eslint-recommended" | ||
| ], | ||
| "globals": {}, | ||
| "overrides": [], | ||
| "parser": "@typescript-eslint/parser", | ||
| "parserOptions": { | ||
| "ecmaVersion": "latest", | ||
| "sourceType": "module", | ||
| "project": "./tsconfig.json", | ||
| "tsconfigRootDir": "." | ||
| }, | ||
| "plugins": ["@typescript-eslint", "simple-import-sort", "import"], | ||
| "settings": { | ||
| "import/resolver": { | ||
| "typescript": { | ||
| "alwaysTryTypes": true, | ||
| "project": "./tsconfig.json" | ||
| }, | ||
| "node": { | ||
| "extensions": [".js", ".ts"] | ||
| } | ||
| }, | ||
| "import/parsers": { | ||
| "@typescript-eslint/parser": [".ts"] | ||
| }, | ||
| "import/extensions": [".js", ".ts"] | ||
| }, | ||
| "rules": { | ||
| "no-unused-vars": "off", // Required by @typescript-eslint/no-unused-vars | ||
| "curly": "error", | ||
| "no-duplicate-imports": "off", | ||
| "padding-line-between-statements": [ | ||
| "error", | ||
| { | ||
| "blankLine": "always", | ||
| "prev": ["class", "function"], | ||
| "next": "*" | ||
| }, | ||
| { | ||
| "blankLine": "always", | ||
| "prev": "*", | ||
| "next": ["class", "function", "return", "try"] | ||
| }, | ||
| { | ||
| "blankLine": "always", | ||
| "prev": ["import", "for", "if", "switch", "while"], | ||
| "next": ["const", "expression", "let"] | ||
| }, | ||
| { | ||
| "blankLine": "always", | ||
| "prev": ["const", "expression", "let"], | ||
| "next": ["for", "if", "switch", "try", "while"] | ||
| }, | ||
| { | ||
| "blankLine": "always", | ||
| "prev": ["const", "expression", "import", "let"], | ||
| "next": "export" | ||
| }, | ||
| { | ||
| "blankLine": "always", | ||
| "prev": ["for", "switch", "while"], | ||
| "next": "if" | ||
| }, | ||
| { | ||
| "blankLine": "always", | ||
| "prev": ["if", "switch", "while"], | ||
| "next": "for" | ||
| }, | ||
| { | ||
| "blankLine": "always", | ||
| "prev": ["if", "for", "while"], | ||
| "next": "switch" | ||
| }, | ||
| { | ||
| "blankLine": "always", | ||
| "prev": ["if", "for", "switch"], | ||
| "next": "while" | ||
| } | ||
| ], | ||
| /* @typescript-eslint */ | ||
| "@typescript-eslint/consistent-type-imports": [ | ||
| "error", | ||
| { | ||
| "prefer": "type-imports", | ||
| "disallowTypeAnnotations": true, | ||
| "fixStyle": "separate-type-imports" | ||
| } | ||
| ], | ||
| "@typescript-eslint/no-unused-vars": [ | ||
| "error", | ||
| { | ||
| "vars": "all", | ||
| "varsIgnorePattern": "^_", | ||
| "args": "all", | ||
| "argsIgnorePattern": "^_" | ||
| } | ||
| ], | ||
| "@typescript-eslint/no-deprecated": "error", | ||
| "simple-import-sort/imports": "error", | ||
| "simple-import-sort/exports": "error", | ||
| "import/first": "error", | ||
| "import/newline-after-import": "error", | ||
| "import/no-duplicates": "error", | ||
| "import/no-unused-modules": ["warn", { "unusedExports": true, "ignoreExports": [] }], | ||
| "import/no-cycle": ["error", { "ignoreExternal": true }], | ||
| "import/no-default-export": "error", | ||
| "import/no-dynamic-require": "error", | ||
| "import/no-mutable-exports": "error", | ||
| "import/no-useless-path-segments": "error", | ||
| "import/no-self-import": "error" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: Add contributor | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - 'master' | ||
|
|
||
| jobs: | ||
| add-contributor: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| with: | ||
| persist-credentials: false | ||
| fetch-depth: 0 | ||
| submodules: recursive | ||
|
|
||
| - uses: akhilmhdh/[email protected] | ||
| with: | ||
| readme_path: CONTRIBUTORS.md | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: Publish Package | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - '!*' | ||
| tags: | ||
| - 'v*' | ||
|
|
||
| jobs: | ||
| publish-npm: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| with: | ||
| persist-credentials: false | ||
| fetch-depth: 0 | ||
| submodules: recursive | ||
|
|
||
| - uses: oven-sh/setup-bun@v2 | ||
| - run: bun install --frozen-lockfile | ||
| - run: bun run build | ||
| - run: bun publish --access public | ||
| env: | ||
| NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
|
||
| - name: Update CHANGELOG | ||
| id: changelog | ||
| continue-on-error: true | ||
| uses: requarks/changelog-action@v1 | ||
| with: | ||
| token: ${{ github.token }} | ||
| tag: ${{ github.ref_name }} | ||
|
|
||
| - name: Create Release | ||
| continue-on-error: true | ||
| uses: ncipollo/release-action@v1 | ||
| with: | ||
| allowUpdates: true | ||
| draft: false | ||
| makeLatest: true | ||
| name: ${{ github.ref_name }} | ||
| body: ${{ steps.changelog.outputs.changes }} | ||
| token: ${{ github.token }} | ||
| artifacts: 'dist/*.js' | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this action is only for release notes, why uploading the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In that case you can easily check the bundled output that was pushed to npm.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can check that already on npmjs .org. It makes no sense to me, to upload only the JS files to a release on github. Anyway, I hавing trouble understanding your reasoning . The whole PR looks like AI generated, which might be fine, but only if it's thoroughly tested. Anyway, what I would sugest, so we don't waste more time is go back to the original PR, just remove the node-fetch with built-in fetch, and I'll merge and release it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ai generated is only the core structure and some typings from poedit swagger documentation.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, sure. No problem. It is not important, but here is the thing. I can go on, but i want to focus on the things we started talking about already ? And I want to clarify something for myself. What do you want to achieve with this total rewrite ? because refactor in the title is misleading, it is complete rewrite.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not super important to merge this. We can drop this problem no problem.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not against publishing from the pipeline, but if there will be publish from the pipeline at least it should be something like that : https://github.com/marketplace/actions/npm-publish And then, bun. I am not saying bun is bad. Haven't used it , but it's interesting. My point is that anyway typescript is already a dependency, it should be used to building instead of bun. Note I am not even talking about the massive over engineering this rewrite is. From a few hundred lines of simple script, now we have to discuss how bun is better of marking external dependencies. The truth is the script probably can be refactored w/o any external dependencies, fetch is already a built-in , and I guess the querystring built-in module can be used to construct the request body. I hope that clarifies my standing here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for your honest thoughts. I will improve this |
||
|
|
||
| - name: Commit files | ||
| continue-on-error: true | ||
| run: | | ||
| git config --local user.email "[email protected]" | ||
| git config --local user.name "zaro" | ||
| git commit -m "Release: ${GITHUB_REF:11}" -a | ||
|
|
||
| - name: Push changes | ||
| continue-on-error: true | ||
| uses: ad-m/github-push-action@master | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| branch: master | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| .npmrc | ||
| node_modules/ | ||
| node_modules/ | ||
| dist/ |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Ignore artifacts: | ||
| dist | ||
| node_modules | ||
|
|
||
| # Ignore changelogs: | ||
| CHANGELOG.md |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "tabWidth": 4, | ||
| "singleQuote": true, | ||
| "printWidth": 120, | ||
| "endOfLine": "lf", | ||
| "overrides": [ | ||
| { | ||
| "files": "*.md", | ||
| "options": { | ||
| "printWidth": 100, | ||
| "useTabs": false, | ||
| "trailingComma": "none", | ||
| "arrowParens": "avoid", | ||
| "proseWrap": "always" | ||
| } | ||
| }, | ||
| { | ||
| "files": "*.{json,*rc,yml}", | ||
| "options": { | ||
| "useTabs": false, | ||
| "tabWidth": 2, | ||
| "printWidth": 120, | ||
| "trailingComma": "none" | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # Contributors | ||
|
|
||
| ## Maintainer | ||
|
|
||
| - **Svetlozar Argirov** ([@zaro](https://github.com/zaro)) - <[email protected]> - Original author | ||
| and current maintainer | ||
|
|
||
| ## Contributors | ||
|
|
||
| <!-- readme: contributors -start --> | ||
|
|
||
| <!-- readme: contributors -end --> | ||
|
|
||
| ## How to Contribute | ||
|
|
||
| We welcome contributions from the community! If you'd like to contribute to POEditorial, please | ||
| follow these steps: | ||
|
|
||
| 1. Fork the repository | ||
| 2. Create your feature branch from `master`: `git checkout -b feature/my-new-feature` | ||
| 3. Commit your changes: `git commit -am 'feat: Add some feature'` | ||
| [Conventional Commit messages](https://www.conventionalcommits.org/en/v1.0.0-beta.2/) | ||
| 4. Push to the branch: `git push origin feature/my-new-feature` | ||
| 5. Submit a pull request | ||
|
|
||
| ### Develop | ||
|
|
||
| To install dependencies: | ||
|
|
||
| ```bash | ||
| bun install | ||
| ``` | ||
|
|
||
| To run: | ||
|
|
||
| ```bash | ||
| bun run src/index.ts | ||
| ``` | ||
|
|
||
| Please make sure your code follows the existing style conventions and includes appropriate tests and | ||
| types. | ||
|
|
||
| ## Acknowledgements | ||
|
|
||
| Special thanks to: | ||
|
|
||
| - [POEditor](https://poeditor.com/) for their translation management platform and API | ||
| - [Bun](https://bun.sh/) - The JavaScript runtime and toolkit used in this project | ||
| - All the open source libraries that make this project possible | ||
|
|
||
| --- | ||
|
|
||
| \*This file is maintained by project contributors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't make sense I believe.
The release should be to NPM, and this is simply publising to githbub releases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is particular dedicated just for release notes.