stimulus-rails 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96b9b74f895ea578d6b80110094d94dd06057c6bdaf9554ed57a07b402ef45be
4
- data.tar.gz: 910d75cea83fffa62328a5a5f913ba5cf4b54a462ee092388b6e87ebf34f8565
3
+ metadata.gz: eacb867e3e29fcedd7fadfd3237d8a92ffce70ef4ba2a7e8c10a8e5cf04c35dd
4
+ data.tar.gz: 226b6e7bf8dfa7e4c0b458e78e1a429ec6e506139c7f963425437dc0a269b51d
5
5
  SHA512:
6
- metadata.gz: '09f2b5d9bee56151ead42d5c5d854bc8aede8e2d3c18c97b9d6b2470de9bab42c119ccb1b2a7c0907f5719e8c6780cb1d0dddcec37176895064f31fe587a6ab4'
7
- data.tar.gz: 7d922f521c2d3cb4f60fd6331340505c656817a83377c8ecd3341c0fbb73f224fbe8d5ee2fd64b976c451923b399a614e91be043acc23291613c133d7a577387
6
+ metadata.gz: 52bc59f17f3c6aa1489ae0d37c82986a5cb3ab8568392a0b1d7a69b9bbd80d931ce00bb1b73619f9c63e4f3b5a07c6121ec2c74b6499575a355210d76f9668ef
7
+ data.tar.gz: f2b95322e53658d445a5d7bb66bdead2f712e13efe823d2178df99c85d3a6fb88ab4560d06c7d2cdfd3e8ce6a512487a64f53ce3e485a335c554717c9eaf0ddc
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [Stimulus](https://stimulus.hotwired.dev) is a JavaScript framework with modest ambitions. It doesn’t seek to take over your entire front-end in fact, it’s not concerned with rendering HTML at all. Instead, it’s designed to augment your HTML with just enough behavior to make it shine. Stimulus pairs beautifully with Turbo to provide a complete solution for fast, compelling applications with a minimal amount of effort. Together they form the core of [Hotwire](https://hotwired.dev).
4
4
 
5
- Stimulus for Rails makes it easy to use this modest framework with the asset pipeline and ES6/ESM in the browser. It relies on `importmap-rails` to make stimulus available via ESM. Make sure to install this first!
5
+ Stimulus for Rails makes it easy to use this modest framework with the asset pipeline and ES6/ESM in the browser. It relies on either `importmap-rails` to make Stimulus available via ESM or a node-capable Rails (like via `jsbundling-rails`) to include Stimulus in the bundle. Make sure to install one of these first!
6
6
 
7
7
 
8
8
  ## Installation
@@ -11,7 +11,7 @@ Stimulus for Rails makes it easy to use this modest framework with the asset pip
11
11
  2. Run `./bin/bundle install`.
12
12
  3. Run `./bin/rails stimulus:install`
13
13
 
14
- The installer will automatically detect whether you're using an [import map](https://github.com/rails/importmap-rails) or [JavaScript bundler](https://github.com/rails/jsbundling-rails) to manage your application's JavaScript. If you're using an import map, the Stimulus dependencies will be pinned to the versions of the library included with this gem. If you're using node, yarn will add the dependencies to your package.json file.
14
+ The installer will automatically detect whether you're using an [import map](https://github.com/rails/importmap-rails) or [JavaScript bundler](https://github.com/rails/jsbundling-rails) to manage your application's JavaScript. If you're using an import map, the Stimulus dependencies will be pinned to the versions of the library included with this gem. If you're using node, yarn will add the dependencies to your `package.json` file.
15
15
 
16
16
 
17
17
  ## Usage
@@ -14,7 +14,7 @@ export function parseImportmapJson() {
14
14
 
15
15
  function registerControllerFromPath(path, under, application) {
16
16
  const name = path
17
- .replace(`${under}/`, "")
17
+ .replace(new RegExp(`^${under}/`), "")
18
18
  .replace("_controller", "")
19
19
  .replace(/\//g, "--")
20
20
  .replace(/_/g, "-")