next_rails_scaffold 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 195a1ccf90ee28354555ce504dc25ff17f6515101c508e8b705cbe5fa0c4b2c7
4
- data.tar.gz: a3c0c958f340ae052a235b6c1c61285a4f95fe27ba4ad9431fa6eb75c143586a
3
+ metadata.gz: 290814ff4b89e5daa4c89b5582625700486c2388b00e75b7cb0fb86bcad793ba
4
+ data.tar.gz: 7e348321d3d3993b7ba59c1f510c8e617877406d421a0cc14f0649e79a56ce09
5
5
  SHA512:
6
- metadata.gz: 95b824a162a6ba13a7b0f12138bcffcfd27b5d1b2adcf33906cbda6d1bb8e5f3cd87ff2ca9ddeea6ee65b8c31f239eb19b940df4c81dd36845551c0e07ad8b98
7
- data.tar.gz: d5ab3b8a2f828d610a14438a3dc5f291a1fb034cd929903d5d2f3771df067017937746e3823473bab1735d4057a3fc45067d16159f339de6346b6380a2e7db9d
6
+ metadata.gz: 81ca951de2a7f4acd112c7e8db80401f422975581b2de334633cff4bc9c0c26b37b5e5036bdb2d415e78339db1b196931bf3c39966c8040653cebb94ee20de1c
7
+ data.tar.gz: fbd1ac9e2b34d059850ca59e50d6301c3aecf536df62c6f399e1644d0c0553e034cbe104b62ca68795a181a9c22d0c73f31704f662f1688e999519625cd4b5e7
data/README.md CHANGED
@@ -55,7 +55,7 @@ Example:
55
55
  bin/rails generate next_rails_scaffold:install
56
56
 
57
57
  # Generate the RESfull API endpoints and Next.js app with respective components and pages.
58
- bin/rails generate scaffold Post tile:string body:text
58
+ bin/rails generate scaffold Post title:string body:text
59
59
  ```
60
60
 
61
61
  This will create:
@@ -6,9 +6,9 @@ module Rails
6
6
 
7
7
  source_root File.expand_path("templates", __dir__)
8
8
 
9
- NODE_REQUIRED_VERSION = ">= 18.18.0"
10
- YARN_VERSION = "4.5.3"
11
- NEXT_VERSION = "15.0.3"
9
+ NODE_REQUIRED_VERSION = ENV.fetch("NODE_REQUIRED_VERSION", ">= 18.18.0")
10
+ YARN_VERSION = ENV.fetch("YARN_VERSION", "4.5.3")
11
+ NEXT_VERSION = ENV.fetch("NEXT_VERSION", "15.0.3")
12
12
 
13
13
  argument :attributes, type: :array, default: [], banner: "field:type field:type"
14
14
 
@@ -50,7 +50,9 @@ module Rails
50
50
  create_next_app!
51
51
  install_hygen!
52
52
 
53
- run("npx hygen scaffold javascript #{name} #{mapped_attributes.join(" ")}")
53
+ language = File.exist?("tsconfig.json") ? "typescript" : "javascript"
54
+
55
+ run("npx hygen scaffold #{language} #{name} #{mapped_attributes.join(" ")}")
54
56
  run("yarn build")
55
57
  end
56
58
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NextRailsScaffold
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: next_rails_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raphael Araújo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-27 00:00:00.000000000 Z
11
+ date: 2025-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails