├── CHANGELOG.md
├── LICENSE.md
├── README.md
├── bin
└── importmap
├── composer.json
├── config
└── importmap.php
├── rector.php
├── resources
└── views
│ ├── .gitkeep
│ └── components
│ └── tags.blade.php
├── src
├── Actions
│ ├── FixJsImportPaths.php
│ └── ReplaceOrAppendTags.php
├── AssetResolver.php
├── Commands
│ ├── AuditCommand.php
│ ├── ClearCacheCommand.php
│ ├── InstallCommand.php
│ ├── JsonCommand.php
│ ├── OptimizeCommand.php
│ ├── OutdatedCommand.php
│ ├── PackagesCommand.php
│ ├── PinCommand.php
│ ├── UnpinCommand.php
│ └── UpdateCommand.php
├── Events
│ └── FailedToFixImportStatement.php
├── Exceptions
│ ├── FailedToFixImportStatementException.php
│ └── ImportmapException.php
├── Facades
│ └── Importmap.php
├── FileDigest.php
├── Importmap.php
├── ImportmapLaravelServiceProvider.php
├── Manifest.php
├── MappedDirectory.php
├── MappedFile.php
├── Npm.php
├── OutdatedPackage.php
├── PackageVersion.php
├── Packager.php
└── VulnerablePackage.php
└── stubs
├── js
└── app.js
├── jsconfig.json
└── routes
└── importmap.php
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to `importmap-laravel` will be documented in this file.
4 |
5 | ## 2.4.0 - 2025-03-02
6 |
7 | ### What's Changed
8 |
9 | * Laravel 12.x Compatibility by @laravel-shift in https://github.com/tonysm/importmap-laravel/pull/59
10 |
11 | **Full Changelog**: https://github.com/tonysm/importmap-laravel/compare/2.3.2...2.4.0
12 |
13 | ## 2.3.1 - 2024-03-13
14 |
15 | ### What's Changed
16 |
17 | - Skip adding the `` component to layouts if they already exist in https://github.com/tonysm/importmap-laravel/commit/ff2019eb14b48223c985e6cdee0601455bc41d88
18 |
19 | **Full Changelog**: https://github.com/tonysm/importmap-laravel/compare/2.3.0...2.3.1
20 |
21 | ## 2.3.0 - 2024-03-13
22 |
23 | ### What's Changed
24 |
25 | - Skip axios installation with a warning by @tonysm in https://github.com/tonysm/importmap-laravel/commit/c77bb163d9a4b2f81d0d399b7c03323e9562b91a
26 |
27 | **Full Changelog**: https://github.com/tonysm/importmap-laravel/compare/2.2.0...2.3.0
28 |
29 | ## 2.2.0 - 2024-03-06
30 |
31 | ### What's Changed
32 |
33 | * Laravel 11 Support by @tonysm in https://github.com/tonysm/importmap-laravel/pull/54
34 |
35 | **Full Changelog**: https://github.com/tonysm/importmap-laravel/compare/2.1.4...2.2.0
36 |
37 | ## 2.1.2 - 2024-02-23
38 |
39 | ### What's Changed
40 |
41 | * Read typo fixes by @emaia in https://github.com/tonysm/importmap-laravel/pull/52
42 | * Update the install command to either replace the vite directive or append the importmap tags before the closing head tag by @tonysm in https://github.com/tonysm/importmap-laravel/commit/ce304706a698b35aa46ef3168d6bf2db8ee2a97d
43 |
44 | ### New Contributors
45 |
46 | * @emaia made their first contribution in https://github.com/tonysm/importmap-laravel/pull/52
47 |
48 | **Full Changelog**: https://github.com/tonysm/importmap-laravel/compare/2.0.3...2.1.2
49 |
50 | ## 2.1.1 - 2024-02-05
51 |
52 | ### What's Changed
53 |
54 | * Fix outdated command breaks on previous comment format by @tonysm in https://github.com/tonysm/importmap-laravel/pull/50
55 |
56 | **Full Changelog**: https://github.com/tonysm/importmap-laravel/compare/2.1.0...2.1.1
57 |
58 | ## 2.1.0 - 2024-02-04
59 |
60 | ### What's Changed
61 |
62 | * New `importmap:update` command and store CDN URL with package name and version in vendor comment by @tonysm in https://github.com/tonysm/importmap-laravel/pull/49
63 |
64 | **Full Changelog**: https://github.com/tonysm/importmap-laravel/compare/2.0.1...2.1.0
65 |
66 | ## 2.0.1 - 2024-02-02
67 |
68 | ### What's Changed
69 |
70 | * Fix: Prevent Type Error: Unsupported operand types: null + array by @JunaidQadirB in https://github.com/tonysm/importmap-laravel/pull/48
71 | * Fix: Optimize command wasn't working when specifying public vendor lib starting with a forward slash (`/vendor/my-lib.js`, for instance) https://github.com/tonysm/importmap-laravel/commit/4e17a78ba5c0b802e9825806fbafc7086461a670
72 | * Fix: Digest wasn't being applied on public vendor libs when starting with a forward slash either https://github.com/tonysm/importmap-laravel/commit/139b788c9837d7313c96e62b8cada68082ea160a
73 |
74 | ### New Contributors
75 |
76 | * @JunaidQadirB made their first contribution in https://github.com/tonysm/importmap-laravel/pull/48
77 |
78 | **Full Changelog**: https://github.com/tonysm/importmap-laravel/compare/2.0.0...2.0.1
79 |
80 | ## 2.0.0 - 2024-01-07
81 |
82 | ### What's Changed
83 |
84 | * Drops the shim by @tonysm in https://github.com/tonysm/importmap-laravel/pull/43
85 | * Preload default by @tonysm in https://github.com/tonysm/importmap-laravel/pull/44
86 | * Always download dependencies by @tonysm in https://github.com/tonysm/importmap-laravel/pull/45
87 | * Dont optimize with URL by @tonysm in https://github.com/tonysm/importmap-laravel/pull/46
88 | * Install with default jsconfig.json by @tonysm in https://github.com/tonysm/importmap-laravel/pull/47
89 |
90 | **Full Changelog**: https://github.com/tonysm/importmap-laravel/compare/1.8.3...2.0.0
91 |
92 |
93 | ---
94 |
95 | ### Upgrade Guide
96 |
97 | The pinned imports to CDN URLs will still work, but I recommend you re-pin them now and host them yourself (we're now always downloading vendor libs to `resources/js/vendor/`).
98 |
99 | The `` component has changed to `` so you can run the following command to replace all occurrences of the previous component name in your layout files:
100 |
101 | ```bash
102 | sed -i 's/x-importmap-tags/x-importmap::tags/g' resources/**/*.php
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 | ```
113 | Also, ensure you have `php artisan view:cache` in your deployment script.
114 |
115 | ## 1.8.1 - 2023-11-24
116 |
117 | ### Changelog
118 |
119 | - **FIX**: Fixes the failed to fix import statement event name (https://github.com/tonysm/importmap-laravel/commit/d32c41d3d38ed27767ce8868af0a8861727196ea)
120 |
121 | ## 1.8.0 - 2023-11-13
122 |
123 | ### What's Changed
124 |
125 | - Fix installation script not properly fixing paths resolution by @tonysm in https://github.com/tonysm/importmap-laravel/pull/34
126 | - Bump shims version to 1.8.2 by @tonysm in https://github.com/tonysm/importmap-laravel/pull/35
127 |
128 | **Full Changelog**: https://github.com/tonysm/importmap-laravel/compare/1.7.0...1.8.0
129 |
130 | ## 1.7.0 - 2023-11-12
131 |
132 | ### What's Changed
133 |
134 | - Adds a `bin/importmap` script by @tonysm in https://github.com/tonysm/importmap-laravel/pull/33
135 |
136 | **Full Changelog**: https://github.com/tonysm/importmap-laravel/compare/1.6.0...1.7.0
137 |
138 | ## 1.6.0 - 2023-07-27
139 |
140 | ### Changelog
141 |
142 | - **CHANGED**: Push symlinks config to package instead of patching the application's `config/filesystems.php` file by @tonysm in https://github.com/tonysm/importmap-laravel/pull/29
143 |
144 | **Full Changelog**: https://github.com/tonysm/importmap-laravel/compare/1.5.0...1.6.0
145 |
146 | ## 1.5.0 - 2023-07-14
147 |
148 | ### Changelog
149 |
150 | - **NEW**: New `importmap:packages` command that lists out the external packages being imported
151 | - **FIXED**: Fixes single quotes support in the `routes/importmap.php` file
152 |
153 | **Full Changelog**: https://github.com/tonysm/importmap-laravel/compare/1.4.1...1.5.0
154 |
155 | ## 1.4.1 - 2023-05-10
156 |
157 | ### What's Changed
158 |
159 | - Bump the shim version to 1.7.2
160 |
161 | **Full Changelog**: https://github.com/tonysm/importmap-laravel/compare/1.4.0...1.4.1
162 |
163 | ## 1.4.0 - 2023-02-14
164 |
165 | ### Changelog
166 |
167 | - **CHANGED**: Bumps the default `es-module-shims` version to `1.3.1`
168 | - **CHANGED**: Support Laravel 10
169 |
170 | ## 1.3.1 - 2023-02-14
171 |
172 | ### Changelog
173 |
174 | - **CHANGED**: Bumps the default `es-module-shims` version to `1.3.1`
175 | - **CHANGED**: Support Laravel 10
176 |
177 | ## 1.3.0 - 2022-12-28
178 |
179 | ### Changelog
180 |
181 | - **CHANGED**: Bumped `es-module-shims` version to `1.6.2` (latest) and make it configurable so applications may bump it without having to upgrade the package
182 |
183 | ## 1.2.3 - 2022-08-04
184 |
185 | ### Changelog
186 |
187 | - **FIXED**: Fixes the optimize command when pinning dependencies from `public/vendor` (https://github.com/tonysm/importmap-laravel/commit/a3a685583bfaaf82e737f0ec2fb368f63f3d3c1f)
188 |
189 | ## 1.2.2 - 2022-08-04
190 |
191 | ### Changelog
192 |
193 | - **CHANGED**: stop escapeing the slashes in the `importmap:json` output (https://github.com/tonysm/importmap-laravel/commit/496cb8bc77c51fd1dae28f12e37a881b4cc41997)
194 | - **NEW**: handle imported files from `public/vendor` folder (https://github.com/tonysm/importmap-laravel/commit/b6c22d1f047715b1f47393dc55a59730397aa55a)
195 |
196 | ## 1.2.1 - 2022-07-29
197 |
198 | ### Changelog
199 |
200 | - **CHANGED**: we don't delete the `public/js` folder anymore, but instead ask the developer to do so (https://github.com/tonysm/importmap-laravel/commit/f0b3ad562bb748fe20f34768d8b9fb49936099c7)
201 |
202 | ## 1.2.0 - 2022-07-03
203 |
204 | ### Changelog
205 |
206 | - **CHANGED**: The `importmap:install` command was changed to work with the new Vite setup in Laravel. It should also still work on installs in the Laravel 8 frontends setups using Mix.
207 |
208 | ## 1.1.1 - 2022-06-30
209 |
210 | ### Changelog
211 |
212 | - **FIXED**: The `importmap:pin` command was breaking depending on the package name because we needed to wrap the package name using the `preg_quote` to escape it. Otherwise, some characters might become part of the regex itself. https://github.com/tonysm/importmap-laravel/pull/16
213 |
214 | ## 1.1.0 - 2022-06-27
215 |
216 | ### Changelog
217 |
218 | - Bumps `es-module-shims` to version 1.5.8
219 |
220 | ## 0.4.1 - 2022-02-13
221 |
222 | ### Changelog
223 |
224 | - **FIXED**: Pinned directories were not working on Windows because we're using `/` instead of `\`. Anyways, that should be fixed now. Define the directories with `/` as you would on any Unix/Linux OS and the package will make sure that gets converted to the correct directory separator when dealing with file paths and to the `/` separator when dealing with URIs https://github.com/tonysm/importmap-laravel/pull/5
225 |
226 | ## 0.4.0 - 2022-02-13
227 |
228 | ### Changelog
229 |
230 | - **CHANGED**: Changes the manifest filename to be `.importmap-manifest.json` (with a dot prefix) so it can be included in the Vapor artifact (which doesn't remove dotfiles by default).
231 |
232 | ## 0.3.0 - 2022-02-09
233 |
234 | ### Changelog
235 |
236 | - **CHANGED**: Laravel 9 support (nothing really changed in the app, just the version constraints)
237 |
238 | ## 0.2.0 - 2022-01-27
239 |
240 | ### Changed
241 |
242 | - **FIXED**: The manifest already had the final asset URL on it, which is handled by the optimize command, so we don't need to call the asset resolver when the manifest exists
243 | - **NEW**: Added an `AssetResolver` invokable class which should add a `?digest=$HASH` to the asset URL, which is useful for cache busting while in local development. This won't be used in production as the optimize command already generates the full URLs there, which means the `AssetResolver` won't be called
244 | - **CHANGED**: The `entrypoint` was made optional and it defaults to the `app` module, which matches the "entrypoint" file in the default Laravel install (`resources/js/app.js`)
245 |
246 | ## 1.0.0 - 202X-XX-XX
247 |
248 | - initial release
249 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) tonysm
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |