@benshawmean/envedit 1.1.0 → 1.1.2
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 +41 -20
- package/LICENSE +674 -0
- package/README.md +47 -5
- package/cmd/environment/add.ts +110 -0
- package/cmd/environment/edit.ts +82 -0
- package/cmd/environment/list.ts +19 -0
- package/cmd/environment/remove.ts +50 -0
- package/cmd/environment.ts +21 -0
- package/cmd/setup.ts +64 -0
- package/cmd/use.ts +62 -0
- package/cmd/variable/add.ts +94 -0
- package/cmd/variable/edit.ts +161 -0
- package/cmd/variable/list.ts +43 -0
- package/cmd/variable/remove.ts +44 -0
- package/cmd/variable.ts +21 -0
- package/index.ts +14 -555
- package/lib/config.ts +15 -6
- package/lib/logger.ts +15 -0
- package/package.json +5 -2
- package/tsconfig.json +6 -1
- package/bun.lock +0 -118
- package/bunfig.toml +0 -13
- package/test/index.test.ts +0 -0
package/.gitlab-ci.yml
CHANGED
|
@@ -1,44 +1,65 @@
|
|
|
1
1
|
stages:
|
|
2
2
|
- test
|
|
3
|
-
- build
|
|
4
3
|
- deploy
|
|
5
4
|
|
|
6
5
|
workflow:
|
|
7
6
|
rules:
|
|
8
7
|
- if: $CI_COMMIT_BRANCH
|
|
8
|
+
- if: $CI_COMMIT_TAG
|
|
9
9
|
|
|
10
10
|
default:
|
|
11
11
|
image: oven/bun:debian
|
|
12
12
|
before_script:
|
|
13
13
|
- apt-get update -y > /dev/null
|
|
14
|
-
- apt-get install -qy git curl > /dev/null
|
|
15
|
-
-
|
|
14
|
+
- apt-get install -qy git curl jq build-essential > /dev/null
|
|
15
|
+
- curl -sSf https://sh.rustup.rs | bash -s -- -y -q > /dev/null
|
|
16
|
+
- . "$HOME/.cargo/env"
|
|
17
|
+
- bun install --quiet
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
stage:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
|
|
19
|
+
test:
|
|
20
|
+
stage: test
|
|
21
|
+
script:
|
|
22
|
+
- bun test
|
|
23
|
+
- sed 's/amp;//' coverage/junit.xml > coverage/junit.xml.tmp # remove amp; from junit report to prevent gitlab parsing issues
|
|
24
|
+
- mv coverage/junit.xml.tmp coverage/junit.xml # make the change permanent
|
|
25
|
+
- cargo install -q lcov2xml # used to convert lcov output to cobertura-xml for gitlab code coverage parsing
|
|
26
|
+
- lcov2xml coverage/lcov.info -o coverage/cobertura-coverage.xml
|
|
27
|
+
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
|
|
28
|
+
artifacts:
|
|
29
|
+
reports:
|
|
30
|
+
junit: ./coverage/junit.xml
|
|
31
|
+
coverage_report:
|
|
32
|
+
coverage_format: cobertura
|
|
33
|
+
path: ./coverage/cobertura-coverage.xml
|
|
25
34
|
|
|
26
|
-
deploy
|
|
27
|
-
|
|
28
|
-
# Bun seems to struggle publishing to npm on the CI job, so we'll use npm for this one
|
|
29
|
-
image: node:latest
|
|
30
|
-
before_script: [] # skip the default before_script
|
|
35
|
+
deploy:
|
|
36
|
+
stage: deploy
|
|
31
37
|
id_tokens:
|
|
32
38
|
SIGSTORE_ID_TOKEN:
|
|
33
39
|
aud: sigstore
|
|
34
40
|
NPM_ID_TOKEN:
|
|
35
41
|
aud: "npm:registry.npmjs.org"
|
|
42
|
+
rules:
|
|
43
|
+
- if: $CI_COMMIT_REF_PROTECTED && $CI_COMMIT_TAG && $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+(-\S*)?$/
|
|
36
44
|
script:
|
|
37
|
-
-
|
|
45
|
+
- |
|
|
46
|
+
export PACKAGE_NAME=$(jq -r '.name' package.json)
|
|
47
|
+
export CURR_VER=$(jq -r '.version' package.json)
|
|
48
|
+
export LIVE_VER=$(bun info $PACKAGE_NAME version)
|
|
49
|
+
if [ "$LIVE_VER" == "$CURR_VER" ]; then
|
|
50
|
+
echo "Version $CURR_VER is already published. Skipping deployment."
|
|
51
|
+
exit 9001
|
|
52
|
+
fi
|
|
38
53
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
54
|
+
- bun pm pack --filename package.tgz
|
|
55
|
+
|
|
56
|
+
# Publish the package to npm
|
|
57
|
+
- bunx npm publish package.tgz
|
|
58
|
+
|
|
59
|
+
# Publish the package to GitLab's npm registry
|
|
42
60
|
- echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}" > .npmrc
|
|
43
61
|
- echo "@benshawmean:registry=https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/" >> .npmrc
|
|
44
62
|
- bun publish
|
|
63
|
+
allow_failure:
|
|
64
|
+
exit_codes:
|
|
65
|
+
- 9001
|