vite_rails 1.0.1 → 1.0.2

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: 89b280f3a27da1896e3036c387874f6f2c5c0033aa3cb9f77cac84fecba57be3
4
- data.tar.gz: 70e6f39a6f35af3e7a95cbd92cf7a2b9d2b4c0429335611ebf3cbab60386c775
3
+ metadata.gz: a21a899a4c8bb0f107bdb5947e73654aa4ff4f5c8096655fca6afbf3230bca07
4
+ data.tar.gz: c58dac4d02a4d63b65e0b520b5b124b2b6e4e0d02324fe1a99f6d76b24639778
5
5
  SHA512:
6
- metadata.gz: 7b97f37e3822e99622b2a668cd957a27aeb1a00b98efe3e750c90169f4ae8dc2312a4c7460de6b4582a8414a92b704b668c880190314fd1d3632002b3f77c587
7
- data.tar.gz: 76cce62bdedfc515e62e1777746a7a39ebe500a0e8afbd5b7c9255372a984a1042747d7e8dc52d4992d03370649c677c7c603cab75d3a6b5c9af2c0c447ef0a9
6
+ metadata.gz: 3c15259b8704298bdf8ac0a63d93960c75d1f977de62645e9e855d644cb29d1de270e0e1a1357edfe468c816264c9136af3cab1226b13eb3ef2e9aea83f89b8e
7
+ data.tar.gz: 1ba34b6164b4d0321f402fb3a96df166fa36f98539f3403aa1add892bdc1c056e836456970758349dc8db0189f13e96413bbbf1dd7f88fa6d116b232efe18710
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ ENV['RAILS_ENV'] ||= ENV['RACK_ENV'] || 'development'
5
+ ENV['NODE_ENV'] ||= ENV['RAILS_ENV'] == 'development' ? 'development' : 'production'
6
+
7
+ require 'pathname'
8
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', Pathname.new(__FILE__).realpath)
9
+
10
+ require 'bundler/setup'
11
+
12
+ require 'vite_rails'
13
+
14
+ APP_ROOT = File.expand_path('..', __dir__)
15
+ Dir.chdir(APP_ROOT) do
16
+ ViteRails.run(ARGV)
17
+ end
@@ -0,0 +1,13 @@
1
+ import { defineConfig } from 'vite'
2
+ import VuePlugin from '@vitejs/plugin-vue'
3
+ import RubyPlugin from 'vite-plugin-ruby'
4
+
5
+ export default defineConfig({
6
+ plugins: [
7
+ VuePlugin(),
8
+ RubyPlugin(),
9
+ ],
10
+ optimizeDeps: {
11
+ exclude: [/webpack/, /vite-plugin-ruby/],
12
+ },
13
+ })
@@ -0,0 +1,14 @@
1
+ {
2
+ "all": {
3
+ "watchAdditionalPaths": []
4
+ },
5
+ "development": {
6
+ "autoBuild": true,
7
+ "publicOutputDir": "vite-dev",
8
+ "port": 3036
9
+ },
10
+ "test": {
11
+ "autoBuild": true,
12
+ "publicOutputDir": "vite-test"
13
+ }
14
+ }
@@ -0,0 +1,27 @@
1
+ <script>
2
+ import { defineComponent } from 'vue'
3
+ import HelloWorld from '~/components/HelloWorld.vue'
4
+
5
+ export default defineComponent({
6
+ name: 'App',
7
+ components: {
8
+ HelloWorld
9
+ }
10
+ })
11
+ </script>
12
+
13
+ <style>
14
+ #app {
15
+ font-family: Avenir, Helvetica, Arial, sans-serif;
16
+ -webkit-font-smoothing: antialiased;
17
+ -moz-osx-font-smoothing: grayscale;
18
+ text-align: center;
19
+ color: #2c3e50;
20
+ margin-top: 60px;
21
+ }
22
+ </style>
23
+
24
+ <template>
25
+ <img alt="Vue logo" src="../assets/logo.png" />
26
+ <HelloWorld class="strange" msg="Hello Vue 3 + Vite" />
27
+ </template>
@@ -0,0 +1,4 @@
1
+ // Action Cable provides the framework to deal with WebSockets in Rails.
2
+ // You can generate new channels where WebSocket features live using the `rails generate channel` command.
3
+ import { createConsumer } from "@rails/actioncable"
4
+ export default createConsumer()
@@ -0,0 +1,3 @@
1
+ // Load all the channels within this directory and all subdirectories.
2
+ // Channel files must be named *_channel.js.
3
+ import.meta.globEager('./**/*_channel.js')
@@ -0,0 +1,53 @@
1
+ <script>
2
+ import { ref, defineComponent } from 'vue'
3
+
4
+ export default defineComponent({
5
+ name: 'HelloWorld',
6
+ props: {
7
+ msg: { type: String, required: true }
8
+ },
9
+ setup: () => {
10
+ const count = ref(0)
11
+ return { count }
12
+ }
13
+ })
14
+ </script>
15
+
16
+ <style scoped>
17
+ a {
18
+ color: #42b983;
19
+ }
20
+ </style>
21
+
22
+ <template>
23
+ <h1 v-bind="$attrs">{{ msg }}</h1>
24
+ <p>
25
+ <a href="https://vitejs.dev/guide/features.html" target="_blank">Vite Documentation</a> |
26
+ <a href="https://v3.vuejs.org/" target="_blank">Vue 3 Documentation</a>
27
+ </p>
28
+
29
+ <p>
30
+ Recommended setup:
31
+ <a href="https://code.visualstudio.com/" target="_blank">VSCode</a>
32
+ +
33
+ <a
34
+ href="https://marketplace.visualstudio.com/items?itemName=octref.vetur"
35
+ target="_blank"
36
+ >Vetur</a>
37
+ +
38
+ <a
39
+ href="https://marketplace.visualstudio.com/items?itemName=znck.vue-language-features"
40
+ target="_blank"
41
+ >Vue DX</a>
42
+ </p>
43
+ <p>
44
+ Make sure to use workspace version of TypeScript to get improved support via
45
+ <a
46
+ href="https://github.com/znck/vue-developer-experience"
47
+ target="_blank"
48
+ >@vuedx</a>.
49
+ <br />Note @vuedx is still experimental and this setup is provided for early feedback.
50
+ </p>
51
+ <button name="Counter" @click="count++">count is: {{ count }}</button>
52
+ <p>Edit <code>components/HelloWorld.vue</code> to test hot module replacement.</p>
53
+ </template>
@@ -0,0 +1,16 @@
1
+ import '@rails/ujs'
2
+ import Turbolinks from 'turbolinks'
3
+ import ActiveStorage from '@rails/activestorage'
4
+ import { createApp } from 'vue'
5
+
6
+ import App from '~/App.vue'
7
+ import '~/channels'
8
+ import '../../stylesheets/index.css'
9
+
10
+ Turbolinks.start()
11
+ ActiveStorage.start()
12
+
13
+ console.log('Vite ⚡️ Rails')
14
+
15
+ createApp(App).mount('#app')
16
+
@@ -0,0 +1,3 @@
1
+ body {
2
+ background: red;
3
+ }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ViteRails
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vite_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Máximo Mussini
@@ -119,7 +119,17 @@ files:
119
119
  - CONTRIBUTING.md
120
120
  - LICENSE.txt
121
121
  - README.md
122
+ - lib/install/bin/vite
122
123
  - lib/install/binstubs.rb
124
+ - lib/install/config/vite.config.ts
125
+ - lib/install/config/vite.json
126
+ - lib/install/javascript/App.vue
127
+ - lib/install/javascript/assets/logo.png
128
+ - lib/install/javascript/channels/consumer.js
129
+ - lib/install/javascript/channels/index.js
130
+ - lib/install/javascript/components/HelloWorld.vue
131
+ - lib/install/javascript/entrypoints/application.js
132
+ - lib/install/javascript/stylesheets/index.css
123
133
  - lib/install/template.rb
124
134
  - lib/tasks/vite/binstubs.rake
125
135
  - lib/tasks/vite/build.rake
@@ -182,8 +192,8 @@ homepage: https://github.com/ElMassimo/vite_rails
182
192
  licenses:
183
193
  - MIT
184
194
  metadata:
185
- source_code_uri: https://github.com/ElMassimo/vite_rails/tree/v1.0.1
186
- changelog_uri: https://github.com/ElMassimo/vite_rails/blob/v1.0.1/CHANGELOG.md
195
+ source_code_uri: https://github.com/ElMassimo/vite_rails/tree/v1.0.2
196
+ changelog_uri: https://github.com/ElMassimo/vite_rails/blob/v1.0.2/CHANGELOG.md
187
197
  post_install_message:
188
198
  rdoc_options: []
189
199
  require_paths: