discourse_theme 2.1.3 → 2.1.5

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: 1a1b176be2b726cec5d2c4217e000357d48044bc220f4730cd4b1f4a21405230
4
- data.tar.gz: 822de35cae0fffa0996b32f1c77a384ecb460df586eae15ef3b1cee8f132f5fb
3
+ metadata.gz: 65cd5666c0937365d1d5ede238383ceb7da12d5ce9cc0e3ea730f1a09a04eb16
4
+ data.tar.gz: a4f632261be03ae844957d893ce0eee1da233d56c11a4fa11c917cde3b3eb941
5
5
  SHA512:
6
- metadata.gz: 30d3d32f3df8d65702daa5d7ca9bb1f34b9730e4118bf4dbfb696afe2426c0379e36cefc17a0c75c370206b1d335eff8ba1b3fefbfa67b730bc5b2212e469f1b
7
- data.tar.gz: dc5e86580dbf0f4350ae4a06978a3750844b9a90afbf2c3c885968f64e8b77e5076a0eccadb939c749ec9096fe9a3ebefbc275125ed2b080696bd05cfb8fdd7c
6
+ metadata.gz: 4e2d77fc256d7c9392a9526a9753416522afb9820f848494de851972cf44158f0391c60197a21aa8e3e0a0e88ab227611327eebe247251ac381bf05b7f3cdf0d
7
+ data.tar.gz: d7e620016dd7b4e9fab15d8f1b92a69c543a0d6d6f86ccd066a15412416ff71b636d27b85d57e0092d6978b7ba79c408243a33a5a83de32f5aedb154c3075f74
@@ -7,8 +7,8 @@ require "discourse_theme/version"
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = "discourse_theme"
9
9
  spec.version = DiscourseTheme::VERSION
10
- spec.authors = ["Sam Saffron"]
11
- spec.email = ["sam.saffron@gmail.com"]
10
+ spec.authors = ["Discourse Team"]
11
+ spec.email = ["team@discourse.org"]
12
12
 
13
13
  spec.summary = "CLI helper for creating Discourse themes"
14
14
  spec.description = "CLI helper for creating Discourse themes"
@@ -13,6 +13,10 @@ module DiscourseTheme
13
13
  @@cli_settings_filename = filename
14
14
  end
15
15
 
16
+ def self.command?(cmd)
17
+ system "which", cmd, out: File::NULL, err: File::NULL
18
+ end
19
+
16
20
  def usage
17
21
  puts <<~USAGE
18
22
  Usage: discourse_theme COMMAND [DIR] [OPTIONS]
@@ -59,9 +63,7 @@ module DiscourseTheme
59
63
  if Dir.exist?(dir) && !Dir.empty?(dir)
60
64
  raise DiscourseTheme::ThemeError.new "'#{dir}' is not empty"
61
65
  end
62
- raise DiscourseTheme::ThemeError.new "git is not installed" if !command?("git")
63
- raise DiscourseTheme::ThemeError.new "yarn is not installed" if !command?("yarn")
64
- raise DiscourseTheme::ThemeError.new "pnpm is not installed" if !command?("pnpm")
66
+ raise DiscourseTheme::ThemeError.new "git is not installed" if !Cli.command?("git")
65
67
 
66
68
  DiscourseTheme::Scaffold.generate(dir, name: args[1])
67
69
  watch_theme?(args)
@@ -249,20 +251,6 @@ module DiscourseTheme
249
251
  end
250
252
  end
251
253
 
252
- def command?(cmd)
253
- exts = ENV["PATHEXT"] ? ENV["PATHEXT"].split(";") : [""]
254
- ENV["PATH"]
255
- .split(File::PATH_SEPARATOR)
256
- .each do |path|
257
- exts.each do |ext|
258
- exe = File.join(path, "#{cmd}#{ext}")
259
- return true if File.executable?(exe) && !File.directory?(exe)
260
- end
261
- end
262
-
263
- false
264
- end
265
-
266
254
  def watch_theme?(args)
267
255
  if UI.yes?("Would you like to start 'watching' this theme?")
268
256
  args[0] = "watch"
@@ -64,19 +64,16 @@ module DiscourseTheme
64
64
  "--quiet",
65
65
  exception: true
66
66
 
67
- UI.info "Installing dependencies"
68
- if File.exist?("yarn.lock")
69
- system "yarn", exception: true
70
- elsif File.exist?("pnpm-lock.yaml")
67
+ if Cli.command?("pnpm")
68
+ UI.info "Installing dependencies"
71
69
  system "pnpm", "install", exception: true
72
70
  else
73
- UI.warn "No lock file found. Defaulting to pnpm."
74
- system "pnpm", "install", exception: true
71
+ UI.warn "`pnpm` is not installed, skipping installation of linting dependencies"
75
72
  end
76
73
  end
77
74
 
78
75
  puts "✅ Done!"
79
- puts "See https://meta.discourse.org/t/how-to-develop-custom-themes/60848 for more information!"
76
+ puts "See https://meta.discourse.org/t/93648 for more information!"
80
77
  end
81
78
 
82
79
  private
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module DiscourseTheme
3
- VERSION = "2.1.3"
3
+ VERSION = "2.1.5"
4
4
  end
@@ -16,7 +16,7 @@ module DiscourseTheme
16
16
 
17
17
  def watch
18
18
  listener =
19
- Listen.to(@dir) do |modified, added, removed|
19
+ Listen.to(@dir, ignore: %r{^node_modules/}) do |modified, added, removed|
20
20
  begin
21
21
  if modified.length == 1 && added.length == 0 && removed.length == 0 &&
22
22
  (resolved = resolve_file(modified[0]))
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discourse_theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
- - Sam Saffron
8
- autorequire:
7
+ - Discourse Team
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-10-08 00:00:00.000000000 Z
10
+ date: 2025-03-03 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: minitar
@@ -236,7 +235,7 @@ dependencies:
236
235
  version: '0'
237
236
  description: CLI helper for creating Discourse themes
238
237
  email:
239
- - sam.saffron@gmail.com
238
+ - team@discourse.org
240
239
  executables:
241
240
  - discourse_theme
242
241
  extensions: []
@@ -270,7 +269,6 @@ homepage: https://github.com/discourse/discourse_theme
270
269
  licenses:
271
270
  - MIT
272
271
  metadata: {}
273
- post_install_message:
274
272
  rdoc_options: []
275
273
  require_paths:
276
274
  - lib
@@ -285,8 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
285
283
  - !ruby/object:Gem::Version
286
284
  version: '0'
287
285
  requirements: []
288
- rubygems_version: 3.5.16
289
- signing_key:
286
+ rubygems_version: 3.6.2
290
287
  specification_version: 4
291
288
  summary: CLI helper for creating Discourse themes
292
289
  test_files: []