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

Vite Bundler v3 #173

Draft
wants to merge 440 commits into
base: release
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
440 commits
Select commit Hold shift + click to select a range
24634f3
Refactor production server to use the vite manifest for determining a…
JorgenVatle Jul 3, 2024
11547df
Remove vite assets directory in favor of retrieving it from the Vite …
JorgenVatle Jul 3, 2024
9b29b6d
Use manifest for determining asset file paths
JorgenVatle Jul 3, 2024
b73d84f
Remove unused base url environment variables
JorgenVatle Jul 3, 2024
3fb9cca
Set crossorigin attribute on module imports
JorgenVatle Jul 3, 2024
ab20dd7
Re-add url configs to plugin settings
JorgenVatle Jul 3, 2024
258a897
Infer base and assets dirs from plugin config
JorgenVatle Jul 3, 2024
668af3d
Avoid appending asset dir on base url
JorgenVatle Jul 3, 2024
05d7c1e
docs(changeset): Use Vite plugin configuration instead of build-time …
JorgenVatle Jul 3, 2024
cd41e0e
Merge remote-tracking branch 'origin/v3' into v3
JorgenVatle Jul 3, 2024
83857e2
RELEASING: Releasing 1 package(s)
github-actions[bot] Jul 3, 2024
f59fd28
Version Packages (next)
github-actions[bot] Jul 3, 2024
2108cbb
Merge pull request #170 from JorgenVatle/changeset-release/v3
JorgenVatle Jul 3, 2024
079d1d7
docs(changeset): Use Vite plugin configuration instead of build-time …
JorgenVatle Jul 3, 2024
97136b2
Merge remote-tracking branch 'origin/v3' into v3
JorgenVatle Jul 3, 2024
322135e
RELEASING: Releasing 1 package(s)
github-actions[bot] Jul 3, 2024
0f9112e
Version Packages (next)
github-actions[bot] Jul 3, 2024
c5a03f5
Merge pull request #171 from JorgenVatle/changeset-release/v3
JorgenVatle Jul 3, 2024
06d2fda
Add type declaration for static files
JorgenVatle Jul 3, 2024
32364e6
Fix type declaration for static files
JorgenVatle Jul 3, 2024
6752b90
Patch cacheable trait in memory instead of trying to write to a poten…
JorgenVatle Jul 3, 2024
98ca33a
docs(changeset): Patch cacheable files in memory instead of trying to…
JorgenVatle Jul 3, 2024
39f6631
RELEASING: Releasing 1 package(s)
github-actions[bot] Jul 3, 2024
f38165c
Version Packages (next)
github-actions[bot] Jul 3, 2024
d82fc08
Merge pull request #172 from JorgenVatle/changeset-release/v3
JorgenVatle Jul 3, 2024
3a59c73
Update minimum meteor-vite version
JorgenVatle Jul 3, 2024
5cbb5f2
Use debug logger for logging manifest imports
JorgenVatle Jul 3, 2024
e43a5f6
Bump package version
JorgenVatle Jul 3, 2024
cdd0b15
Use Meteor v3 base image by default
JorgenVatle Jul 4, 2024
2babc52
Use node v20 by default
JorgenVatle Jul 4, 2024
1fd5f44
Squashed 'examples/svelte/packages/svelte-meteor-data/' content from …
JorgenVatle Jul 4, 2024
e8ca48b
Merge commit '1fd5f444e7daa1f0dc4eb4d909d432db8b9600d0' as 'examples/…
JorgenVatle Jul 4, 2024
26c3c1c
Update Svelte example to Meteor v3.0-rc.4
JorgenVatle Jul 4, 2024
78b1327
Make meteor base image optional
JorgenVatle Jul 4, 2024
4a11384
Update default build args to match dockerfile defaults
JorgenVatle Jul 4, 2024
db6e519
Revert "Update default build args to match dockerfile defaults"
JorgenVatle Jul 4, 2024
cdf1379
Revert "Make meteor base image optional"
JorgenVatle Jul 4, 2024
c37a146
Use meteor-base fork by default
JorgenVatle Jul 4, 2024
f3a8429
Fix deprecated use of lowercase "as" keyword
JorgenVatle Jul 4, 2024
c57e56e
Update Vue example app to Meteor v3.0-rc.4
JorgenVatle Jul 4, 2024
4995110
Correct deprecated use of ENV keyword
JorgenVatle Jul 4, 2024
509c15f
Update Meteor v3 example to Meteor v3.0-rc.4
JorgenVatle Jul 4, 2024
b6c789d
Use default options for meteor v3 build
JorgenVatle Jul 4, 2024
894d453
Update dependencies
JorgenVatle Jul 4, 2024
a4e576e
Update dependencies and lockfile
JorgenVatle Jul 4, 2024
2590b86
Register connect handler as early as possible
JorgenVatle Jul 4, 2024
ca46d7c
Prevent error on log insertion from recursing in on itself
JorgenVatle Jul 4, 2024
73b60a2
Allow insertAsync for logs collection
JorgenVatle Jul 4, 2024
9bf5672
Merge branch 'refs/heads/release' into v3
JorgenVatle Jul 4, 2024
90e1355
Add type definition for getTextAsync()
JorgenVatle Sep 27, 2024
7c97a4e
Fix Assets issue using the new async function.
fredmaiaarantes Jul 31, 2024
2961870
Fix function return type.
fredmaiaarantes Jul 31, 2024
9474068
Shouldn't be necessary to use `as string`.
fredmaiaarantes Jul 31, 2024
20c1fe2
Handle Meteor versions without support for getTextAsync()
fredmaiaarantes Jul 31, 2024
6290956
docs(changeset): Fix issue in Meteor v3 where Assets.getText() is no …
JorgenVatle Sep 27, 2024
8a90763
Include patch log in pre-release changesets
JorgenVatle Sep 27, 2024
38b22c1
Add packosphere entry to vite-bundler package details
JorgenVatle Sep 27, 2024
5609d47
Merge pull request #190 from JorgenVatle/fix-assets-v3
JorgenVatle Sep 27, 2024
215259d
Remove patch entry from pre-release meta
JorgenVatle Sep 27, 2024
230bb89
Merge branch 'release' into sync-with-release
JorgenVatle Sep 27, 2024
072eea1
Re-add TypeScript to dependencies
JorgenVatle Sep 27, 2024
d1a9a0a
Use meteor-vite pre-release with v3 example
JorgenVatle Sep 27, 2024
43f364a
Update dependencies
JorgenVatle Sep 27, 2024
ae65ec0
Merge branch 'release' into sync-v3-with-release
JorgenVatle Sep 28, 2024
9240beb
Merge pull request #194 from JorgenVatle/sync-v3-with-release
JorgenVatle Sep 28, 2024
d16b961
RELEASING: Releasing 1 package(s)
github-actions[bot] Sep 28, 2024
53372eb
Version Packages (next)
github-actions[bot] Sep 28, 2024
4044d39
Merge pull request #175 from JorgenVatle/changeset-release/v3
JorgenVatle Sep 28, 2024
69d9e3b
Update Svelte example to Meteor v3.0.3
JorgenVatle Oct 3, 2024
120340c
Update version requirement for npm version check
JorgenVatle Oct 3, 2024
2cd8861
Add check-npm-versions to dependencies
JorgenVatle Oct 3, 2024
d799395
Convert runtime api to async/await
JorgenVatle Oct 3, 2024
ea40364
Update current time every second to look more reactive
JorgenVatle Oct 3, 2024
8ef0db3
Merge branch 'release' into v3
JorgenVatle Oct 3, 2024
ae718e0
Merge branch 'release' into v3
JorgenVatle Oct 3, 2024
57913a9
Remove (beta) notice from Meteor v3 example
JorgenVatle Oct 3, 2024
0f356d0
Remove redundant pre-release link from Meteor v3 template
JorgenVatle Oct 3, 2024
7538955
Update peer requirement for vite
JorgenVatle Oct 7, 2024
8499c6a
docs(changeset): Loosen peer dependency requirement for Vite to allow…
JorgenVatle Oct 7, 2024
e1f7d11
RELEASING: Releasing 1 package(s)
github-actions[bot] Oct 7, 2024
82ff2f3
Version Packages (next)
github-actions[bot] Oct 7, 2024
a645a27
Merge pull request #197 from JorgenVatle/changeset-release/v3
JorgenVatle Oct 7, 2024
b3e6fe6
Resolve conflicts
JorgenVatle Oct 17, 2024
8fdb791
Remove bad process import
JorgenVatle Oct 17, 2024
7ca9346
Move api into src
JorgenVatle Oct 17, 2024
35e4c42
Run test builds for v3 branch
JorgenVatle Oct 17, 2024
65014e0
Run test builds on pull requests to v3 branch
JorgenVatle Oct 17, 2024
5dbff8f
Correct logger import path
JorgenVatle Oct 17, 2024
cf66aaf
Use new ipc class for managing Vite dev server
JorgenVatle Oct 17, 2024
7deb6da
Remove unused tsup watcher from Vite dev server
JorgenVatle Oct 17, 2024
f93f7f9
Remove unused variable
JorgenVatle Oct 17, 2024
3c078f3
Merge pull request #205 from JorgenVatle/sync-staging-with-v3
JorgenVatle Oct 17, 2024
244a942
Add todo to preload all assets in the background
JorgenVatle Oct 17, 2024
836d0a1
Add preload attributes to todo
JorgenVatle Oct 17, 2024
a69885e
Prefetch non-entry JS modules with the lowest priority
JorgenVatle Oct 17, 2024
b9fd324
Prevent duplicates for lazy prefetch
JorgenVatle Oct 17, 2024
f2e0e9d
docs(changeset): Add server-bundler, use DDP for dev server IPC and p…
JorgenVatle Oct 17, 2024
9803f9b
Correct version tag for meteor-vite
JorgenVatle Oct 17, 2024
71fb68f
Expand changelog with a quick summary of the changes introduced in th…
JorgenVatle Oct 17, 2024
1ab765e
RELEASING: Releasing 2 package(s)
github-actions[bot] Oct 17, 2024
c6e0ea2
Version Packages (next)
github-actions[bot] Oct 17, 2024
88b3350
Merge pull request #206 from JorgenVatle/changeset-release/v3
JorgenVatle Oct 17, 2024
3519300
Correct path to dev server splash screen HTML
JorgenVatle Oct 17, 2024
b8f34bb
docs(changeset): Correct path to dev server splash screen HTML asset
JorgenVatle Oct 17, 2024
377b506
Merge remote-tracking branch 'origin/v3' into v3
JorgenVatle Oct 17, 2024
0de2c15
RELEASING: Releasing 1 package(s)
github-actions[bot] Oct 17, 2024
ce000fd
Version Packages (next)
github-actions[bot] Oct 17, 2024
d55495e
Merge pull request #207 from JorgenVatle/changeset-release/v3
JorgenVatle Oct 17, 2024
c0b46e5
Use official 3.0.3 release for Meteor v3
JorgenVatle Oct 17, 2024
a15ae11
Merge remote-tracking branch 'origin/v3' into v3
JorgenVatle Oct 17, 2024
25d9057
Make hostname optional in port argument matcher
JorgenVatle Oct 17, 2024
d161143
Attempt to parse Meteor port from environment
JorgenVatle Oct 17, 2024
2a0eb77
Bump version
JorgenVatle Oct 17, 2024
b02884d
Bump version
JorgenVatle Oct 17, 2024
102d71e
Merge branch 'release' into merge-release-into-v3
JorgenVatle Oct 18, 2024
6ee8bca
Fix type error
JorgenVatle Oct 18, 2024
05a6a1b
Assign response hooks in viteServer worker
JorgenVatle Oct 18, 2024
2355253
Remove old vite server module
JorgenVatle Oct 18, 2024
cbd6b20
Merge pull request #211 from JorgenVatle/merge-release-into-v3
JorgenVatle Oct 18, 2024
509c955
RELEASING: Releasing 2 package(s)
github-actions[bot] Oct 18, 2024
e3f9053
Version Packages (next)
github-actions[bot] Oct 18, 2024
ebd0bd2
Merge pull request #212 from JorgenVatle/changeset-release/v3
JorgenVatle Oct 18, 2024
934f5dc
Work around issue where runtime config isn't immediately available
JorgenVatle Oct 18, 2024
9bc0561
Copy resolver result cache when preparing temporary Meteor project
JorgenVatle Oct 18, 2024
531bacb
docs(changeset): Fix issue where global meteor runtime variable would…
JorgenVatle Oct 18, 2024
e818f52
RELEASING: Releasing 1 package(s)
github-actions[bot] Oct 18, 2024
05219c5
Version Packages (next)
github-actions[bot] Oct 18, 2024
669bfe3
Merge pull request #213 from JorgenVatle/changeset-release/v3
JorgenVatle Oct 18, 2024
b06e354
Remove high priority module preloads from lazy prefetch
JorgenVatle Oct 18, 2024
a044cd2
Add prefetching for CSS
JorgenVatle Oct 18, 2024
2ce47fb
Merge remote-tracking branch 'origin/v3' into v3
JorgenVatle Oct 18, 2024
1e5424b
Load prefetch assets in batches of 3
JorgenVatle Oct 19, 2024
ab461a9
docs(changeset): Prefetch all Vite assets asynchronously in the backg…
JorgenVatle Oct 19, 2024
f9e2ed3
RELEASING: Releasing 1 package(s)
github-actions[bot] Oct 19, 2024
ce55bf1
Version Packages (next)
github-actions[bot] Oct 19, 2024
e66a060
Merge pull request #214 from JorgenVatle/changeset-release/v3
JorgenVatle Oct 19, 2024
f0cf144
Add option to disable app prefetching through environment variables
JorgenVatle Oct 19, 2024
c123faf
Merge remote-tracking branch 'origin/v3' into v3
JorgenVatle Oct 19, 2024
f86536f
Merge branch 'release' into merge-release-into-v3
JorgenVatle Oct 22, 2024
5e66985
docs(changeset): Update serverEntry config option to use Vite SSR bui…
JorgenVatle Oct 22, 2024
d717b86
Add .gitignore file to _vite-bundle
JorgenVatle Oct 22, 2024
5476b76
RELEASING: Releasing 2 package(s)
github-actions[bot] Oct 22, 2024
90d3b93
Version Packages (next)
github-actions[bot] Oct 22, 2024
96891b6
Merge pull request #222 from JorgenVatle/changeset-release/v3
JorgenVatle Oct 22, 2024
24c4022
Move vite-bundler sources into src
JorgenVatle Oct 23, 2024
c2b2158
Update tsconfig references for new package structure
JorgenVatle Oct 23, 2024
32f8860
Move IPC validation function into worker
JorgenVatle Oct 23, 2024
f2593de
Add new interface for defining IPC transports
JorgenVatle Oct 23, 2024
ddcafa3
Add statically defined IPC replies interface
JorgenVatle Oct 23, 2024
d6a382e
Refactor worker methods to use new statically defined replies interface
JorgenVatle Oct 23, 2024
0cb3520
Add new IPC master class for handling IPC messages across multiple tr…
JorgenVatle Oct 23, 2024
367928a
Remove redundant IpcReplies interface
JorgenVatle Oct 23, 2024
cb932a8
Use set for IPC transports
JorgenVatle Oct 23, 2024
a3deb24
Export IPC class as singleton
JorgenVatle Oct 23, 2024
8fd2d0a
Add defined transports to IPC adapter
JorgenVatle Oct 23, 2024
3e88c20
Add pseudocode for new worker initialization.
JorgenVatle Oct 23, 2024
7743a1d
Use abstract class for IpcTransport
JorgenVatle Oct 23, 2024
a23c2eb
Move transport module into transports dir
JorgenVatle Oct 23, 2024
cc9bc55
Add DDPTransport
JorgenVatle Oct 23, 2024
014b862
Update DDPTransport import
JorgenVatle Oct 23, 2024
83facc4
Add node IPC transport
JorgenVatle Oct 23, 2024
0d45988
Import node transport in worker module
JorgenVatle Oct 23, 2024
62909e9
Add hasTransports method to IpcAdapter
JorgenVatle Oct 23, 2024
2e6cb78
Add new IPC method definition helper function
JorgenVatle Oct 23, 2024
76306ba
Use new method definition function for Vite builds
JorgenVatle Oct 23, 2024
aa7abb3
Remove unused types
JorgenVatle Oct 23, 2024
c6341de
Remove old IPC interface definitions
JorgenVatle Oct 23, 2024
659ee88
Refactor vite-server IPC methods to use new method definitions
JorgenVatle Oct 23, 2024
d9a3f7a
Simplify WorkerMethod type now that replies don't need to be passed a…
JorgenVatle Oct 23, 2024
ec97068
Start listeners from IPCAdapter
JorgenVatle Oct 23, 2024
4f53994
Use IPC listen method in worker entrypoint
JorgenVatle Oct 23, 2024
705f8e9
Add name to transport classes
JorgenVatle Oct 23, 2024
0f165e9
Add logger to IPC transports
JorgenVatle Oct 23, 2024
dba5b4d
Update code formatting for labelled logger
JorgenVatle Oct 23, 2024
706fce0
Make data lines optional in logger
JorgenVatle Oct 23, 2024
ed5678b
Add debug logs to IPC adapter
JorgenVatle Oct 23, 2024
fc60668
Extend IpcTransport instead of implementing it
JorgenVatle Oct 23, 2024
a4fb9b5
Colorize IPC logs
JorgenVatle Oct 23, 2024
4e378f7
Dim debug logs
JorgenVatle Oct 23, 2024
61f66bb
Log initialized transports
JorgenVatle Oct 23, 2024
84d7fdf
Assign logger in abstract constructor to avoid creating a logger befo…
JorgenVatle Oct 23, 2024
7d0e6b3
Pass name to parent class
JorgenVatle Oct 23, 2024
16109b5
Pass name to superclass
JorgenVatle Oct 23, 2024
0118706
Rely on users to add IPC transports instead of assigning them in cons…
JorgenVatle Oct 23, 2024
f4620f5
Track connection stats
JorgenVatle Oct 23, 2024
146fc92
Exit process if all IPC channels are disconnected for more than 5 sec…
JorgenVatle Oct 23, 2024
9fa0c53
Correct active check
JorgenVatle Oct 23, 2024
cb51f5f
Add debug logs for connection status
JorgenVatle Oct 23, 2024
81f33b1
Correct log message for connected status
JorgenVatle Oct 23, 2024
eec0e6c
Only exit background worker if Meteor's parent process exits
JorgenVatle Oct 23, 2024
2181ad3
Remove timeout tracking for DDP instance
JorgenVatle Oct 23, 2024
ffcb48b
Allow a few seconds before determining whether to terminate worker ba…
JorgenVatle Oct 23, 2024
02f5485
Correct path to slash screen asset
JorgenVatle Oct 23, 2024
686c91c
Send IPC messages through both Node and DDP IPCs
JorgenVatle Oct 23, 2024
65778fd
Prevent ipc method calls from being hit twice with the same request
JorgenVatle Oct 23, 2024
e341e2d
Attach IDs to worker method calls
JorgenVatle Oct 23, 2024
cf2453b
Add missing ID field to DPP IPC calls
JorgenVatle Oct 23, 2024
8601e06
Resolve conflicts
JorgenVatle Oct 23, 2024
ee1ec32
Add IPC definition for ssr watch method
JorgenVatle Oct 24, 2024
c580c39
Launch SSR build watcher in separate Node.js process.
JorgenVatle Oct 24, 2024
1f82dce
Correct SSR watcher module path
JorgenVatle Oct 24, 2024
e743310
docs(changeset): Use any available IPC interface for workers instead …
JorgenVatle Oct 24, 2024
fa27c0f
Merge pull request #225 from JorgenVatle/multi-ipc-support
JorgenVatle Oct 24, 2024
04371d7
RELEASING: Releasing 2 package(s)
github-actions[bot] Oct 24, 2024
e06583e
Version Packages (next)
github-actions[bot] Oct 24, 2024
736c63d
Merge pull request #227 from JorgenVatle/changeset-release/v3
JorgenVatle Oct 24, 2024
085077c
Enable watch mode for server builder
JorgenVatle Oct 24, 2024
d14aa08
Bump version
JorgenVatle Oct 24, 2024
5186fdd
Revert "Enable watch mode for server builder"
JorgenVatle Oct 24, 2024
52f9abd
Revert "Correct SSR watcher module path"
JorgenVatle Oct 24, 2024
b45aa4b
Revert "Launch SSR build watcher in separate Node.js process."
JorgenVatle Oct 24, 2024
767c1ad
Revert "Add IPC definition for ssr watch method"
JorgenVatle Oct 24, 2024
62937e0
Explicitly set mode for Vite server
JorgenVatle Oct 24, 2024
f267dba
Enable builder watch mode
JorgenVatle Oct 24, 2024
3f1111a
Correct command for config resolver
JorgenVatle Oct 24, 2024
a79efb3
Use ESBuild instead of Vite's SSR build process.
JorgenVatle Oct 24, 2024
5324539
Throw when child process disconnects and errors out
JorgenVatle Oct 24, 2024
e4aee00
Add noExternal from Vite config
JorgenVatle Oct 24, 2024
b46bea3
Add Vue esbuild plugin placeholder
JorgenVatle Oct 24, 2024
4636809
Use Vite to load Vue components into ESBuild.
JorgenVatle Oct 24, 2024
03ca891
Add todo for only running local build when necessary
JorgenVatle Oct 24, 2024
94bd95b
Expand Vite build filter to include Svelte components
JorgenVatle Oct 24, 2024
f2754e3
Use insensitive case matching for resolve filter
JorgenVatle Oct 24, 2024
bb4374a
Only run Vite production build unless absolutely necessary.
JorgenVatle Oct 24, 2024
dff891d
Use debug loggers for esbuild plugin
JorgenVatle Oct 24, 2024
36499a0
Rename esbuild plugin to just 'vite'
JorgenVatle Oct 24, 2024
8654b27
Remove import matching debug logs
JorgenVatle Oct 24, 2024
12e596b
Explicitly set entry module name
JorgenVatle Oct 24, 2024
437b764
Remove overly verbose debug logger
JorgenVatle Oct 24, 2024
b338b04
Optimize imports
JorgenVatle Oct 24, 2024
4f7ec72
Version bump
JorgenVatle Oct 24, 2024
436fd5b
docs(changeset): Use ESBuild instead of Vite's SSR bundler for Meteor…
JorgenVatle Oct 24, 2024
819e939
RELEASING: Releasing 1 package(s)
github-actions[bot] Oct 24, 2024
fab8307
Version Packages (next)
github-actions[bot] Oct 24, 2024
edf8b35
Merge pull request #229 from JorgenVatle/changeset-release/v3
JorgenVatle Oct 24, 2024
87d15a0
Prevent tsup config files from interfering with server builds
JorgenVatle Oct 31, 2024
da13647
Explicitly set 'production' mode when building for production
JorgenVatle Nov 2, 2024
8f8bb3d
Add NODE_ENV passthrough to workers
JorgenVatle Nov 2, 2024
36bb622
Revert "Explicitly set 'production' mode when building for production"
JorgenVatle Nov 2, 2024
f597f09
docs(changeset): Fix environment passthrough to Vite
JorgenVatle Nov 2, 2024
cfc4a3a
RELEASING: Releasing 2 package(s)
github-actions[bot] Nov 2, 2024
ca6d5a2
Version Packages (next)
github-actions[bot] Nov 2, 2024
9bca877
Merge pull request #232 from JorgenVatle/changeset-release/v3
JorgenVatle Nov 2, 2024
01a4434
Mark tsup as optional peer dependency
JorgenVatle Nov 2, 2024
400c2ce
Merge remote-tracking branch 'origin/v3' into v3
JorgenVatle Nov 2, 2024
58f191e
Only throw error if all available IPC methods have disconnected
JorgenVatle Nov 3, 2024
b9a4271
docs(changeset): Fix issue where server would exit prematurely if wor…
JorgenVatle Nov 3, 2024
24a0719
RELEASING: Releasing 1 package(s)
github-actions[bot] Nov 3, 2024
0dd9006
Version Packages (next)
github-actions[bot] Nov 3, 2024
dc6713a
Merge pull request #233 from JorgenVatle/changeset-release/v3
JorgenVatle Nov 3, 2024
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
9 changes: 8 additions & 1 deletion .bin/example-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,15 @@ build() {
(link) || exit 1
(cleanOutput) || exit 1

local extraArgs=""

if [ "$DEBUG" == "1" ]; then
extraArgs="--debug"
fi


cd "$APP_DIR" || exit 1
meteor build "$BUILD_TARGET" --directory "$@"
meteor build "$BUILD_TARGET" --directory "$@" $extraArgs
}

npmPackage() {
Expand Down
118 changes: 92 additions & 26 deletions .bin/release-meteor-package.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { execSync, spawn } from 'child_process';
import { execSync, spawn, execFileSync } from 'child_process';
import Path from 'path';
import FS from 'fs/promises';

// Assuming this is launched from the repository root for now.
const repoPath = process.cwd();
const PACKAGE_NAME_REGEX = /name:\s*'(?<packageName>(?<author>[\w\-._]+):(?<name>[\w\-._]+))'\s*,/;
const PACKAGE_VERSION_REGEX = /version:\s*'(?<version>[\d\w.-]+)'\s*,/;
const PACKAGE_VERSION_REGEX = /version:\s*'(?<version>[\d\w.+-]+)'\s*,/;
const CHANGESET_STATUS_FILE = 'changeset-status.json';
const meteorPackage = {
releaseName: 'vite-bundler',
username: 'jorgenvatle',
packageJsPath: Path.join(repoPath, './packages/vite-bundler/package.js'),
packageJsonPath: Path.join(repoPath, './packages/vite-bundler/package.json'),
};
const logger = {
_history: [],
Expand Down Expand Up @@ -50,8 +52,12 @@ async function parsePackageJs(packageJsPath) {
}
}

async function parsePackageJson() {
return JSON.parse(await FS.readFile(meteorPackage.packageJsonPath, 'utf-8'));
}

async function applyVersion() {
shell(`changeset status --output ${CHANGESET_STATUS_FILE}`);
await shell(`changeset status --output ${CHANGESET_STATUS_FILE}`);

const { releases } = await FS.readFile(`${CHANGESET_STATUS_FILE}`, 'utf-8')
.then((content) => JSON.parse(content));
Expand All @@ -65,37 +71,57 @@ async function applyVersion() {

logger.info(`ℹ️ New version ${release.newVersion} for ${meteorPackage.releaseName} detected`);

await setVersion(release.newVersion);

await shell(`git add ${meteorPackage.packageJsPath}`);
await shell(`git commit -m 'Bump ${meteorPackage.releaseName} version to ${release.newVersion}'`);
}

async function setVersion(newVersion) {
const { rawContent, version, name } = await parsePackageJs(meteorPackage.packageJsPath);
if (!version) {
throw new Error(`Unable to read version from ${meteorPackage.releaseName} package.js`);
}
const patchedPackageJs = rawContent.replace(PACKAGE_VERSION_REGEX, `version: '${release.newVersion}',`);
const patchedPackageJs = rawContent.replace(PACKAGE_VERSION_REGEX, `version: '${newVersion}',`);
await FS.writeFile(meteorPackage.packageJsPath, patchedPackageJs);

logger.info(`✅ Changed ${meteorPackage.releaseName} (${name}) version from v${version} to v${release.newVersion}\n`);

shell(`git add ${meteorPackage.packageJsPath}`);
shell(`git commit -m 'Bump ${meteorPackage.releaseName} version to ${release.newVersion}'`);
logger.info(`✅ Changed ${meteorPackage.releaseName} (${name}) version from v${version} to v${newVersion}\n`);
}

async function publish() {
const meteorReleases = ['3.0.3', '2.16'];
const { version: currentVersion } = await parsePackageJson();

logger.info(`⚡ Publishing ${meteorPackage.releaseName}...`);

let command = `meteor publish`;
for (const release of meteorReleases) {
const command = `meteor publish --release ${release}`;
const meteorVersion = release.split('.')[0];
const newVersion = currentVersion.replace('next.', `meteor${meteorVersion}.next.`);

if (await isPublished(newVersion)) {
logger.info(`⚠️ Version ${newVersion} is already published to Atmosphere. Skipping...`);
continue;
}

logger.info('✨ Publishing to Atmosphere with Meteor %s release...', release);
await setVersion(newVersion);

await shell(command, {
async: true,
cwd: Path.dirname(meteorPackage.packageJsPath),
env: {
METEOR_SESSION_FILE: process.env.METEOR_SESSION_FILE, // Authenticate using auth token stored as file.
VITE_METEOR_DISABLED: 'true', // Prevents vite:bundler from trying to compile itself on publish
...process.env,
METEOR_RELEASE: release,
},
});

if (process.env.METEOR_RELEASE) {
command += ` --release ${process.env.METEOR_RELEASE}`
logger.info(`🚀 Published to Atmosphere: `)
logger.info(` L ${meteorPackage.username}:${meteorPackage.releaseName}@${newVersion}`)
}

shell(command, {
async: true,
cwd: Path.dirname(meteorPackage.packageJsPath),
env: {
METEOR_SESSION_FILE: process.env.METEOR_SESSION_FILE, // Authenticate using auth token stored as file.
VITE_METEOR_DISABLED: 'true', // Prevents vite:bundler from trying to compile itself on publish
...process.env,
},
});
}

function shell(command, options) {
Expand All @@ -105,10 +131,54 @@ function shell(command, options) {
return;
}
const [bin, ...args] = command.split(' ');
spawn(bin, args, {
const childProcess = spawn(bin, args, {
...options,
stdio: 'inherit',
});

return new Promise((resolve, reject) => {
childProcess.on('close', (code) => {
if (code === 0) {
resolve();
} else {
reject(new Error(`Command "${command}" exited with code ${code}`));
}
});
})
}

/**
* Retrieve all published versions of the package from Atmosphere.
* @returns {Promise<{
* versions: {
* exports: unknown[];
* implies: unknown[];
* name: string;
* version: string;
* description: string;
* summary: string;
* git: string;
* publishedBy: string;
* publishedOn: {
* $date: number;
* };
* installed: boolean;
* architecturesOS: string[];
* deprecated: boolean;
* }[]
* name: string;
* maintainers: string[];
* totalVersions: number;
* }>}
*/
async function getPublishedVersions() {
const json = execFileSync('meteor', ['show', `${meteorPackage.username}:${meteorPackage.releaseName}`, '--show-all', '--ejson']).toString();
return JSON.parse(json);
}

async function isPublished(version) {
const { versions } = await getPublishedVersions();
return versions.some((release) => release.version === version);
}

(async () => {
Expand All @@ -119,15 +189,11 @@ function shell(command, options) {
return;
}

if (action === 'version') {
await applyVersion();
return;
}

throw new Error(`The provided argument is not recognized: "${action}"`);

})().catch((error) => {
const { stdout, stderr } = error;
logger.error(error);

if (stdout) {
logger.info(stdout.toString());
Expand Down
5 changes: 5 additions & 0 deletions .changeset/chatty-years-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-bundler": minor
---

Prefetch all Vite assets asynchronously in the background after initial page load.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"version": true,
"tag": true
},
"baseBranch": "release",
"baseBranch": "v3",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/cool-impalas-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-bundler": patch
---

Reformat next versioning tags
5 changes: 5 additions & 0 deletions .changeset/curvy-roses-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-bundler": patch
---

Fix issue where global meteor runtime variable would be accessed before being defined
6 changes: 6 additions & 0 deletions .changeset/cyan-actors-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"meteor-vite": patch
"vite-bundler": patch
---

Fix environment passthrough to Vite
5 changes: 5 additions & 0 deletions .changeset/friendly-years-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-bundler": patch
---

Use sets instead of arrays for manifest imports cache to address duplicate imports.
5 changes: 5 additions & 0 deletions .changeset/great-dodos-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-bundler": patch
---

Use Vite plugin configuration instead of build-time environment variables for setting the base path and URL for assets
8 changes: 8 additions & 0 deletions .changeset/lemon-foxes-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"meteor-vite": minor
"vite-bundler": minor
---

- Add Vite config option for bundling the Meteor server
- Use DDP instead of Node IPC for managing Vite Dev server status
- Prefetch all Vite production assets in the background using the lowest available link priority.
6 changes: 6 additions & 0 deletions .changeset/orange-students-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"meteor-vite": patch
"vite-bundler": patch
---

Use any available IPC interface for workers instead of relying on one transport strategy
5 changes: 5 additions & 0 deletions .changeset/plenty-cobras-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-bundler": patch
---

Correct path to dev server splash screen HTML asset
5 changes: 5 additions & 0 deletions .changeset/polite-wombats-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-bundler": patch
---

Fix release process
32 changes: 32 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"meteor-vite": "1.10.3",
"@meteor-vite/plugin-zodern-relay": "1.0.2",
"vite-bundler": "2.0.1"
},
"changesets": [
"chatty-years-love",
"cool-impalas-argue",
"curvy-roses-raise",
"cyan-actors-lie",
"friendly-years-type",
"great-dodos-smash",
"lemon-foxes-search",
"orange-students-sleep",
"plenty-cobras-collect",
"polite-wombats-decide",
"purple-carrots-drum",
"quick-pumpkins-drop",
"silly-bottles-pretend",
"sixty-birds-carry",
"slow-buses-invent",
"spicy-phones-smoke",
"tasty-pumas-invent",
"thin-sheep-nail",
"thirty-ducks-poke",
"tiny-tigers-divide",
"two-dolphins-sing"
]
}
5 changes: 5 additions & 0 deletions .changeset/purple-carrots-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-bundler": patch
---

Use Meteor's runtime config to resolve the path to Vite's bundle manifest
6 changes: 6 additions & 0 deletions .changeset/quick-pumpkins-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"meteor-vite": patch
"vite-bundler": patch
---

Update serverEntry config option to use Vite SSR build internally
5 changes: 5 additions & 0 deletions .changeset/silly-bottles-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-bundler": patch
---

Fix issue where server would exit prematurely if worker child process disconnects despite having an active DDP connection to the worker.
5 changes: 5 additions & 0 deletions .changeset/sixty-birds-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"meteor-vite": patch
---

Use Vite plugin configuration instead of build-time environment variables for setting the base path and URL for assets
5 changes: 5 additions & 0 deletions .changeset/slow-buses-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-bundler": patch
---

Fix issue in Meteor v3 where Assets.getText() is no longer available.
5 changes: 5 additions & 0 deletions .changeset/spicy-phones-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"meteor-vite": patch
---

Loosen peer dependency requirement for Vite to allow for use with Vite v5
5 changes: 5 additions & 0 deletions .changeset/tasty-pumas-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-bundler": patch
---

Include build metadata in version tag
5 changes: 5 additions & 0 deletions .changeset/thin-sheep-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"meteor-vite": minor
---

Use ESBuild instead of Vite's SSR bundler for Meteor server bundle.
5 changes: 5 additions & 0 deletions .changeset/thirty-ducks-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-bundler": patch
---

Patch cacheable files in memory instead of trying to write to the target arch's program.json file which could be marked as read-only.
5 changes: 5 additions & 0 deletions .changeset/tiny-tigers-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-bundler": patch
---

Prevent Meteor from disabling caching on asset files generated by Vite
7 changes: 7 additions & 0 deletions .changeset/two-dolphins-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"meteor-vite": major
"vite-bundler": major
---

Serve Vite bundle directly as static assets in production.
Skipping the Meteor bundling/transpilation steps for significantly faster build and client load times. ⚡
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
- release
- meteor-v3
- v3

env:
METEOR_SESSION_FILE_PATH: /opt/meteor/.meteor_session.json
Expand Down Expand Up @@ -38,7 +39,7 @@ jobs:
- name: 'Setup Meteor'
uses: meteorengineer/setup-meteor@v1
with:
meteor-release: '3.0-rc.2'
meteor-release: 3.0-rc.2

- name: 'Install Dependencies'
run: |
Expand All @@ -54,7 +55,6 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
version: npm run version
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading
Loading