rubyjs-vite 1.1.0 → 1.1.2

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: dc37ed24ae1f1bfbdaf4300b70079b7e493f45322236d354300a3ce7357cff8d
4
- data.tar.gz: b63b927b8d7248533ec2672f14ce120ad64dedf9d54cfb142422f96ea5ae7923
3
+ metadata.gz: 32802ca4b76727a9cd52de549aa8ee048005144e6ae8350b797ebff0766a8701
4
+ data.tar.gz: 0a3a8f3f6d257eaff408611b97dd68b42524299bef41a6d5f7d1a18622688e21
5
5
  SHA512:
6
- metadata.gz: 5e4952c7c7bbe8ed80341003967ae70f25672a09db5a0f864c565446750611fedbd0f90146a9117e698b6b4f1c305f7b436d2a39f98e1822ed8f388ef44e53bf
7
- data.tar.gz: 1e03c761e1bb377a2e4c07278fbeaf4a5cbae779b61e1afd54407394fe13c5227a5c4bddf3c1a032ff48b800275d8ebe4c487a43954c2880702c90148967975e
6
+ metadata.gz: 81233b61831343a8aa32e6378ebbf0f4a0e037886a604c658825fea082747549bac583dd00bb1805c01c62c735ee9f4c4598d0fb6f9510700c9ac117e933a634
7
+ data.tar.gz: d4a594a45001d29114f26f1df0f9ba78df3e38fb04435cb4846c71f2f4ff851d3607cc534d6ff3f5e490984d834c7d1277a7a9a46c3e37f583850ee0e41ed055
data/app/arguments.rb CHANGED
@@ -7,7 +7,8 @@ require "option_parser"
7
7
  output: Dir.pwd,
8
8
  output_type: RubyJS::Constants::FILE_TYPE_O,
9
9
  source: Dir.pwd,
10
- eslevel: Config::get_eslevel
10
+ eslevel: Config::get_eslevel,
11
+ pid: nil,
11
12
  }
12
13
 
13
14
  OptionParser.parse do |parser|
@@ -55,6 +56,10 @@ OptionParser.parse do |parser|
55
56
 
56
57
  @options[:eslevel] = level.to_i
57
58
  end
59
+ parser.on("--pid PROCESS", "", "When the pid is set, the SIGUSR1\n" +
60
+ "signal is triggered." ) do |pid|
61
+ @options[:pid] = pid.to_i
62
+ end
58
63
  parser.on("--create PROJECT", nil, "Creates a new project using scaffolding." ) do |project|
59
64
  RubyJS::Scaffold.create project
60
65
  exit
data/app/main.rb CHANGED
@@ -38,7 +38,16 @@ if @options[:compile]
38
38
  end
39
39
 
40
40
  if @options[:watch]
41
+ h_sigusr = lambda do
42
+ pid = @options[:pid]
43
+ if pid
44
+ Process.kill("USR1", pid)
45
+ end
46
+ end
47
+
41
48
  puts RubyJS::Helper.event_p("message", "There is now a watch for edited files.")
49
+ h_sigusr.call()
50
+
42
51
  path_s = @options[:source]
43
52
 
44
53
  RubyJS::Helper.create_dir(path_s)
@@ -60,5 +69,7 @@ if @options[:watch]
60
69
  type_o: @options[:output_type],
61
70
  }
62
71
  end
72
+
73
+ h_sigusr.call()
63
74
  end
64
75
  end
@@ -25,7 +25,7 @@ module RubyJS
25
25
 
26
26
  def self.free path_fro
27
27
  # File
28
- File.delete(path_fro) if File.exists? path_fro
28
+ File.delete(path_fro) if File.exist? path_fro
29
29
  # Dir
30
30
  path_dro = File.dirname(path_fro)
31
31
  Dir.delete(path_dro) if Dir.empty? path_dro
@@ -7,14 +7,11 @@ module RubyJS
7
7
  path_ao = File.join(Dir.pwd, project)
8
8
 
9
9
  puts "Scaffolding project in #{path_ao}..."
10
- unless Dir.exist? path_ao
11
- FileUtils.cp_r(path_as, path_ao)
12
- else
13
- files = Dir.glob("#{path_as}/**/*")
14
- files.each do |pas|
15
- pao = pas.sub(path_as, path_ao)
16
- FileUtils.cp_r(pas, pao)
17
- end
10
+ files = Dir.glob("#{path_as}/**/*", File::FNM_DOTMATCH).select { |f| File.file?(f) }
11
+ files.each do |pas|
12
+ pao = pas.sub(path_as, path_ao)
13
+ FileUtils.mkdir_p(File.dirname(pao))
14
+ FileUtils.cp(pas, pao)
18
15
  end
19
16
 
20
17
  json_oc = JsonParser.new File.join(path_ao, "package.json")
@@ -1,3 +1,3 @@
1
1
  module RubyJS
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.2"
3
3
  end
data/lib/ruby_js.rb CHANGED
@@ -24,7 +24,8 @@ module RubyJS
24
24
 
25
25
  begin
26
26
  content_rb = Helper.open(path_f)
27
- content_js = Ruby2JS.convert(content_rb, eslevel: options[:eslevel]) unless content_rb.empty?
27
+ content_js = Ruby2JS.convert(content_rb, eslevel: options[:eslevel],
28
+ filters: [:camelCase]) unless content_rb.empty?
28
29
 
29
30
  path_write = Helper.write(path_o, content_js)
30
31
  puts Helper.event_p("compiled", path_o)
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "project",
3
+ "ignore": [
4
+ "FILE_N_.*.rjs",
5
+ "test.rjs",
6
+ "main.rjs"
7
+ ]
8
+ }
@@ -0,0 +1,24 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyjs-vite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Filip Vrba
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-04 00:00:00.000000000 Z
11
+ date: 2023-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby2js
@@ -60,6 +60,8 @@ files:
60
60
  - lib/ruby_js/helper.rb
61
61
  - lib/ruby_js/scaffold.rb
62
62
  - lib/ruby_js/version.rb
63
+ - share/template/.codejoin
64
+ - share/template/.gitignore
63
65
  - share/template/bin/generate
64
66
  - share/template/bin/server
65
67
  - share/template/bin/watch