@ben-studios/envedit 0.0.0-stage → 1.0.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.
- package/.gitlab-ci.yml +133 -0
- package/.idea/envedit.iml +8 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/@types/custom.d.ts +10 -0
- package/CHANGELOG.md +196 -0
- package/LICENSE +674 -0
- package/README.md +97 -2
- package/bun.lock +176 -0
- package/ci/npm.sh +4 -0
- package/cli/cmd/environment.ts +10 -0
- package/cli/cmd/environmentCmd/add.ts +115 -0
- package/cli/cmd/environmentCmd/edit.ts +74 -0
- package/cli/cmd/environmentCmd/index.ts +6 -0
- package/cli/cmd/environmentCmd/list.ts +16 -0
- package/cli/cmd/environmentCmd/remove.ts +47 -0
- package/cli/cmd/index.ts +7 -0
- package/cli/cmd/init.ts +60 -0
- package/cli/cmd/setup.ts +46 -0
- package/cli/cmd/use.ts +60 -0
- package/cli/cmd/variable.ts +10 -0
- package/cli/cmd/variableCmd/add.ts +92 -0
- package/cli/cmd/variableCmd/edit.ts +150 -0
- package/cli/cmd/variableCmd/index.ts +6 -0
- package/cli/cmd/variableCmd/list.ts +35 -0
- package/cli/cmd/variableCmd/remove.ts +39 -0
- package/cli/index.ts +28 -0
- package/coverage/.lcov.info.133d8750bda2c350.tmp +139 -0
- package/coverage/.lcov.info.64d068458fa931ef.tmp +139 -0
- package/coverage/junit.xml +37 -0
- package/coverage/lcov.info +139 -0
- package/lib/config.ts +133 -0
- package/lib/error.ts +6 -0
- package/lib/logger.ts +40 -0
- package/package.json +26 -3
- package/tsconfig.json +35 -0
package/.gitlab-ci.yml
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
stages:
|
|
2
|
+
- test
|
|
3
|
+
- publish
|
|
4
|
+
- release
|
|
5
|
+
|
|
6
|
+
workflow:
|
|
7
|
+
rules:
|
|
8
|
+
- if: $CI_COMMIT_BRANCH
|
|
9
|
+
- if: $CI_COMMIT_TAG
|
|
10
|
+
|
|
11
|
+
.base: &default
|
|
12
|
+
image: oven/bun:debian
|
|
13
|
+
before_script:
|
|
14
|
+
- apt-get update -y > /dev/null
|
|
15
|
+
- apt-get install -qy git curl jq build-essential just glab > /dev/null
|
|
16
|
+
- curl -sSf https://sh.rustup.rs | bash -s -- -y -q > /dev/null
|
|
17
|
+
- . "$HOME/.cargo/env"
|
|
18
|
+
- bun install --quiet
|
|
19
|
+
|
|
20
|
+
variables:
|
|
21
|
+
GLAB_NPM_REG: ${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/
|
|
22
|
+
VERSION_REGEX: /^v\d+\.\d+\.\d+(-\S*)?$/
|
|
23
|
+
|
|
24
|
+
test:
|
|
25
|
+
<<: *default
|
|
26
|
+
stage: test
|
|
27
|
+
|
|
28
|
+
rules:
|
|
29
|
+
- if: $CI_COMMIT_TAG || $CI_COMMIT_MESSAGE =~ $VERSION_REGEX
|
|
30
|
+
when: never
|
|
31
|
+
- if: $CI_COMMIT_BRANCH
|
|
32
|
+
when: always
|
|
33
|
+
|
|
34
|
+
allow_failure: false
|
|
35
|
+
|
|
36
|
+
script:
|
|
37
|
+
- bun test
|
|
38
|
+
- sed 's/amp;//' coverage/junit.xml > coverage/junit.xml.tmp # remove amp; from junit report to prevent gitlab parsing issues
|
|
39
|
+
- mv coverage/junit.xml.tmp coverage/junit.xml # make the change permanent
|
|
40
|
+
- cargo install -q lcov2xml # used to convert lcov output to cobertura-xml for gitlab code coverage parsing
|
|
41
|
+
- lcov2xml coverage/lcov.info -o coverage/cobertura-coverage.xml
|
|
42
|
+
|
|
43
|
+
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
|
|
44
|
+
|
|
45
|
+
artifacts:
|
|
46
|
+
reports:
|
|
47
|
+
junit: ./coverage/junit.xml
|
|
48
|
+
coverage_report:
|
|
49
|
+
coverage_format: cobertura
|
|
50
|
+
path: ./coverage/cobertura-coverage.xml
|
|
51
|
+
|
|
52
|
+
publish:
|
|
53
|
+
<<: *default
|
|
54
|
+
|
|
55
|
+
stage: publish
|
|
56
|
+
|
|
57
|
+
id_tokens:
|
|
58
|
+
SIGSTORE_ID_TOKEN:
|
|
59
|
+
aud: sigstore
|
|
60
|
+
NPM_ID_TOKEN:
|
|
61
|
+
aud: "npm:registry.npmjs.org"
|
|
62
|
+
|
|
63
|
+
rules:
|
|
64
|
+
- if: $CI_COMMIT_REF_PROTECTED && $CI_COMMIT_TAG && $CI_COMMIT_TAG =~ $VERSION_REGEX
|
|
65
|
+
when: always
|
|
66
|
+
|
|
67
|
+
script:
|
|
68
|
+
- | # Setup environment variables for deployment
|
|
69
|
+
export PACKAGE_NAME=$(jq -r '.name' package.json)
|
|
70
|
+
export CURR_VER=$(jq -r '.version' package.json)
|
|
71
|
+
export LIVE_VER=$(bun info $PACKAGE_NAME version)
|
|
72
|
+
export IS_PRE_RELEASE=$(echo $CURR_VER | grep -E '[-+]')
|
|
73
|
+
export PUBLISH_FLAGS=( "--silent" )
|
|
74
|
+
|
|
75
|
+
- | # Check if the current version is already published
|
|
76
|
+
if [ "$LIVE_VER" == "$CURR_VER" ]; then
|
|
77
|
+
echo "Version $CURR_VER is already published. Skipping deployment."
|
|
78
|
+
exit 9001
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
- bun pm pack --filename package.tgz
|
|
82
|
+
- |
|
|
83
|
+
if [ $IS_PRE_RELEASE ]; then
|
|
84
|
+
echo "Pre-release version detected. Publishing with 'next' tag."
|
|
85
|
+
PUBLISH_FLAGS+=( "--tag=next" )
|
|
86
|
+
fi
|
|
87
|
+
- bunx npm publish ${PUBLISH_FLAGS[*]} package.tgz
|
|
88
|
+
- sh ci/npm.sh
|
|
89
|
+
- bun publish ${PUBLISH_FLAGS[*]} package.tgz
|
|
90
|
+
- sleep 15 # wait for the package to be available in the registry
|
|
91
|
+
|
|
92
|
+
after_script:
|
|
93
|
+
- |
|
|
94
|
+
export GLAB_DATA=$(glab api "projects/:id/packages?order_by=created_at&sort=asc" | jq .[-1])
|
|
95
|
+
export GLAB_PACKAGE_URL=$(echo $GLAB_DATA | jq ._links.web_path)
|
|
96
|
+
export VERSION_NUMBER=$(echo $GLAB_DATA | jq .version)
|
|
97
|
+
|
|
98
|
+
echo "GLAB_PACKAGE_URL=$GLAB_PACKAGE_URL" >> variables.env
|
|
99
|
+
echo "VERSION_NUMBER=$VERSION_NUMBER" >> variables.env
|
|
100
|
+
artifacts:
|
|
101
|
+
reports:
|
|
102
|
+
dotenv: variables.env
|
|
103
|
+
allow_failure:
|
|
104
|
+
exit_codes:
|
|
105
|
+
- 9001
|
|
106
|
+
|
|
107
|
+
release:
|
|
108
|
+
stage: release
|
|
109
|
+
|
|
110
|
+
image: registry.gitlab.com/gitlab-org/cli:latest
|
|
111
|
+
|
|
112
|
+
rules:
|
|
113
|
+
- if: $CI_COMMIT_REF_PROTECTED && $CI_COMMIT_TAG && $CI_COMMIT_TAG =~ $VERSION_REGEX
|
|
114
|
+
|
|
115
|
+
needs:
|
|
116
|
+
- job: publish
|
|
117
|
+
artifacts: true
|
|
118
|
+
|
|
119
|
+
script:
|
|
120
|
+
- glab changelog generate > CHANGELOG.md
|
|
121
|
+
|
|
122
|
+
release:
|
|
123
|
+
name: "Release $CI_COMMIT_TAG"
|
|
124
|
+
tag_name: '$CI_COMMIT_TAG'
|
|
125
|
+
description: CHANGELOG.md
|
|
126
|
+
assets:
|
|
127
|
+
links:
|
|
128
|
+
- name: "General NPM Registry Release"
|
|
129
|
+
url: "https://www.npmjs.com/package/@$CI_PROJECT_PATH/v/$VERSION_NUMBER"
|
|
130
|
+
link_type: package
|
|
131
|
+
- name: "GitLab Package Registry Release"
|
|
132
|
+
url: "https://gitlab.com$GLAB_PACKAGE_URL"
|
|
133
|
+
link_type: package
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$" />
|
|
5
|
+
<orderEntry type="inheritedJdk" />
|
|
6
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
+
</component>
|
|
8
|
+
</module>
|
package/.idea/vcs.xml
ADDED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
## [HEAD]
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
- Fix some things by @benshawmean
|
|
5
|
+
- Correct changelogs again by @benshawmean
|
|
6
|
+
|
|
7
|
+
### Documentation
|
|
8
|
+
- Update changelog by @benshawmean
|
|
9
|
+
|
|
10
|
+
### Refactor
|
|
11
|
+
- Change "Unreleased" to "HEAD" on changelog by @benshawmean
|
|
12
|
+
|
|
13
|
+
## [1.3.5] - 2026-09-05
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
- Make changelog on the fly by @benshawmean
|
|
17
|
+
- Fix rules for release by @benshawmean
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- V1.3.5 by @benshawmean
|
|
21
|
+
|
|
22
|
+
### Documentation
|
|
23
|
+
- Update changelog by @benshawmean
|
|
24
|
+
|
|
25
|
+
### Refactor
|
|
26
|
+
- Extend ci config by @benshawmean
|
|
27
|
+
|
|
28
|
+
## [1.3.4] - 2026-09-05
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
- Fix "before_script" from failing by @benshawmean
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
- Make some needed changes by @benshawmean
|
|
35
|
+
- V1.3.4 by @benshawmean
|
|
36
|
+
|
|
37
|
+
## [1.3.3] - 2026-09-05
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
- Add in automated release pipelines by @benshawmean
|
|
41
|
+
|
|
42
|
+
### Bug Fixes
|
|
43
|
+
- Ensure that the process is running with bun by @benshawmean
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
- Show how to add JSON support by @benshawmean
|
|
47
|
+
- V1.3.3 by @benshawmean
|
|
48
|
+
|
|
49
|
+
### Documentation
|
|
50
|
+
- Add documentation for JetBrains IDE by @benshawmean
|
|
51
|
+
|
|
52
|
+
## [1.3.2-2] - 2026-08-20
|
|
53
|
+
|
|
54
|
+
### Bug Fixes
|
|
55
|
+
- Fix ci/cd pipeline by @benshawmean
|
|
56
|
+
|
|
57
|
+
### Changed
|
|
58
|
+
- V1.3.2-2 by @benshawmean
|
|
59
|
+
|
|
60
|
+
## [1.3.2-1] - 2026-08-20
|
|
61
|
+
|
|
62
|
+
### Changed
|
|
63
|
+
- V1.3.2-1 by @benshawmean
|
|
64
|
+
|
|
65
|
+
### Continuous Integration
|
|
66
|
+
- Fix deploy tags by @benshawmean
|
|
67
|
+
|
|
68
|
+
## [1.3.2-0] - 2026-08-20
|
|
69
|
+
|
|
70
|
+
### Changed
|
|
71
|
+
- V1.3.2-0 by @benshawmean
|
|
72
|
+
|
|
73
|
+
### Refactor
|
|
74
|
+
- Refactor by @benshawmean
|
|
75
|
+
|
|
76
|
+
## [1.3.1] - 2026-08-20
|
|
77
|
+
|
|
78
|
+
### Changed
|
|
79
|
+
- V1.3.1 by @benshawmean
|
|
80
|
+
|
|
81
|
+
### Refactor
|
|
82
|
+
- Do some refactoring of the code to ensure everything works properly by @benshawmean
|
|
83
|
+
- Refactor(test) by @benshawmean
|
|
84
|
+
|
|
85
|
+
## [1.3.0] - 2026-08-19
|
|
86
|
+
|
|
87
|
+
### Changed
|
|
88
|
+
- I hate testing stuff oml by @benshawmean
|
|
89
|
+
- Only print failures by @benshawmean
|
|
90
|
+
- V1.3.0 by @benshawmean
|
|
91
|
+
|
|
92
|
+
## [1.2.3] - 2026-08-16
|
|
93
|
+
|
|
94
|
+
### Changed
|
|
95
|
+
- Edit README.md by @benshawmean
|
|
96
|
+
- V1.2.3 by @benshawmean
|
|
97
|
+
|
|
98
|
+
### Refactor
|
|
99
|
+
- Update logging utilities by @benshawmean
|
|
100
|
+
|
|
101
|
+
### New Contributors
|
|
102
|
+
* @benshawmean made their first contribution
|
|
103
|
+
|
|
104
|
+
## [1.2.2] - 2026-08-09
|
|
105
|
+
|
|
106
|
+
### Changed
|
|
107
|
+
- V1.2.2 by @benshawmean
|
|
108
|
+
|
|
109
|
+
### Continuous Integration
|
|
110
|
+
- Try and fix CI pipelines by @benshawmean
|
|
111
|
+
|
|
112
|
+
## [1.2.1] - 2026-08-08
|
|
113
|
+
|
|
114
|
+
### Changed
|
|
115
|
+
- Try and get this to work because otherwise its gonna piss me off by @benshawmean
|
|
116
|
+
- V1.2.1 by @benshawmean
|
|
117
|
+
|
|
118
|
+
## [1.2.0] - 2026-08-08
|
|
119
|
+
|
|
120
|
+
### Changed
|
|
121
|
+
- Lets try this one more time by @benshawmean
|
|
122
|
+
- V1.2.0 by @benshawmean
|
|
123
|
+
|
|
124
|
+
## [1.1.4] - 2026-08-08
|
|
125
|
+
|
|
126
|
+
### Changed
|
|
127
|
+
- Try and fix the issue by @benshawmean
|
|
128
|
+
- V1.1.4 by @benshawmean
|
|
129
|
+
|
|
130
|
+
### Removed
|
|
131
|
+
- Remove "semver.ts" as Bun natively handles version bumping by @benshawmean
|
|
132
|
+
|
|
133
|
+
## [1.1.3] - 2026-08-08
|
|
134
|
+
|
|
135
|
+
### Changed
|
|
136
|
+
- Do some more changes to reduce the size of the package by @benshawmean
|
|
137
|
+
- V1.1.3 by @benshawmean
|
|
138
|
+
|
|
139
|
+
### Continuous Integration
|
|
140
|
+
- Make the code a bit more readable by @benshawmean
|
|
141
|
+
- Disable testing on tag pushes by @benshawmean
|
|
142
|
+
- Add some more checks by @benshawmean
|
|
143
|
+
- Try and fix CI prevention by @benshawmean
|
|
144
|
+
- Allow global multiline checks by @benshawmean
|
|
145
|
+
- Fix regex by @benshawmean
|
|
146
|
+
- Try to fix ci prevention by @benshawmean
|
|
147
|
+
|
|
148
|
+
## [1.1.2] - 2026-08-08
|
|
149
|
+
|
|
150
|
+
### Added
|
|
151
|
+
- Add in automated deployment systems into the pipeline by @benshawmean
|
|
152
|
+
|
|
153
|
+
### Bug Fixes
|
|
154
|
+
- Fix some bugs with selecting active enviornments by @benshawmean
|
|
155
|
+
- Fix package.json by @benshawmean
|
|
156
|
+
|
|
157
|
+
### Changed
|
|
158
|
+
- Initial Commit by @benshawmean
|
|
159
|
+
- Prepare deployment for the code! by @benshawmean
|
|
160
|
+
- Make executable by @benshawmean
|
|
161
|
+
- Try again! by @benshawmean
|
|
162
|
+
- This is pissing me off by @benshawmean
|
|
163
|
+
- Try and prepare new pipeline maybe? by @benshawmean
|
|
164
|
+
- Allow for better release deployments using a singular connection by @benshawmean
|
|
165
|
+
- Try to do more fixes by @benshawmean
|
|
166
|
+
- V1.1.2 by @benshawmean
|
|
167
|
+
|
|
168
|
+
### Documentation
|
|
169
|
+
- Fix up some documentation and other files to make the project look cleaner by @benshawmean
|
|
170
|
+
|
|
171
|
+
### Refactor
|
|
172
|
+
- Handle saving and loading config files within the Config class by @benshawmean
|
|
173
|
+
- (refactor) by @benshawmean
|
|
174
|
+
|
|
175
|
+
### Testing
|
|
176
|
+
- Add in testing abilities by @benshawmean
|
|
177
|
+
|
|
178
|
+
### New Contributors
|
|
179
|
+
* @benshawmean made their first contribution
|
|
180
|
+
|
|
181
|
+
[HEAD]: https://gitlab.com/benshawmean/EnvEdit/-/compare/v1.3.5...HEAD
|
|
182
|
+
[1.3.5]: https://gitlab.com/benshawmean/EnvEdit/-/compare/v1.3.4...v1.3.5
|
|
183
|
+
[1.3.4]: https://gitlab.com/benshawmean/EnvEdit/-/compare/v1.3.3...v1.3.4
|
|
184
|
+
[1.3.3]: https://gitlab.com/benshawmean/EnvEdit/-/compare/v1.3.2-2...v1.3.3
|
|
185
|
+
[1.3.2-2]: https://gitlab.com/benshawmean/EnvEdit/-/compare/v1.3.2-1...v1.3.2-2
|
|
186
|
+
[1.3.2-1]: https://gitlab.com/benshawmean/EnvEdit/-/compare/v1.3.2-0...v1.3.2-1
|
|
187
|
+
[1.3.2-0]: https://gitlab.com/benshawmean/EnvEdit/-/compare/v1.3.1...v1.3.2-0
|
|
188
|
+
[1.3.1]: https://gitlab.com/benshawmean/EnvEdit/-/compare/v1.3.0...v1.3.1
|
|
189
|
+
[1.3.0]: https://gitlab.com/benshawmean/EnvEdit/-/compare/v1.2.3...v1.3.0
|
|
190
|
+
[1.2.3]: https://gitlab.com/benshawmean/EnvEdit/-/compare/v1.2.2...v1.2.3
|
|
191
|
+
[1.2.2]: https://gitlab.com/benshawmean/EnvEdit/-/compare/v1.2.1...v1.2.2
|
|
192
|
+
[1.2.1]: https://gitlab.com/benshawmean/EnvEdit/-/compare/v1.2.0...v1.2.1
|
|
193
|
+
[1.2.0]: https://gitlab.com/benshawmean/EnvEdit/-/compare/v1.1.4...v1.2.0
|
|
194
|
+
[1.1.4]: https://gitlab.com/benshawmean/EnvEdit/-/compare/v1.1.3...v1.1.4
|
|
195
|
+
[1.1.3]: https://gitlab.com/benshawmean/EnvEdit/-/compare/v1.1.2...v1.1.3
|
|
196
|
+
|