proscenium 0.3.0-x86_64-darwin → 0.4.0-x86_64-darwin

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41451bb7fb99e0c3a26cc8e9e76e9db9da134f027c6178b504eb6241066e4617
4
- data.tar.gz: 7ed47753820edebfc0f38a95030af31d02ce5b8290cbf5e48febe289a5db71f5
3
+ metadata.gz: 54ddf55fd6c20a856e61b1f222e8e4f1d8303e4bd88463c9223b8d54622e33c4
4
+ data.tar.gz: bd8c252fde1430c7cd42245236bb7614e804757942c3ef648bb6fc2aef7482ef
5
5
  SHA512:
6
- metadata.gz: cc0b1bda992c1b2e0e740d7089e0c229bccf65c34b8254a8603cf040337d4ce1353856397c9fef2487fbed7daee5b08d459bed835d20fdc7f469dc9d026e7209
7
- data.tar.gz: 14024fd83e150ddcd6352a607c7f8696de46595d4db00a5a27928cc2cd4c0a2ce16804fb2ea0e06ada793c3fa42ff7771def88becd9777d2d8a00df76a44f6c3
6
+ metadata.gz: 6f75e1940f5043a58e81a42f281ff69907bb9f2f9c445fb657cc2fcc4f1c818189014ad09fe3a4084ea28696f61dfbffff9edc4d0e869cfdd9299b7ae69a3bc4
7
+ data.tar.gz: 74ffaf1ab753b60e82e851522664964549c8d41608bfdc81a5466f6ef419419947f1d476a21bdda7e0e65a41bec46c81323dbcd74bde601a4ebc8731c35c2f7c
data/bin/esbuild CHANGED
Binary file
@@ -1,10 +1,13 @@
1
1
  import setup from './setup_plugin.js'
2
2
 
3
+ // Export environment variables as named exports only. You can also import from `env:ENV_VAR_NAME`,
4
+ // which will return the value of the environment variable as the default export. This allows you to
5
+ // safely import a variable regardless of its existence.
3
6
  export default setup('env', () => {
4
7
  return [
5
8
  {
6
9
  type: 'onResolve',
7
- filter: /^env$/,
10
+ filter: /^env(:.+)?$/,
8
11
  callback({ path }) {
9
12
  return { path, namespace: 'env' }
10
13
  }
@@ -14,9 +17,27 @@ export default setup('env', () => {
14
17
  type: 'onLoad',
15
18
  filter: /.*/,
16
19
  namespace: 'env',
17
- callback() {
20
+ callback({ path }) {
21
+ if (path.includes(':')) {
22
+ return {
23
+ loader: 'js',
24
+ contents: `export default ${Deno.env.get(path.split(':')[1])}`
25
+ }
26
+ }
27
+
18
28
  const env = Deno.env.toObject()
19
- return { loader: 'json', contents: JSON.stringify(env) }
29
+ const contents = []
30
+
31
+ for (const key in env) {
32
+ if (Object.hasOwnProperty.call(env, key)) {
33
+ contents.push(`export const ${key} = '${env[key]}'`)
34
+ }
35
+ }
36
+
37
+ return {
38
+ loader: 'js',
39
+ contents: contents.join(';')
40
+ }
20
41
  }
21
42
  }
22
43
  ]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Proscenium
4
- VERSION = '0.3.0'
4
+ VERSION = '0.4.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proscenium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: x86_64-darwin
6
6
  authors:
7
7
  - Joel Moss
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-28 00:00:00.000000000 Z
11
+ date: 2022-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actioncable