@benshawmean/envedit 1.3.2-2 → 1.3.3

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 CHANGED
@@ -83,8 +83,34 @@ publish:
83
83
  - bunx npm publish ${PUBLISH_FLAGS[*]} package.tgz
84
84
  - sh ci/npm.sh
85
85
  - bun publish ${PUBLISH_FLAGS[*]} package.tgz
86
- - rm package.tgz .npmrc
87
-
86
+ after_script:
87
+ - echo "Preparing environment variables for release job"
88
+ - echo "PACKAGE_NAME=$PACKAGE_NAME" >> variables.env
89
+ - echo "CURR_VER=$CURR_VER" >> variables.env
90
+ - echo "IS_PRE_RELEASE=$IS_PRE_RELEASE" >> variables.env
91
+ artifacts:
92
+ reports:
93
+ dotenv: variables.env
88
94
  allow_failure:
89
95
  exit_codes:
90
96
  - 9001
97
+
98
+ release:
99
+ stage: publish
100
+ image: registry.gitlab.com/gitlab-org/cli:latest
101
+ rules:
102
+ - if: $CI_COMMIT_REF_PROTECTED && $CI_COMMIT_TAG && $CI_COMMIT_TAG =~ $VERSION_REGEX
103
+ when: always
104
+ needs:
105
+ - job: publish
106
+ artifacts: true
107
+ script:
108
+ - echo "running release_job"
109
+ release: # See https://docs.gitlab.com/ci/yaml/#release for available properties
110
+ tag_name: '$CI_COMMIT_TAG'
111
+ description: '$CI_COMMIT_TAG'
112
+ assets:
113
+ links:
114
+ - name: "General NPM Registry Release"
115
+ url: "https://www.npmjs.com/package/$PACKAGE_NAME/v/$CI_COMMIT_TAG"
116
+ link_type: package
package/README.md CHANGED
@@ -51,6 +51,47 @@ and selecting the environment you want to use from the list of available environ
51
51
  envedit use
52
52
  ```
53
53
 
54
+ ## Schema
55
+
56
+ I have released a JSON Schema spec. file for the outputted file. It can be found at <https://benshawmean.com/api/schema/envedit>.
57
+
58
+
59
+ ### IDE Support for Schema
60
+
61
+ To add validation and description support for the schema, please try the following things:
62
+
63
+ #### VSCode
64
+
65
+ For VSCode (and/or VSCode Insiders), add the following to your `settings.json` file:
66
+
67
+ ```json
68
+ "json.schemaDownload.trustedDomains": {
69
+ "https://benshawmean.com/": true,
70
+ },
71
+ "json.schemas": [
72
+ {
73
+ "fileMatch": ["**/env.config.yaml"],
74
+ "url": "https://benshawmean.com/api/schema/envedit",
75
+ }
76
+ ],
77
+ "yaml.schemas": {
78
+ "https://benshawmean.com/api/schema/envedit": "**/env.config.yaml"
79
+ }
80
+ ```
81
+
82
+ #### JetBrains IDEs
83
+
84
+ For JetBrains IDEs, you can do this by doing these steps:
85
+
86
+ 1. In Settings, head to Languages & Frameworks > Schemas and DTDs > JSON Schema Mappings
87
+ 2. Click the + (Add) icon
88
+ 3. Name your mapping "EnvEdit"
89
+ 4. Provide the URL `https://benshawmean.com/api/schema/envedit`
90
+ 5. Define the file path pattern `**/env.config.yaml`
91
+ 6. Click OK
92
+
93
+ Do note that this is on a project level, so you will need to do this for each project you want to use the schema in.
94
+
54
95
  ## License
55
96
 
56
97
  This project is licensed under the GNU General Public License version 3.
package/cli/index.ts CHANGED
@@ -2,7 +2,11 @@
2
2
  import yargs from "yargs";
3
3
  import { hideBin } from "yargs/helpers";
4
4
 
5
- import Commands from "./cmd";
5
+ if (!process.isBun) {
6
+ const [red, reset] = process.stdout.isTTY && process.env.TERM !== "dumb" ? ["\x1b[31m", "\x1b[0m"] : ["", ""];
7
+ console.error(`${red}This script is intended to be run with Bun.${reset}`);
8
+ process.exit(1);
9
+ }
6
10
 
7
11
  await yargs(hideBin(process.argv))
8
12
  .option("level", {
@@ -14,7 +18,7 @@ await yargs(hideBin(process.argv))
14
18
  .env('ENVEDIT')
15
19
  .scriptName("envedit")
16
20
  .usage("Usage: $0 <command>")
17
- .command(Commands)
21
+ .command(await import("./cmd/index.ts").then((mod) => mod.default))
18
22
  .showHelpOnFail(false)
19
23
  .demandCommand()
20
24
  .strict()
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@benshawmean/envedit",
3
3
  "type": "module",
4
- "version": "1.3.2-2",
4
+ "version": "1.3.3",
5
5
  "license": "GPL-3.0-only",
6
6
  "bin": {
7
7
  "envedit": "cli/index.ts"