Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Consistent handling of environment variables #5663

Merged
Changes from 1 commit
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
1ec3064
feat: Add env config object
elliott-with-the-longest-name-on-github Jul 17, 2022
2b5e0c4
feat: Added types
elliott-with-the-longest-name-on-github Jul 17, 2022
91d0413
feat: Add .d.ts import to tsconfig
elliott-with-the-longest-name-on-github Jul 18, 2022
12a3fd1
feat: Generate env var dump code
elliott-with-the-longest-name-on-github Jul 18, 2022
498d4f2
fix: imports
elliott-with-the-longest-name-on-github Jul 21, 2022
5d4960d
Merge branch 'master' into 4296/sejohnson-environment-variables
elliott-with-the-longest-name-on-github Jul 21, 2022
08600df
fix: Remove old error mechanism
elliott-with-the-longest-name-on-github Jul 21, 2022
d5baa47
feat: Rough edges of server-side module protection
elliott-with-the-longest-name-on-github Jul 21, 2022
87b3760
fix: Performance and add Vite overlay
elliott-with-the-longest-name-on-github Jul 21, 2022
27b7cee
feat: First full draft of static environment vars
elliott-with-the-longest-name-on-github Jul 21, 2022
42ac833
fix unit tests
Rich-Harris Jul 21, 2022
6522e56
fix: Rich is smarter than I am
elliott-with-the-longest-name-on-github Jul 22, 2022
fb88ba9
Merge branch '4296/sejohnson-environment-variables' of github.com:tcc…
elliott-with-the-longest-name-on-github Jul 22, 2022
736e1f3
feat: Let know about Vite mode
elliott-with-the-longest-name-on-github Jul 22, 2022
9c1381a
feat: Added to sync CLI
elliott-with-the-longest-name-on-github Jul 22, 2022
351c4cb
feat: Added runtime variable support
elliott-with-the-longest-name-on-github Jul 22, 2022
944ff73
feat: Make server.init multicalls a noop
elliott-with-the-longest-name-on-github Jul 22, 2022
a040078
feat: Set runtime env in preview
elliott-with-the-longest-name-on-github Jul 22, 2022
34801e1
this doesn't work?!: Set runtime env in dev
elliott-with-the-longest-name-on-github Jul 22, 2022
035a2cd
feat: Added runtime env handler to cloudflare for testing
elliott-with-the-longest-name-on-github Jul 22, 2022
48f8cba
Update packages/kit/src/cli.js
Rich-Harris Jul 22, 2022
61e3a67
Update packages/kit/src/core/sync/write_env.js
Rich-Harris Jul 22, 2022
1e6906a
Update packages/kit/src/core/sync/write_env.js
Rich-Harris Jul 22, 2022
1f70c4d
Update packages/kit/src/vite/build/build_server.js
Rich-Harris Jul 22, 2022
5f41062
Update packages/kit/src/core/sync/write_env.js
Rich-Harris Jul 22, 2022
069e3dc
make mode required
Rich-Harris Jul 22, 2022
5774f08
move env/runtime to a file
Rich-Harris Jul 22, 2022
9091d2c
simplify write_env
Rich-Harris Jul 22, 2022
cf09ed7
Update packages/kit/src/vite/preview/index.js
Rich-Harris Jul 22, 2022
b7b1fca
remove unnecessary index.js suffix
Rich-Harris Jul 22, 2022
b4a1ee4
simplify
Rich-Harris Jul 22, 2022
da76b16
Merge branch '4296/sejohnson-environment-variables' of github.com:tcc…
Rich-Harris Jul 22, 2022
905ef24
tabs
Rich-Harris Jul 22, 2022
d2352b3
make init sync, make options required
Rich-Harris Jul 22, 2022
a858d19
format
Rich-Harris Jul 22, 2022
17ffba0
cast process.env
Rich-Harris Jul 22, 2022
af2b1aa
remove the overlay stuff, just throw an error
Rich-Harris Jul 22, 2022
b0477aa
just throw
Rich-Harris Jul 22, 2022
490f3fc
simplify traversal
Rich-Harris Jul 22, 2022
13bc94a
make build-time traversal more efficient
Rich-Harris Jul 22, 2022
40a6eaa
move dev code into dev module
Rich-Harris Jul 22, 2022
a1ccfa9
Merge branch 'master' into 4296/sejohnson-environment-variables
Rich-Harris Jul 22, 2022
312a7bc
always set env
Rich-Harris Jul 22, 2022
672eb85
simplify
Rich-Harris Jul 22, 2022
8ce2740
remove hard-coded .svelte-kit
Rich-Harris Jul 22, 2022
65ee08c
rename env/runtime to env/platform and get it working in dev
Rich-Harris Jul 22, 2022
133cc7a
remove outdated comment
Rich-Harris Jul 22, 2022
e56bf28
docs
Rich-Harris Jul 22, 2022
e677102
App.RuntimeEnv -> App.Env
Rich-Harris Jul 22, 2022
e5676a8
add Env interface where necessary
Rich-Harris Jul 22, 2022
f768a9c
update more adapters
Rich-Harris Jul 22, 2022
f685c40
changesets
Rich-Harris Jul 22, 2022
3ac79c5
tweak changesets
Rich-Harris Jul 22, 2022
0429f87
add a test
Rich-Harris Jul 22, 2022
79cc250
replace doc links
Rich-Harris Jul 22, 2022
b0e96f5
Merge branch 'master' into 4296/sejohnson-environment-variables
elliott-with-the-longest-name-on-github Jul 25, 2022
0614a33
fix: Invalid js identifiers skipped
elliott-with-the-longest-name-on-github Jul 25, 2022
23676f2
rename modules
Rich-Harris Jul 25, 2022
dc8086d
Merge branch 'master' into 4296/sejohnson-environment-variables
Rich-Harris Jul 25, 2022
5a43648
fix some stuff, break some stuff
Rich-Harris Jul 25, 2022
03b27b1
update tests
Rich-Harris Jul 25, 2022
ce5c113
ok i think thats almost everything
Rich-Harris Jul 25, 2022
e0dc066
oops
Rich-Harris Jul 25, 2022
ca24e31
merge master
Rich-Harris Jul 25, 2022
04c80fc
hide functions
Rich-Harris Jul 25, 2022
831c5b3
separate PrivateEnv from PublicEnv
Rich-Harris Jul 25, 2022
7f03ac7
expose entry points
Rich-Harris Jul 25, 2022
ca72f76
fix turbo config
Rich-Harris Jul 25, 2022
8d8eaa0
fix
Rich-Harris Jul 25, 2022
c8e7ab5
Update .changeset/beige-gorillas-tell.md
Rich-Harris Jul 25, 2022
84d06f4
Update packages/kit/src/runtime/env-public.js
Rich-Harris Jul 25, 2022
caf7cab
Update packages/kit/src/runtime/env-private.js
Rich-Harris Jul 25, 2022
3416554
Update packages/kit/src/runtime/env-public.js
Rich-Harris Jul 25, 2022
6264418
Update packages/kit/src/runtime/env-private.js
Rich-Harris Jul 25, 2022
d7a4159
Update packages/kit/src/core/sync/sync.js
Rich-Harris Jul 25, 2022
c53600f
Update packages/kit/src/vite/utils.js
Rich-Harris Jul 25, 2022
96c7a4a
Update packages/kit/src/vite/utils.js
Rich-Harris Jul 25, 2022
eb34e95
Update packages/kit/test/apps/basics/.env
Rich-Harris Jul 25, 2022
63f6604
Update packages/kit/test/apps/basics/.gitignore
Rich-Harris Jul 25, 2022
4449fb2
write_env in init, not update
Rich-Harris Jul 25, 2022
38025be
lint
Rich-Harris Jul 25, 2022
c9d222a
simplify valid identifier check, allow exports of reserved words
Rich-Harris Jul 25, 2022
a08d383
move types/ambient.d.ts to ambient.d.ts so it doesnt get nuked on update
Rich-Harris Jul 25, 2022
d2b10d9
Update documentation/docs/15-configuration.md
Rich-Harris Jul 26, 2022
5253136
remove env vars FAQ
Rich-Harris Jul 26, 2022
2d203db
feat: Testing for import analysis
elliott-with-the-longest-name-on-github Jul 26, 2022
bdffe39
Update packages/kit/types/ambient.d.ts
Rich-Harris Jul 26, 2022
b5cabd0
warn if env vars are invalid
Rich-Harris Jul 26, 2022
ec655c9
Merge branch '4296/sejohnson-environment-variables' of github.com:tcc…
Rich-Harris Jul 26, 2022
fd65c1e
oops
Rich-Harris Jul 26, 2022
26ad507
argh
Rich-Harris Jul 26, 2022
9c56f37
Update packages/kit/scripts/extract-types.js
Rich-Harris Jul 26, 2022
30f98f0
explain why we strip the origin
Rich-Harris Jul 26, 2022
92a1559
Update packages/kit/types/ambient.d.ts
Rich-Harris Jul 26, 2022
c1a5d52
temporarily disable
Rich-Harris Jul 26, 2022
9499d83
Merge branch '4296/sejohnson-environment-variables' of github.com:tcc…
Rich-Harris Jul 26, 2022
b2d41ac
Revert "temporarily disable"
Rich-Harris Jul 26, 2022
5f3dc7b
tidy up
Rich-Harris Jul 26, 2022
f257a0e
remove another unused import
Rich-Harris Jul 26, 2022
3c15b90
Update packages/kit/src/vite/utils.js
elliott-with-the-longest-name-on-github Jul 26, 2022
49ecafd
Update packages/kit/src/vite/utils.js
elliott-with-the-longest-name-on-github Jul 26, 2022
06fcd1c
Update packages/kit/src/vite/utils.js
elliott-with-the-longest-name-on-github Jul 26, 2022
4a17268
Update packages/kit/src/vite/utils.js
elliott-with-the-longest-name-on-github Jul 26, 2022
a5e3a87
Update packages/kit/src/core/sync/write_env.js
elliott-with-the-longest-name-on-github Jul 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix unit tests
  • Loading branch information
Rich-Harris committed Jul 21, 2022
commit 42ac833a2c0aa25c4095d0073beb011076f724dc
3 changes: 3 additions & 0 deletions packages/kit/src/core/config/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ const get_defaults = (prefix = '') => ({
reportOnly: directive_defaults
},
endpointExtensions: undefined,
env: {
publicPrefix: 'PUBLIC_'
},
files: {
assets: join(prefix, 'static'),
hooks: join(prefix, 'src/hooks'),
Expand Down