From 74fa7df4461e69c58452e6cbbad578626a91bd62 Mon Sep 17 00:00:00 2001 From: Juan Vasquez Date: Sat, 3 Dec 2022 21:59:27 -0600 Subject: [PATCH 1/7] [refactor] Update to advanced asset pipeline Fixes #3 --- Gemfile | 4 ++-- Gemfile.lock | 22 +++++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 3d67a02..50bae70 100644 --- a/Gemfile +++ b/Gemfile @@ -10,8 +10,8 @@ gem 'middleman-syntax', '~> 3.0' gem 'middleman-blog', '~> 4.0', '>= 4.0.2' gem 'nokogiri' -gem 'middleman-sprockets' -gem 'sprockets', '3.7.2' +gem "vite_padrino" +gem "vite_ruby" gem 'haml', '~> 5.2', '>= 5.2.2' # Live-reloading plugin diff --git a/Gemfile.lock b/Gemfile.lock index eb9104a..cd318fe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,6 +19,7 @@ GEM concurrent-ruby (1.1.10) contracts (0.13.0) dotenv (2.8.1) + dry-cli (0.7.0) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) @@ -89,9 +90,6 @@ GEM middleman-core (>= 3.0.2) multi_json (~> 1.0) rack-livereload - middleman-sprockets (4.1.1) - middleman-core (~> 4.0) - sprockets (>= 3.0) middleman-syntax (3.3.0) middleman-core (>= 3.2) rouge (~> 3.2) @@ -117,15 +115,14 @@ GEM rack (2.2.4) rack-livereload (0.3.17) rack + rack-proxy (0.7.4) + rack rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) rouge (3.30.0) sass (3.4.25) servolux (0.13.0) - sprockets (3.7.2) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) temple (0.9.1) thor (1.2.1) thread_safe (0.3.6) @@ -134,6 +131,13 @@ GEM thread_safe (~> 0.1) uglifier (3.2.0) execjs (>= 0.3.0, < 3) + vite_padrino (3.0.0) + vite_ruby (~> 3.0) + vite_ruby (3.2.12) + dry-cli (~> 0.7.0) + rack-proxy (~> 0.6, >= 0.6.1) + zeitwerk (~> 2.2) + zeitwerk (2.6.6) PLATFORMS ruby @@ -146,11 +150,11 @@ DEPENDENCIES middleman-deploy (~> 2.0.0.pre.alpha) middleman-disqus middleman-livereload (~> 3.1.0) - middleman-sprockets middleman-syntax (~> 3.0) nokogiri - sprockets (= 3.7.2) + vite_padrino + vite_ruby wdm (~> 0.1.0) BUNDLED WITH - 1.16.1 + 1.17.2 From 756df305aa49931afaf3a4a3d81d9e6d9ad360f6 Mon Sep 17 00:00:00 2001 From: Juan Vasquez Date: Sat, 3 Dec 2022 22:02:29 -0600 Subject: [PATCH 2/7] Add vite:install --- .gitignore | 7 + bin/vite | 29 ++ config/vite.json | 16 + frontend/entrypoints/application.js | 5 + package-lock.json | 541 ++++++++++++++++++++++++++++ package.json | 11 + vite.config.ts | 8 + 7 files changed, 617 insertions(+) create mode 100755 bin/vite create mode 100644 config/vite.json create mode 100644 frontend/entrypoints/application.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 vite.config.ts diff --git a/.gitignore b/.gitignore index e8aeb66..5d6b78b 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,10 @@ .DS_Store *.swp + +# Vite Ruby +/public/vite* +node_modules +# Vite uses dotenv and suggests to ignore local-only env files. See +# https://vitejs.dev/guide/env-and-mode.html#env-files +*.local diff --git a/bin/vite b/bin/vite new file mode 100755 index 0000000..11fb801 --- /dev/null +++ b/bin/vite @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'vite' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("vite_ruby", "vite") diff --git a/config/vite.json b/config/vite.json new file mode 100644 index 0000000..293e5ae --- /dev/null +++ b/config/vite.json @@ -0,0 +1,16 @@ +{ + "all": { + "sourceCodeDir": "frontend", + "watchAdditionalPaths": [] + }, + "development": { + "autoBuild": true, + "publicOutputDir": "vite-dev", + "port": 3036 + }, + "test": { + "autoBuild": true, + "publicOutputDir": "vite-test", + "port": 3037 + } +} diff --git a/frontend/entrypoints/application.js b/frontend/entrypoints/application.js new file mode 100644 index 0000000..80ca94e --- /dev/null +++ b/frontend/entrypoints/application.js @@ -0,0 +1,5 @@ +// To see this message, follow the instructions for your Ruby framework. +// +// When using a plain API, perhaps it's better to generate an HTML entrypoint +// and link to the scripts and stylesheets, and let Vite transform it. +console.log("Vite ⚡️ Ruby and Middleman"); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..d6d535e --- /dev/null +++ b/package-lock.json @@ -0,0 +1,541 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@esbuild/android-arm": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.17.tgz", + "integrity": "sha512-ay6Ken4u+JStjYmqIgh71jMT0bs/rXpCCDKaMfl78B20QYWJglT5P6Ejfm4hWf6Zi+uUWNe7ZmqakRs2BQYIeg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.17.tgz", + "integrity": "sha512-IA1O7f7qxw2DX8oqTpugHElr926phs7Rq8ULXleBMk4go5K05BU0mI8BfCkWcYAvcmVaMc13bv5W3LIUlU6Y9w==", + "dev": true, + "optional": true + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "esbuild": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.17.tgz", + "integrity": "sha512-8MbkDX+kh0kaeYGd6klMbn1uTOXHoDw7UYMd1dQYA5cqBZivf5+pzfaXZSL1RNamJfXW/uWC5+9wX5ejDgpSqg==", + "dev": true, + "requires": { + "@esbuild/android-arm": "0.15.17", + "@esbuild/linux-loong64": "0.15.17", + "esbuild-android-64": "0.15.17", + "esbuild-android-arm64": "0.15.17", + "esbuild-darwin-64": "0.15.17", + "esbuild-darwin-arm64": "0.15.17", + "esbuild-freebsd-64": "0.15.17", + "esbuild-freebsd-arm64": "0.15.17", + "esbuild-linux-32": "0.15.17", + "esbuild-linux-64": "0.15.17", + "esbuild-linux-arm": "0.15.17", + "esbuild-linux-arm64": "0.15.17", + "esbuild-linux-mips64le": "0.15.17", + "esbuild-linux-ppc64le": "0.15.17", + "esbuild-linux-riscv64": "0.15.17", + "esbuild-linux-s390x": "0.15.17", + "esbuild-netbsd-64": "0.15.17", + "esbuild-openbsd-64": "0.15.17", + "esbuild-sunos-64": "0.15.17", + "esbuild-windows-32": "0.15.17", + "esbuild-windows-64": "0.15.17", + "esbuild-windows-arm64": "0.15.17" + } + }, + "esbuild-android-64": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.17.tgz", + "integrity": "sha512-sUs6cKMAuAyWnJ/66ezWVr9SMRGFSwoMagxzdhXYggSA12zF7krXSuc1Y9JwxHq56wtv/gFAVo97TFm7RBc1Ig==", + "dev": true, + "optional": true + }, + "esbuild-android-arm64": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.17.tgz", + "integrity": "sha512-RLZuCgIx1rexwxwsXTEW40ZiZzdBI1MBphwDRFyms/iiJGwLxqCH7v75iSJk5s6AF6oa80KC6r/RmzyaX/uJNg==", + "dev": true, + "optional": true + }, + "esbuild-darwin-64": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.17.tgz", + "integrity": "sha512-+6RTCZ0hfAb+RqTNq1uVsBcP441yZOSi6CyV9BIBryGGVg8RM3Bc6L45e5b68jdRloddN92ekS50e4ElI+cHQA==", + "dev": true, + "optional": true + }, + "esbuild-darwin-arm64": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.17.tgz", + "integrity": "sha512-ne4UWUHEKWLgYSE5SLr0/TBcID3k9LPnrzzRXzFLTfD+ygjnW1pMEgdMfmOKIe8jYBUYv8x/YoksriTdQb9r/Q==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-64": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.17.tgz", + "integrity": "sha512-6my3DrwLOe1zhR8UzVRKeo9AFM9XkApJBcx0IE+qKaEbKKBxYAiDBtd2ZMtRA2agqIwRP0kuHofTiDEzpfA+ZA==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-arm64": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.17.tgz", + "integrity": "sha512-LQL7+f+bz+xmAu1FcDBB304Wm2CjONUcOeF4f3TqG7wYXMxjjYQZBFv+0OVapNXyYrM2vy9JMDbps+SheuOnHg==", + "dev": true, + "optional": true + }, + "esbuild-linux-32": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.17.tgz", + "integrity": "sha512-7E9vZXMZhINQ4/KcxBxioJ2ao5gbXJ6Pa4/LEUd102g3gadSalpg0LrityFgw7ao6qmjcNWwdEYrXaDnOzyyYA==", + "dev": true, + "optional": true + }, + "esbuild-linux-64": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.17.tgz", + "integrity": "sha512-TnedHtFQSUVlc0J0D4ZMMalYaQ0Zbt7HSwGy4sav7BlXVqDVc/rchJ/a9dathK51apzLgRyXQMseLf6bkloaSQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.17.tgz", + "integrity": "sha512-+ugCmBTTDIlh+UuC7E/GvyJqjGTX2pNOA+g3isG78aYcfgswrHjvstTtIfljaU95AS30qrVNLgI5h/8TsRWTrg==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm64": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.17.tgz", + "integrity": "sha512-oupYfh0lTHg+F/2ZoTNrioB+KLd6x0Zlhjz2Oa1jhl8wCGkNvwe25RytR2/SGPYpoNVcvCeoayWQRwwRuWGgfQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-mips64le": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.17.tgz", + "integrity": "sha512-aUVyHwUXJF1hi9jsAT+At+cBxZh2yGICi/e757N6d/zzOD+eVK3PKQj68tAvIflx6/ZpnuCTKol1GpgGYrzERg==", + "dev": true, + "optional": true + }, + "esbuild-linux-ppc64le": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.17.tgz", + "integrity": "sha512-i7789iFTLfLccHPNADCbaZPx9CuQblsBqv2j4XqIBN1jKIJbpQ8iqCkWoHep4PLqqKLtBLtTWh919GsrFGdeJA==", + "dev": true, + "optional": true + }, + "esbuild-linux-riscv64": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.17.tgz", + "integrity": "sha512-fEQ/8tnZ2sDniBlPfTXEdg+0OP1olps96HvYdwl8ywJdAlD7AK761EL3lRbRdfMHNOId2N6+CVca43/Fiu/0AQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-s390x": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.17.tgz", + "integrity": "sha512-ZBQekST4gYgTKHAvUJtR1kFFulHTDlRZSE8T0wRQCmQqydNkC1teWxlR31xS6MZevjZGfa7OMVJD24bBhei/2Q==", + "dev": true, + "optional": true + }, + "esbuild-netbsd-64": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.17.tgz", + "integrity": "sha512-onNBFaZVN9GzGJMm3aZJJv74n/Q8FjW20G9OfSDhHjvamqJ5vbd42hNk6igQX4lgBCHTZvvBlWDJAMy+tbJAAw==", + "dev": true, + "optional": true + }, + "esbuild-openbsd-64": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.17.tgz", + "integrity": "sha512-QFxHmvjaRrmTCvH/A3EmzqKUSZHRQ7/pbrJeATsb/Q6qckCeL9e7zg/1A3HiZqDXeBUV3yNeBeV1GJBjY6yVyA==", + "dev": true, + "optional": true + }, + "esbuild-sunos-64": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.17.tgz", + "integrity": "sha512-7dHZA8Kc6U8rBTKojJatXtzHTUKJ3CRYimvOGIQQ1yUDOqGx/zZkCH/HkEi3Zg5SWyDj/57E5e1YJPo4ySSw/w==", + "dev": true, + "optional": true + }, + "esbuild-windows-32": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.17.tgz", + "integrity": "sha512-yDrNrwQ/0k4N3OZItZ6k6YnBUch8+of06YRYc3hFI8VDm7X1rkNZwhttZNAzF6+TtbnK4cIz7H2/EwdSoaGZ3g==", + "dev": true, + "optional": true + }, + "esbuild-windows-64": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.17.tgz", + "integrity": "sha512-jPnXvB4zMMToNPpCBdt+OEQiYFVs9wlQ5G8vMoJkrYJBp1aEt070MRpBFa6pfBFrgXquqgUiNAohMcTdy+JVFg==", + "dev": true, + "optional": true + }, + "esbuild-windows-arm64": { + "version": "0.15.17", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.17.tgz", + "integrity": "sha512-I5QeSsz0X66V8rxVhmw03Wzn8Tz63H3L9GrsA7C5wvBXMk3qahLWuEL+l7SZ2DleKkFeZZMu1dPxOak9f1TZ4A==", + "dev": true, + "optional": true + }, + "fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, + "fastq": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.14.0.tgz", + "integrity": "sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "immutable": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.1.0.tgz", + "integrity": "sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-core-module": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "nanoid": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", + "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "dev": true + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, + "postcss": { + "version": "8.4.19", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.19.tgz", + "integrity": "sha512-h+pbPsyhlYj6N2ozBmHhHrs9DzGmbaarbLvWipMRO7RLS+v4onj26MPFXA5OBYFxyqYhUJK456SwDcY9H2/zsA==", + "dev": true, + "requires": { + "nanoid": "^3.3.4", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + } + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "resolve": { + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "dev": true, + "requires": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rollup": { + "version": "2.79.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz", + "integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==", + "dev": true, + "requires": { + "fsevents": "~2.3.2" + } + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "sass": { + "version": "1.56.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.56.1.tgz", + "integrity": "sha512-VpEyKpyBPCxE7qGDtOcdJ6fFbcpOM+Emu7uZLxVrkX8KVU/Dp5UF7WLvzqRuUhB6mqqQt1xffLoG+AndxTZrCQ==", + "dev": true, + "requires": { + "chokidar": ">=3.0.0 <4.0.0", + "immutable": "^4.0.0", + "source-map-js": ">=0.6.2 <2.0.0" + } + }, + "source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "vite": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.4.tgz", + "integrity": "sha512-Z2X6SRAffOUYTa+sLy3NQ7nlHFU100xwanq1WDwqaiFiCe+25zdxP1TfCS5ojPV2oDDcXudHIoPnI1Z/66B7Yw==", + "dev": true, + "requires": { + "esbuild": "^0.15.9", + "fsevents": "~2.3.2", + "postcss": "^8.4.18", + "resolve": "^1.22.1", + "rollup": "^2.79.1" + } + }, + "vite-plugin-ruby": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/vite-plugin-ruby/-/vite-plugin-ruby-3.1.3.tgz", + "integrity": "sha512-Y7j0lL8xNMSN1c2/sKBlaLkp0nFtxNFU9/kUReX/GMTOAk8fBylrR9ZdC3fej6EnYzbO3VDtfDDyWzYaoCW3hA==", + "dev": true, + "requires": { + "debug": "^4.3.4", + "fast-glob": "^3.2.11" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..fbd107c --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "scripts": { + "dev": "vite dev", + "build": "vite build" + }, + "devDependencies": { + "sass": "^1.56.1", + "vite": "^3.2.4", + "vite-plugin-ruby": "^3.1.3" + } +} diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..3129636 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from 'vite' +import RubyPlugin from 'vite-plugin-ruby' + +export default defineConfig({ + plugins: [ + RubyPlugin(), + ], +}) From 39744a167be41076da768e1ee3315ca05598faf3 Mon Sep 17 00:00:00 2001 From: Juan Vasquez Date: Sat, 3 Dec 2022 22:04:04 -0600 Subject: [PATCH 3/7] Add external_pipeline config --- config.rb | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/config.rb b/config.rb index 832d554..b0cf165 100644 --- a/config.rb +++ b/config.rb @@ -4,6 +4,19 @@ require 'builder' require 'uri' # Time.zone = "UTC" +require 'vite_ruby' +require 'vite_padrino/tag_helpers' + +configure :development do + use ViteRuby::DevServerProxy, ssl_verify_none: true +end +helpers VitePadrino::TagHelpers + +activate :external_pipeline, + name: :vite, + command: build? ? "yarn run build" : "yarn run dev", + source: ".tmp/dist", + latency: 1 activate :blog do |blog| # This will add a prefix to all links, template references and source paths @@ -81,12 +94,6 @@ def trivia? articulo end end -set :css_dir, 'stylesheets' - -set :js_dir, 'javascripts' - -set :images_dir, 'images' - # Build-specific configuration configure :build do # For example, change the Compass output style for deployment @@ -118,7 +125,6 @@ def trivia? articulo activate :i18n, langs: [:es] activate :syntax -activate :sprockets set :markdown_engine, :kramdown From 9a572d019d891dea607ee2f102a111c876868d5e Mon Sep 17 00:00:00 2001 From: Juan Vasquez Date: Sat, 3 Dec 2022 22:06:06 -0600 Subject: [PATCH 4/7] Move stylesheets --- frontend/entrypoints/application.js | 2 ++ .../stylesheets/all.css.scss => frontend/stylesheets/all.scss | 2 +- {source => frontend}/stylesheets/foundation-icons.scss | 0 {source => frontend}/stylesheets/foundation.scss | 0 {source => frontend}/stylesheets/foundation/_functions.scss | 0 {source => frontend}/stylesheets/foundation/_settings.scss | 0 .../stylesheets/foundation/components/_accordion.scss | 0 .../stylesheets/foundation/components/_alert-boxes.scss | 0 .../stylesheets/foundation/components/_block-grid.scss | 0 .../stylesheets/foundation/components/_breadcrumbs.scss | 0 .../stylesheets/foundation/components/_button-groups.scss | 0 .../stylesheets/foundation/components/_buttons.scss | 0 .../stylesheets/foundation/components/_clearing.scss | 0 .../stylesheets/foundation/components/_dropdown-buttons.scss | 0 .../stylesheets/foundation/components/_dropdown.scss | 0 .../stylesheets/foundation/components/_flex-video.scss | 0 .../stylesheets/foundation/components/_forms.scss | 0 .../stylesheets/foundation/components/_global.scss | 0 .../stylesheets/foundation/components/_grid.scss | 0 .../stylesheets/foundation/components/_icon-bar.scss | 0 .../stylesheets/foundation/components/_inline-lists.scss | 0 .../stylesheets/foundation/components/_joyride.scss | 0 .../stylesheets/foundation/components/_keystrokes.scss | 0 .../stylesheets/foundation/components/_labels.scss | 0 .../stylesheets/foundation/components/_magellan.scss | 0 .../stylesheets/foundation/components/_offcanvas.scss | 0 .../stylesheets/foundation/components/_orbit.scss | 0 .../stylesheets/foundation/components/_pagination.scss | 0 .../stylesheets/foundation/components/_panels.scss | 0 .../stylesheets/foundation/components/_pricing-tables.scss | 0 .../stylesheets/foundation/components/_progress-bars.scss | 0 .../stylesheets/foundation/components/_range-slider.scss | 0 .../stylesheets/foundation/components/_reveal.scss | 0 .../stylesheets/foundation/components/_side-nav.scss | 0 .../stylesheets/foundation/components/_split-buttons.scss | 0 .../stylesheets/foundation/components/_sub-nav.scss | 0 .../stylesheets/foundation/components/_switches.scss | 0 .../stylesheets/foundation/components/_tables.scss | 0 .../stylesheets/foundation/components/_tabs.scss | 0 .../stylesheets/foundation/components/_thumbs.scss | 0 .../stylesheets/foundation/components/_tooltips.scss | 0 .../stylesheets/foundation/components/_top-bar.scss | 0 .../stylesheets/foundation/components/_type.scss | 0 .../stylesheets/foundation/components/_visibility.scss | 0 {source => frontend}/stylesheets/highlight.css.erb | 0 {source => frontend}/stylesheets/normalize.scss | 0 source/layouts/layout.html.haml | 3 +-- 47 files changed, 4 insertions(+), 3 deletions(-) rename source/stylesheets/all.css.scss => frontend/stylesheets/all.scss (99%) rename {source => frontend}/stylesheets/foundation-icons.scss (100%) rename {source => frontend}/stylesheets/foundation.scss (100%) rename {source => frontend}/stylesheets/foundation/_functions.scss (100%) rename {source => frontend}/stylesheets/foundation/_settings.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_accordion.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_alert-boxes.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_block-grid.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_breadcrumbs.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_button-groups.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_buttons.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_clearing.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_dropdown-buttons.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_dropdown.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_flex-video.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_forms.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_global.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_grid.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_icon-bar.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_inline-lists.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_joyride.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_keystrokes.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_labels.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_magellan.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_offcanvas.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_orbit.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_pagination.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_panels.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_pricing-tables.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_progress-bars.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_range-slider.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_reveal.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_side-nav.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_split-buttons.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_sub-nav.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_switches.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_tables.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_tabs.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_thumbs.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_tooltips.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_top-bar.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_type.scss (100%) rename {source => frontend}/stylesheets/foundation/components/_visibility.scss (100%) rename {source => frontend}/stylesheets/highlight.css.erb (100%) rename {source => frontend}/stylesheets/normalize.scss (100%) diff --git a/frontend/entrypoints/application.js b/frontend/entrypoints/application.js index 80ca94e..cc90125 100644 --- a/frontend/entrypoints/application.js +++ b/frontend/entrypoints/application.js @@ -3,3 +3,5 @@ // When using a plain API, perhaps it's better to generate an HTML entrypoint // and link to the scripts and stylesheets, and let Vite transform it. console.log("Vite ⚡️ Ruby and Middleman"); + +import "~/stylesheets/all.scss"; diff --git a/source/stylesheets/all.css.scss b/frontend/stylesheets/all.scss similarity index 99% rename from source/stylesheets/all.css.scss rename to frontend/stylesheets/all.scss index 9aeaad3..1215a8f 100644 --- a/source/stylesheets/all.css.scss +++ b/frontend/stylesheets/all.scss @@ -5,7 +5,7 @@ @import "foundation"; @import "foundation-icons"; @import "foundation/functions"; -@import "highlight.css"; +// @import "highlight.css"; $main-color: #CC342D; $opaque-primary: #85140F; diff --git a/source/stylesheets/foundation-icons.scss b/frontend/stylesheets/foundation-icons.scss similarity index 100% rename from source/stylesheets/foundation-icons.scss rename to frontend/stylesheets/foundation-icons.scss diff --git a/source/stylesheets/foundation.scss b/frontend/stylesheets/foundation.scss similarity index 100% rename from source/stylesheets/foundation.scss rename to frontend/stylesheets/foundation.scss diff --git a/source/stylesheets/foundation/_functions.scss b/frontend/stylesheets/foundation/_functions.scss similarity index 100% rename from source/stylesheets/foundation/_functions.scss rename to frontend/stylesheets/foundation/_functions.scss diff --git a/source/stylesheets/foundation/_settings.scss b/frontend/stylesheets/foundation/_settings.scss similarity index 100% rename from source/stylesheets/foundation/_settings.scss rename to frontend/stylesheets/foundation/_settings.scss diff --git a/source/stylesheets/foundation/components/_accordion.scss b/frontend/stylesheets/foundation/components/_accordion.scss similarity index 100% rename from source/stylesheets/foundation/components/_accordion.scss rename to frontend/stylesheets/foundation/components/_accordion.scss diff --git a/source/stylesheets/foundation/components/_alert-boxes.scss b/frontend/stylesheets/foundation/components/_alert-boxes.scss similarity index 100% rename from source/stylesheets/foundation/components/_alert-boxes.scss rename to frontend/stylesheets/foundation/components/_alert-boxes.scss diff --git a/source/stylesheets/foundation/components/_block-grid.scss b/frontend/stylesheets/foundation/components/_block-grid.scss similarity index 100% rename from source/stylesheets/foundation/components/_block-grid.scss rename to frontend/stylesheets/foundation/components/_block-grid.scss diff --git a/source/stylesheets/foundation/components/_breadcrumbs.scss b/frontend/stylesheets/foundation/components/_breadcrumbs.scss similarity index 100% rename from source/stylesheets/foundation/components/_breadcrumbs.scss rename to frontend/stylesheets/foundation/components/_breadcrumbs.scss diff --git a/source/stylesheets/foundation/components/_button-groups.scss b/frontend/stylesheets/foundation/components/_button-groups.scss similarity index 100% rename from source/stylesheets/foundation/components/_button-groups.scss rename to frontend/stylesheets/foundation/components/_button-groups.scss diff --git a/source/stylesheets/foundation/components/_buttons.scss b/frontend/stylesheets/foundation/components/_buttons.scss similarity index 100% rename from source/stylesheets/foundation/components/_buttons.scss rename to frontend/stylesheets/foundation/components/_buttons.scss diff --git a/source/stylesheets/foundation/components/_clearing.scss b/frontend/stylesheets/foundation/components/_clearing.scss similarity index 100% rename from source/stylesheets/foundation/components/_clearing.scss rename to frontend/stylesheets/foundation/components/_clearing.scss diff --git a/source/stylesheets/foundation/components/_dropdown-buttons.scss b/frontend/stylesheets/foundation/components/_dropdown-buttons.scss similarity index 100% rename from source/stylesheets/foundation/components/_dropdown-buttons.scss rename to frontend/stylesheets/foundation/components/_dropdown-buttons.scss diff --git a/source/stylesheets/foundation/components/_dropdown.scss b/frontend/stylesheets/foundation/components/_dropdown.scss similarity index 100% rename from source/stylesheets/foundation/components/_dropdown.scss rename to frontend/stylesheets/foundation/components/_dropdown.scss diff --git a/source/stylesheets/foundation/components/_flex-video.scss b/frontend/stylesheets/foundation/components/_flex-video.scss similarity index 100% rename from source/stylesheets/foundation/components/_flex-video.scss rename to frontend/stylesheets/foundation/components/_flex-video.scss diff --git a/source/stylesheets/foundation/components/_forms.scss b/frontend/stylesheets/foundation/components/_forms.scss similarity index 100% rename from source/stylesheets/foundation/components/_forms.scss rename to frontend/stylesheets/foundation/components/_forms.scss diff --git a/source/stylesheets/foundation/components/_global.scss b/frontend/stylesheets/foundation/components/_global.scss similarity index 100% rename from source/stylesheets/foundation/components/_global.scss rename to frontend/stylesheets/foundation/components/_global.scss diff --git a/source/stylesheets/foundation/components/_grid.scss b/frontend/stylesheets/foundation/components/_grid.scss similarity index 100% rename from source/stylesheets/foundation/components/_grid.scss rename to frontend/stylesheets/foundation/components/_grid.scss diff --git a/source/stylesheets/foundation/components/_icon-bar.scss b/frontend/stylesheets/foundation/components/_icon-bar.scss similarity index 100% rename from source/stylesheets/foundation/components/_icon-bar.scss rename to frontend/stylesheets/foundation/components/_icon-bar.scss diff --git a/source/stylesheets/foundation/components/_inline-lists.scss b/frontend/stylesheets/foundation/components/_inline-lists.scss similarity index 100% rename from source/stylesheets/foundation/components/_inline-lists.scss rename to frontend/stylesheets/foundation/components/_inline-lists.scss diff --git a/source/stylesheets/foundation/components/_joyride.scss b/frontend/stylesheets/foundation/components/_joyride.scss similarity index 100% rename from source/stylesheets/foundation/components/_joyride.scss rename to frontend/stylesheets/foundation/components/_joyride.scss diff --git a/source/stylesheets/foundation/components/_keystrokes.scss b/frontend/stylesheets/foundation/components/_keystrokes.scss similarity index 100% rename from source/stylesheets/foundation/components/_keystrokes.scss rename to frontend/stylesheets/foundation/components/_keystrokes.scss diff --git a/source/stylesheets/foundation/components/_labels.scss b/frontend/stylesheets/foundation/components/_labels.scss similarity index 100% rename from source/stylesheets/foundation/components/_labels.scss rename to frontend/stylesheets/foundation/components/_labels.scss diff --git a/source/stylesheets/foundation/components/_magellan.scss b/frontend/stylesheets/foundation/components/_magellan.scss similarity index 100% rename from source/stylesheets/foundation/components/_magellan.scss rename to frontend/stylesheets/foundation/components/_magellan.scss diff --git a/source/stylesheets/foundation/components/_offcanvas.scss b/frontend/stylesheets/foundation/components/_offcanvas.scss similarity index 100% rename from source/stylesheets/foundation/components/_offcanvas.scss rename to frontend/stylesheets/foundation/components/_offcanvas.scss diff --git a/source/stylesheets/foundation/components/_orbit.scss b/frontend/stylesheets/foundation/components/_orbit.scss similarity index 100% rename from source/stylesheets/foundation/components/_orbit.scss rename to frontend/stylesheets/foundation/components/_orbit.scss diff --git a/source/stylesheets/foundation/components/_pagination.scss b/frontend/stylesheets/foundation/components/_pagination.scss similarity index 100% rename from source/stylesheets/foundation/components/_pagination.scss rename to frontend/stylesheets/foundation/components/_pagination.scss diff --git a/source/stylesheets/foundation/components/_panels.scss b/frontend/stylesheets/foundation/components/_panels.scss similarity index 100% rename from source/stylesheets/foundation/components/_panels.scss rename to frontend/stylesheets/foundation/components/_panels.scss diff --git a/source/stylesheets/foundation/components/_pricing-tables.scss b/frontend/stylesheets/foundation/components/_pricing-tables.scss similarity index 100% rename from source/stylesheets/foundation/components/_pricing-tables.scss rename to frontend/stylesheets/foundation/components/_pricing-tables.scss diff --git a/source/stylesheets/foundation/components/_progress-bars.scss b/frontend/stylesheets/foundation/components/_progress-bars.scss similarity index 100% rename from source/stylesheets/foundation/components/_progress-bars.scss rename to frontend/stylesheets/foundation/components/_progress-bars.scss diff --git a/source/stylesheets/foundation/components/_range-slider.scss b/frontend/stylesheets/foundation/components/_range-slider.scss similarity index 100% rename from source/stylesheets/foundation/components/_range-slider.scss rename to frontend/stylesheets/foundation/components/_range-slider.scss diff --git a/source/stylesheets/foundation/components/_reveal.scss b/frontend/stylesheets/foundation/components/_reveal.scss similarity index 100% rename from source/stylesheets/foundation/components/_reveal.scss rename to frontend/stylesheets/foundation/components/_reveal.scss diff --git a/source/stylesheets/foundation/components/_side-nav.scss b/frontend/stylesheets/foundation/components/_side-nav.scss similarity index 100% rename from source/stylesheets/foundation/components/_side-nav.scss rename to frontend/stylesheets/foundation/components/_side-nav.scss diff --git a/source/stylesheets/foundation/components/_split-buttons.scss b/frontend/stylesheets/foundation/components/_split-buttons.scss similarity index 100% rename from source/stylesheets/foundation/components/_split-buttons.scss rename to frontend/stylesheets/foundation/components/_split-buttons.scss diff --git a/source/stylesheets/foundation/components/_sub-nav.scss b/frontend/stylesheets/foundation/components/_sub-nav.scss similarity index 100% rename from source/stylesheets/foundation/components/_sub-nav.scss rename to frontend/stylesheets/foundation/components/_sub-nav.scss diff --git a/source/stylesheets/foundation/components/_switches.scss b/frontend/stylesheets/foundation/components/_switches.scss similarity index 100% rename from source/stylesheets/foundation/components/_switches.scss rename to frontend/stylesheets/foundation/components/_switches.scss diff --git a/source/stylesheets/foundation/components/_tables.scss b/frontend/stylesheets/foundation/components/_tables.scss similarity index 100% rename from source/stylesheets/foundation/components/_tables.scss rename to frontend/stylesheets/foundation/components/_tables.scss diff --git a/source/stylesheets/foundation/components/_tabs.scss b/frontend/stylesheets/foundation/components/_tabs.scss similarity index 100% rename from source/stylesheets/foundation/components/_tabs.scss rename to frontend/stylesheets/foundation/components/_tabs.scss diff --git a/source/stylesheets/foundation/components/_thumbs.scss b/frontend/stylesheets/foundation/components/_thumbs.scss similarity index 100% rename from source/stylesheets/foundation/components/_thumbs.scss rename to frontend/stylesheets/foundation/components/_thumbs.scss diff --git a/source/stylesheets/foundation/components/_tooltips.scss b/frontend/stylesheets/foundation/components/_tooltips.scss similarity index 100% rename from source/stylesheets/foundation/components/_tooltips.scss rename to frontend/stylesheets/foundation/components/_tooltips.scss diff --git a/source/stylesheets/foundation/components/_top-bar.scss b/frontend/stylesheets/foundation/components/_top-bar.scss similarity index 100% rename from source/stylesheets/foundation/components/_top-bar.scss rename to frontend/stylesheets/foundation/components/_top-bar.scss diff --git a/source/stylesheets/foundation/components/_type.scss b/frontend/stylesheets/foundation/components/_type.scss similarity index 100% rename from source/stylesheets/foundation/components/_type.scss rename to frontend/stylesheets/foundation/components/_type.scss diff --git a/source/stylesheets/foundation/components/_visibility.scss b/frontend/stylesheets/foundation/components/_visibility.scss similarity index 100% rename from source/stylesheets/foundation/components/_visibility.scss rename to frontend/stylesheets/foundation/components/_visibility.scss diff --git a/source/stylesheets/highlight.css.erb b/frontend/stylesheets/highlight.css.erb similarity index 100% rename from source/stylesheets/highlight.css.erb rename to frontend/stylesheets/highlight.css.erb diff --git a/source/stylesheets/normalize.scss b/frontend/stylesheets/normalize.scss similarity index 100% rename from source/stylesheets/normalize.scss rename to frontend/stylesheets/normalize.scss diff --git a/source/layouts/layout.html.haml b/source/layouts/layout.html.haml index e96d0ea..a720250 100644 --- a/source/layouts/layout.html.haml +++ b/source/layouts/layout.html.haml @@ -10,8 +10,7 @@ %title= "#{ current_page.data.title } - oaxaca.rb" = favicon_tag 'favicon.ico' = feed_tag :atom, "#{blog.options.prefix.to_s}/feed.xml", title: "Atom Feed" - = stylesheet_link_tag "all" - = javascript_include_tag "app" + = vite_javascript_tag "application" %body{:class => page_classes} / Nav Bar #main.row From a68d732c010286a75b369e9e968443f51a5575b5 Mon Sep 17 00:00:00 2001 From: Juan Vasquez Date: Sat, 3 Dec 2022 22:19:31 -0600 Subject: [PATCH 5/7] Add Procfile --- Procfile | 2 ++ Procfile.dev | 2 ++ README.md | 30 ++++++++++++++++++------------ config.rb | 6 ------ package.json | 4 ---- 5 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 Procfile create mode 100644 Procfile.dev diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..0a26e52 --- /dev/null +++ b/Procfile @@ -0,0 +1,2 @@ +vite: bin/vite build +web: bundle exec middleman server diff --git a/Procfile.dev b/Procfile.dev new file mode 100644 index 0000000..4f8466c --- /dev/null +++ b/Procfile.dev @@ -0,0 +1,2 @@ +vite: bin/vite dev +web: bundle exec middleman server diff --git a/README.md b/README.md index 03ab9ce..527986d 100644 --- a/README.md +++ b/README.md @@ -4,24 +4,30 @@ This website is powered by [Middleman](http://middlemanapp.com). - ## How to build the website? -* Clone the repository -* Change to **source** branch -``` +- Clone the repository +- Change to **source** branch + +```bash git checkout source ``` -* Install all the dependencies -``` + +- Install all the dependencies + +```bash bundle install ``` -* Run the server -``` -middleman server -``` -* The website is in http://localhost:4567 -* To deploy the site: + +- Run the server and visit http://localhost:4567 + +```bash +gem install foreman +foreman start -f Procfile.dev ``` + +- To deploy the site: + +```bash middleman deploy ``` diff --git a/config.rb b/config.rb index b0cf165..79302ca 100644 --- a/config.rb +++ b/config.rb @@ -12,12 +12,6 @@ end helpers VitePadrino::TagHelpers -activate :external_pipeline, - name: :vite, - command: build? ? "yarn run build" : "yarn run dev", - source: ".tmp/dist", - latency: 1 - activate :blog do |blog| # This will add a prefix to all links, template references and source paths # blog.prefix = "blog" diff --git a/package.json b/package.json index fbd107c..f436039 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,4 @@ { - "scripts": { - "dev": "vite dev", - "build": "vite build" - }, "devDependencies": { "sass": "^1.56.1", "vite": "^3.2.4", From 70c5ed845383da16e66b2833c35d760fc39019d7 Mon Sep 17 00:00:00 2001 From: Juan Vasquez Date: Sat, 3 Dec 2022 23:19:14 -0600 Subject: [PATCH 6/7] Use vite into the article layout --- source/layouts/article.html.haml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/layouts/article.html.haml b/source/layouts/article.html.haml index b9852f0..2c69d05 100644 --- a/source/layouts/article.html.haml +++ b/source/layouts/article.html.haml @@ -8,8 +8,7 @@ / Use title if it's in the page YAML frontmatter %title= "#{ current_article.title } - oaxaca.rb" unless current_article.nil? = feed_tag :atom, "#{blog.options.prefix.to_s}/feed.xml", title: "Atom Feed" - = stylesheet_link_tag "all" - = javascript_include_tag "app" + = vite_javascript_tag "application" %body{:class => page_classes} / Nav Bar #main.row From 084a103287fa1637da2eaf9eb995949ac032e560 Mon Sep 17 00:00:00 2001 From: Juan Vasquez Date: Sat, 3 Dec 2022 23:23:20 -0600 Subject: [PATCH 7/7] Move javascript --- frontend/entrypoints/application.js | 1 + frontend/javascripts/app.js | 15 +++++++++++++++ {source => frontend}/javascripts/foundation.js | 0 .../javascripts/foundation.min.js | 0 .../javascripts/foundation/foundation.abide.js | 0 .../foundation/foundation.accordion.js | 0 .../javascripts/foundation/foundation.alert.js | 0 .../javascripts/foundation/foundation.clearing.js | 0 .../javascripts/foundation/foundation.dropdown.js | 0 .../foundation/foundation.equalizer.js | 0 .../foundation/foundation.interchange.js | 0 .../javascripts/foundation/foundation.joyride.js | 0 .../javascripts/foundation/foundation.js | 0 .../javascripts/foundation/foundation.magellan.js | 0 .../foundation/foundation.offcanvas.js | 0 .../javascripts/foundation/foundation.orbit.js | 0 .../javascripts/foundation/foundation.reveal.js | 0 .../javascripts/foundation/foundation.tab.js | 0 .../javascripts/foundation/foundation.tooltip.js | 0 .../javascripts/foundation/foundation.topbar.js | 0 .../javascripts/vendor/fastclick.js | 0 .../javascripts/vendor/jquery.cookie.js | 0 {source => frontend}/javascripts/vendor/jquery.js | 0 .../javascripts/vendor/modernizr.js | 0 .../javascripts/vendor/placeholder.js | 0 .../javascripts/vendor/socialite.js | 0 source/_footer.html.haml | 7 ------- source/javascripts/app.js | 11 ----------- 28 files changed, 16 insertions(+), 18 deletions(-) create mode 100644 frontend/javascripts/app.js rename {source => frontend}/javascripts/foundation.js (100%) rename {source => frontend}/javascripts/foundation.min.js (100%) rename {source => frontend}/javascripts/foundation/foundation.abide.js (100%) rename {source => frontend}/javascripts/foundation/foundation.accordion.js (100%) rename {source => frontend}/javascripts/foundation/foundation.alert.js (100%) rename {source => frontend}/javascripts/foundation/foundation.clearing.js (100%) rename {source => frontend}/javascripts/foundation/foundation.dropdown.js (100%) rename {source => frontend}/javascripts/foundation/foundation.equalizer.js (100%) rename {source => frontend}/javascripts/foundation/foundation.interchange.js (100%) rename {source => frontend}/javascripts/foundation/foundation.joyride.js (100%) rename {source => frontend}/javascripts/foundation/foundation.js (100%) rename {source => frontend}/javascripts/foundation/foundation.magellan.js (100%) rename {source => frontend}/javascripts/foundation/foundation.offcanvas.js (100%) rename {source => frontend}/javascripts/foundation/foundation.orbit.js (100%) rename {source => frontend}/javascripts/foundation/foundation.reveal.js (100%) rename {source => frontend}/javascripts/foundation/foundation.tab.js (100%) rename {source => frontend}/javascripts/foundation/foundation.tooltip.js (100%) rename {source => frontend}/javascripts/foundation/foundation.topbar.js (100%) rename {source => frontend}/javascripts/vendor/fastclick.js (100%) rename {source => frontend}/javascripts/vendor/jquery.cookie.js (100%) rename {source => frontend}/javascripts/vendor/jquery.js (100%) rename {source => frontend}/javascripts/vendor/modernizr.js (100%) rename {source => frontend}/javascripts/vendor/placeholder.js (100%) rename {source => frontend}/javascripts/vendor/socialite.js (100%) delete mode 100644 source/javascripts/app.js diff --git a/frontend/entrypoints/application.js b/frontend/entrypoints/application.js index cc90125..791defa 100644 --- a/frontend/entrypoints/application.js +++ b/frontend/entrypoints/application.js @@ -5,3 +5,4 @@ console.log("Vite ⚡️ Ruby and Middleman"); import "~/stylesheets/all.scss"; +import "~/javascripts/app"; diff --git a/frontend/javascripts/app.js b/frontend/javascripts/app.js new file mode 100644 index 0000000..abf1330 --- /dev/null +++ b/frontend/javascripts/app.js @@ -0,0 +1,15 @@ +console.log("start"); +import "./vendor/jquery"; +import "./vendor/jquery.cookie"; +import "./vendor/fastclick"; +import "./vendor/modernizr"; +import "./vendor/placeholder"; +import "./foundation"; +import "./vendor/socialite"; + +$(document).foundation(); + +$(document).on("ready", function () { + Socialite.load("blog-social"); +}); +console.log("end"); diff --git a/source/javascripts/foundation.js b/frontend/javascripts/foundation.js similarity index 100% rename from source/javascripts/foundation.js rename to frontend/javascripts/foundation.js diff --git a/source/javascripts/foundation.min.js b/frontend/javascripts/foundation.min.js similarity index 100% rename from source/javascripts/foundation.min.js rename to frontend/javascripts/foundation.min.js diff --git a/source/javascripts/foundation/foundation.abide.js b/frontend/javascripts/foundation/foundation.abide.js similarity index 100% rename from source/javascripts/foundation/foundation.abide.js rename to frontend/javascripts/foundation/foundation.abide.js diff --git a/source/javascripts/foundation/foundation.accordion.js b/frontend/javascripts/foundation/foundation.accordion.js similarity index 100% rename from source/javascripts/foundation/foundation.accordion.js rename to frontend/javascripts/foundation/foundation.accordion.js diff --git a/source/javascripts/foundation/foundation.alert.js b/frontend/javascripts/foundation/foundation.alert.js similarity index 100% rename from source/javascripts/foundation/foundation.alert.js rename to frontend/javascripts/foundation/foundation.alert.js diff --git a/source/javascripts/foundation/foundation.clearing.js b/frontend/javascripts/foundation/foundation.clearing.js similarity index 100% rename from source/javascripts/foundation/foundation.clearing.js rename to frontend/javascripts/foundation/foundation.clearing.js diff --git a/source/javascripts/foundation/foundation.dropdown.js b/frontend/javascripts/foundation/foundation.dropdown.js similarity index 100% rename from source/javascripts/foundation/foundation.dropdown.js rename to frontend/javascripts/foundation/foundation.dropdown.js diff --git a/source/javascripts/foundation/foundation.equalizer.js b/frontend/javascripts/foundation/foundation.equalizer.js similarity index 100% rename from source/javascripts/foundation/foundation.equalizer.js rename to frontend/javascripts/foundation/foundation.equalizer.js diff --git a/source/javascripts/foundation/foundation.interchange.js b/frontend/javascripts/foundation/foundation.interchange.js similarity index 100% rename from source/javascripts/foundation/foundation.interchange.js rename to frontend/javascripts/foundation/foundation.interchange.js diff --git a/source/javascripts/foundation/foundation.joyride.js b/frontend/javascripts/foundation/foundation.joyride.js similarity index 100% rename from source/javascripts/foundation/foundation.joyride.js rename to frontend/javascripts/foundation/foundation.joyride.js diff --git a/source/javascripts/foundation/foundation.js b/frontend/javascripts/foundation/foundation.js similarity index 100% rename from source/javascripts/foundation/foundation.js rename to frontend/javascripts/foundation/foundation.js diff --git a/source/javascripts/foundation/foundation.magellan.js b/frontend/javascripts/foundation/foundation.magellan.js similarity index 100% rename from source/javascripts/foundation/foundation.magellan.js rename to frontend/javascripts/foundation/foundation.magellan.js diff --git a/source/javascripts/foundation/foundation.offcanvas.js b/frontend/javascripts/foundation/foundation.offcanvas.js similarity index 100% rename from source/javascripts/foundation/foundation.offcanvas.js rename to frontend/javascripts/foundation/foundation.offcanvas.js diff --git a/source/javascripts/foundation/foundation.orbit.js b/frontend/javascripts/foundation/foundation.orbit.js similarity index 100% rename from source/javascripts/foundation/foundation.orbit.js rename to frontend/javascripts/foundation/foundation.orbit.js diff --git a/source/javascripts/foundation/foundation.reveal.js b/frontend/javascripts/foundation/foundation.reveal.js similarity index 100% rename from source/javascripts/foundation/foundation.reveal.js rename to frontend/javascripts/foundation/foundation.reveal.js diff --git a/source/javascripts/foundation/foundation.tab.js b/frontend/javascripts/foundation/foundation.tab.js similarity index 100% rename from source/javascripts/foundation/foundation.tab.js rename to frontend/javascripts/foundation/foundation.tab.js diff --git a/source/javascripts/foundation/foundation.tooltip.js b/frontend/javascripts/foundation/foundation.tooltip.js similarity index 100% rename from source/javascripts/foundation/foundation.tooltip.js rename to frontend/javascripts/foundation/foundation.tooltip.js diff --git a/source/javascripts/foundation/foundation.topbar.js b/frontend/javascripts/foundation/foundation.topbar.js similarity index 100% rename from source/javascripts/foundation/foundation.topbar.js rename to frontend/javascripts/foundation/foundation.topbar.js diff --git a/source/javascripts/vendor/fastclick.js b/frontend/javascripts/vendor/fastclick.js similarity index 100% rename from source/javascripts/vendor/fastclick.js rename to frontend/javascripts/vendor/fastclick.js diff --git a/source/javascripts/vendor/jquery.cookie.js b/frontend/javascripts/vendor/jquery.cookie.js similarity index 100% rename from source/javascripts/vendor/jquery.cookie.js rename to frontend/javascripts/vendor/jquery.cookie.js diff --git a/source/javascripts/vendor/jquery.js b/frontend/javascripts/vendor/jquery.js similarity index 100% rename from source/javascripts/vendor/jquery.js rename to frontend/javascripts/vendor/jquery.js diff --git a/source/javascripts/vendor/modernizr.js b/frontend/javascripts/vendor/modernizr.js similarity index 100% rename from source/javascripts/vendor/modernizr.js rename to frontend/javascripts/vendor/modernizr.js diff --git a/source/javascripts/vendor/placeholder.js b/frontend/javascripts/vendor/placeholder.js similarity index 100% rename from source/javascripts/vendor/placeholder.js rename to frontend/javascripts/vendor/placeholder.js diff --git a/source/javascripts/vendor/socialite.js b/frontend/javascripts/vendor/socialite.js similarity index 100% rename from source/javascripts/vendor/socialite.js rename to frontend/javascripts/vendor/socialite.js diff --git a/source/_footer.html.haml b/source/_footer.html.haml index 3c3fa4a..1853a54 100644 --- a/source/_footer.html.haml +++ b/source/_footer.html.haml @@ -16,10 +16,3 @@ %a{:href => "/about.html"} Acerca de %li %a{:href => "/contacto.html"} Contacto - -:javascript - $(document).foundation(); - - var doc = document.documentElement; - doc.setAttribute('data-useragent', navigator.userAgent); - diff --git a/source/javascripts/app.js b/source/javascripts/app.js deleted file mode 100644 index 08e0ac9..0000000 --- a/source/javascripts/app.js +++ /dev/null @@ -1,11 +0,0 @@ -//= require 'vendor/jquery' -//= require_tree './vendor' -//= require 'foundation' -//= require_tree './foundation' -//= require vendor/socialite - -$(document).foundation(); - -$(document).ready(function(){ - Socialite.load("blog-social"); -});