complete-cli 1.0.1-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +7 -0
  3. package/dist/commands/CheckCommand.js +141 -0
  4. package/dist/commands/InitCommand.js +64 -0
  5. package/dist/commands/NukeCommand.js +13 -0
  6. package/dist/commands/PublishCommand.js +158 -0
  7. package/dist/commands/UpdateCommand.js +16 -0
  8. package/dist/commands/check/check.test.js +86 -0
  9. package/dist/commands/check/getTruncatedText.js +139 -0
  10. package/dist/commands/init/checkIfProjectPathExists.js +21 -0
  11. package/dist/commands/init/createProject.js +123 -0
  12. package/dist/commands/init/getAuthorName.js +17 -0
  13. package/dist/commands/init/getProjectPath.js +80 -0
  14. package/dist/commands/init/packageManager.js +35 -0
  15. package/dist/commands/init/vsCodeInit.js +74 -0
  16. package/dist/constants.js +17 -0
  17. package/dist/git.js +128 -0
  18. package/dist/interfaces/GitHubCLIHostsYAML.js +1 -0
  19. package/dist/main.js +26 -0
  20. package/dist/prompt.js +46 -0
  21. package/dist/validateNoteVersion.js +25 -0
  22. package/file-templates/dynamic/.github/workflows/setup/action.yml +13 -0
  23. package/file-templates/dynamic/Node.gitignore +130 -0
  24. package/file-templates/dynamic/README.md +3 -0
  25. package/file-templates/dynamic/_gitignore +9 -0
  26. package/file-templates/dynamic/package.json +37 -0
  27. package/file-templates/static/.github/workflows/ci.yml +49 -0
  28. package/file-templates/static/.prettierignore +12 -0
  29. package/file-templates/static/.vscode/extensions.json +9 -0
  30. package/file-templates/static/.vscode/settings.json +75 -0
  31. package/file-templates/static/LICENSE +674 -0
  32. package/file-templates/static/_cspell.config.jsonc +25 -0
  33. package/file-templates/static/_gitattributes +37 -0
  34. package/file-templates/static/eslint.config.mjs +18 -0
  35. package/file-templates/static/knip.config.js +20 -0
  36. package/file-templates/static/prettier.config.mjs +24 -0
  37. package/file-templates/static/scripts/build.ts +5 -0
  38. package/file-templates/static/scripts/lint.ts +30 -0
  39. package/file-templates/static/scripts/tsconfig.json +14 -0
  40. package/file-templates/static/src/main.ts +5 -0
  41. package/file-templates/static/tsconfig.json +12 -0
  42. package/package.json +59 -0
  43. package/src/commands/CheckCommand.ts +249 -0
  44. package/src/commands/InitCommand.ts +105 -0
  45. package/src/commands/NukeCommand.ts +17 -0
  46. package/src/commands/PublishCommand.ts +242 -0
  47. package/src/commands/UpdateCommand.ts +20 -0
  48. package/src/commands/check/check.test.ts +123 -0
  49. package/src/commands/check/getTruncatedText.ts +187 -0
  50. package/src/commands/init/checkIfProjectPathExists.ts +36 -0
  51. package/src/commands/init/createProject.ts +197 -0
  52. package/src/commands/init/getAuthorName.ts +23 -0
  53. package/src/commands/init/getProjectPath.ts +112 -0
  54. package/src/commands/init/packageManager.ts +64 -0
  55. package/src/commands/init/vsCodeInit.ts +115 -0
  56. package/src/constants.ts +39 -0
  57. package/src/git.ts +182 -0
  58. package/src/interfaces/GitHubCLIHostsYAML.ts +7 -0
  59. package/src/main.ts +34 -0
  60. package/src/prompt.ts +72 -0
  61. package/src/validateNoteVersion.ts +39 -0
@@ -0,0 +1,130 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ lerna-debug.log*
8
+ .pnpm-debug.log*
9
+
10
+ # Diagnostic reports (https://nodejs.org/api/report.html)
11
+ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12
+
13
+ # Runtime data
14
+ pids
15
+ *.pid
16
+ *.seed
17
+ *.pid.lock
18
+
19
+ # Directory for instrumented libs generated by jscoverage/JSCover
20
+ lib-cov
21
+
22
+ # Coverage directory used by tools like istanbul
23
+ coverage
24
+ *.lcov
25
+
26
+ # nyc test coverage
27
+ .nyc_output
28
+
29
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30
+ .grunt
31
+
32
+ # Bower dependency directory (https://bower.io/)
33
+ bower_components
34
+
35
+ # node-waf configuration
36
+ .lock-wscript
37
+
38
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
39
+ build/Release
40
+
41
+ # Dependency directories
42
+ node_modules/
43
+ jspm_packages/
44
+
45
+ # Snowpack dependency directory (https://snowpack.dev/)
46
+ web_modules/
47
+
48
+ # TypeScript cache
49
+ *.tsbuildinfo
50
+
51
+ # Optional npm cache directory
52
+ .npm
53
+
54
+ # Optional eslint cache
55
+ .eslintcache
56
+
57
+ # Optional stylelint cache
58
+ .stylelintcache
59
+
60
+ # Microbundle cache
61
+ .rpt2_cache/
62
+ .rts2_cache_cjs/
63
+ .rts2_cache_es/
64
+ .rts2_cache_umd/
65
+
66
+ # Optional REPL history
67
+ .node_repl_history
68
+
69
+ # Output of 'npm pack'
70
+ *.tgz
71
+
72
+ # Yarn Integrity file
73
+ .yarn-integrity
74
+
75
+ # dotenv environment variable files
76
+ .env
77
+ .env.development.local
78
+ .env.test.local
79
+ .env.production.local
80
+ .env.local
81
+
82
+ # parcel-bundler cache (https://parceljs.org/)
83
+ .cache
84
+ .parcel-cache
85
+
86
+ # Next.js build output
87
+ .next
88
+ out
89
+
90
+ # Nuxt.js build / generate output
91
+ .nuxt
92
+ dist
93
+
94
+ # Gatsby files
95
+ .cache/
96
+ # Comment in the public line in if your project uses Gatsby and not Next.js
97
+ # https://nextjs.org/blog/next-9-1#public-directory-support
98
+ # public
99
+
100
+ # vuepress build output
101
+ .vuepress/dist
102
+
103
+ # vuepress v2.x temp and cache directory
104
+ .temp
105
+ .cache
106
+
107
+ # Docusaurus cache and generated files
108
+ .docusaurus
109
+
110
+ # Serverless directories
111
+ .serverless/
112
+
113
+ # FuseBox cache
114
+ .fusebox/
115
+
116
+ # DynamoDB Local files
117
+ .dynamodb/
118
+
119
+ # TernJS port file
120
+ .tern-port
121
+
122
+ # Stores VSCode versions used for testing VSCode extensions
123
+ .vscode-test
124
+
125
+ # yarn v2
126
+ .yarn/cache
127
+ .yarn/unplugged
128
+ .yarn/build-state.yml
129
+ .yarn/install-state.gz
130
+ .pnp.*
@@ -0,0 +1,3 @@
1
+ # PROJECT-NAME
2
+
3
+ PROJECT-NAME is a [TypeScript](https://www.typescriptlang.org/) project.
@@ -0,0 +1,9 @@
1
+ # OS-specific artifacts
2
+ .DS_Store
3
+ thumbs.db
4
+
5
+ # ------------------------------
6
+ # GitHub Node.gitignore template
7
+ # https://raw.githubusercontent.com/github/gitignore/master/Node.gitignore
8
+ # cspell:disable
9
+ # ------------------------------
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "PROJECT_NAME",
3
+ "version": "0.0.0",
4
+ "description": "",
5
+ "keywords": [],
6
+ "homepage": "https://github.com/AUTHOR_NAME/PROJECT_NAME",
7
+ "bugs": {
8
+ "url": "https://github.com/AUTHOR_NAME/PROJECT_NAME/issues"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/AUTHOR_NAME/PROJECT_NAME.git"
13
+ },
14
+ "license": "GPL-3.0",
15
+ "author": "AUTHOR_NAME",
16
+ "type": "module",
17
+ "files": [
18
+ "dist",
19
+ "LICENSE",
20
+ "package.json",
21
+ "README.md"
22
+ ],
23
+ "scripts": {
24
+ "build": "tsx ./scripts/build.ts",
25
+ "lint": "tsx ./scripts/lint.ts",
26
+ "nuke": "complete-cli nuke",
27
+ "publish": "complete-cli publish",
28
+ "start": "tsx ./src/main.ts",
29
+ "update": "complete-cli update"
30
+ },
31
+ "devDependencies": {
32
+ "complete-cli": "^0.0.1",
33
+ "complete-lint": "^0.0.1",
34
+ "complete-node": "^0.0.1",
35
+ "typescript": "5.5.4"
36
+ }
37
+ }
@@ -0,0 +1,49 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v4
10
+ - uses: ./.github/workflows/setup
11
+ - run: npm run build
12
+
13
+ lint:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: ./.github/workflows/setup
18
+ - run: npm run lint
19
+
20
+ # To enable CI failure notifications over Discord:
21
+ # - Right click on a channel in Discord and select "Edit Channel".
22
+ # - Click on "Integrations" on the left menu.
23
+ # - Click on the "Create Webhook" button.
24
+ # - Click on the box for the new webhook that was created.
25
+ # - Change the name to "GitHub".
26
+ # - Change the image to: https://github.com/complete-ts/complete/raw/main/misc/github.png
27
+ # - Click on the "Save Changes" button at the bottom.
28
+ # - Click on the "Copy Webhook URL" button.
29
+ # - Go to the main page for your repository on GitHub.
30
+ # - Click on the "Settings" tab near the top.
31
+ # - Click on "Secrets and variables" in the left menu.
32
+ # - Click on "Actions" from the dropdown list.
33
+ # - Click on the "New repository secret" button in the top right.
34
+ # - For the "Name" box, use "DISCORD_WEBHOOK" (without the quotes).
35
+ # - For the "Secret" box, paste in the URL that was copied in the "Copy Webhook URL" step. (The
36
+ # pasted URL should not have a "/github" suffix.)
37
+ # - Click on the "Add secret" button.
38
+ # - Delete this comment and uncomment the lines below.
39
+ #discord:
40
+ # name: Discord Failure Notification
41
+ # needs: [build, lint]
42
+ # if: failure()
43
+ # runs-on: ubuntu-latest
44
+ # steps:
45
+ # - uses: sarisia/actions-status-discord@v1
46
+ # with:
47
+ # webhook: ${{ secrets.DISCORD_WEBHOOK }}
48
+ # status: failure
49
+ # title: ""
@@ -0,0 +1,12 @@
1
+ # Compiled output
2
+ dist
3
+
4
+ # Package manager lock files
5
+ package-lock.json
6
+ yarn.lock
7
+ pnpm-lock.yaml
8
+ bun.lock
9
+
10
+ # Minified files
11
+ *.min.js
12
+ *.min.css
@@ -0,0 +1,9 @@
1
+ // These are Visual Studio Code extensions that are intended to be used with this particular
2
+ // repository: https://go.microsoft.com/fwlink/?LinkId=827846
3
+ {
4
+ "recommendations": [
5
+ "esbenp.prettier-vscode", // The TypeScript formatter
6
+ "dbaeumer.vscode-eslint", // The TypeScript linter
7
+ "streetsidesoftware.code-spell-checker", // A spell-checker extension based on CSpell
8
+ ],
9
+ }
@@ -0,0 +1,75 @@
1
+ // These are Visual Studio Code settings that should apply to this particular repository.
2
+ {
3
+ // ----------------
4
+ // Vanilla settings
5
+ // ----------------
6
+
7
+ // This matches the Airbnb JavaScript style guide.
8
+ "editor.rulers": [100],
9
+ "editor.tabSize": 2,
10
+
11
+ "files.associations": {
12
+ ".env*": "shellscript", // e.g. ".env.example" is the same as ".env".
13
+ },
14
+
15
+ // We want to always use "lf" to be consistent with all platforms.
16
+ "files.eol": "\n",
17
+
18
+ // Automatically remove all trailing whitespace when saving a file.
19
+ "files.trimTrailingWhitespace": true,
20
+
21
+ // Configure glob patterns for excluding files and folders in full text searches and quick open.
22
+ "search.exclude": {
23
+ "**/*.mp3": true,
24
+ "**/*.png": true,
25
+ "**/*.svg": true,
26
+ "**/*.wav": true,
27
+ "**/.yarn/": true,
28
+ "**/dist/": true,
29
+ "**/node_modules/": true,
30
+ "bun.lock": true,
31
+ "LICENSE": true,
32
+ "package-lock.json": true,
33
+ "pnpm-lock.yaml": true,
34
+ "yarn.lock": true,
35
+ },
36
+
37
+ // ------------------
38
+ // Extension settings
39
+ // ------------------
40
+
41
+ // Use Prettier to format "cspell.config.jsonc".
42
+ "cSpell.autoFormatConfigFile": true,
43
+
44
+ // -----------------
45
+ // Language settings
46
+ // -----------------
47
+
48
+ // By default, VSCode will not automatically fill-in function arguments.
49
+ "javascript.suggest.completeFunctionCalls": true,
50
+ "typescript.suggest.completeFunctionCalls": true,
51
+
52
+ // By default, VSCode will prefer non-relative paths for deeply nested files.
53
+ "javascript.preferences.importModuleSpecifier": "relative",
54
+ "typescript.preferences.importModuleSpecifier": "relative",
55
+
56
+ // By default, VSCode will not add `import type` automatically.
57
+ "typescript.preferences.preferTypeOnlyAutoImports": true,
58
+
59
+ // Show TypeScript errors for files that don't happen to be currently open, which makes TypeScript
60
+ // work similar to other compiled languages like Golang or Rust.
61
+ "typescript.tsserver.experimental.enableProjectDiagnostics": true,
62
+
63
+ // Automatically run the formatter when certain files are saved.
64
+ "[javascript][typescript][javascriptreact][typescriptreact]": {
65
+ "editor.codeActionsOnSave": {
66
+ "source.fixAll.eslint": "explicit",
67
+ },
68
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
69
+ "editor.formatOnSave": true,
70
+ },
71
+ "[css][html][json][jsonc][markdown][postcss][yaml]": {
72
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
73
+ "editor.formatOnSave": true,
74
+ },
75
+ }