discourse_theme 2.1.4 → 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: e7b8d105b14bd38cbfec08a6a7f0e77245dbfdcd4d311c9589aed4e039ba4e91
4
- data.tar.gz: d444c4ccf8343f5a7aeb3c6a5b6ab981108d12d71cdabc1a9604a30414c6be3f
3
+ metadata.gz: 65cd5666c0937365d1d5ede238383ceb7da12d5ce9cc0e3ea730f1a09a04eb16
4
+ data.tar.gz: a4f632261be03ae844957d893ce0eee1da233d56c11a4fa11c917cde3b3eb941
5
5
  SHA512:
6
- metadata.gz: 853e252824cb6274a18cf813bdd344065a8154704c6a25b9261c9fcb3f74e0394a64a6a2de8511d995dd8b5d2d7269b58af521aa4bf46544a4facf336ef84748
7
- data.tar.gz: 46857c696793e4c6be343f383e773698745d68ef34971147630e6f070c6c2c406fbd0cc57c44612abf7fb41d83d595be6912b6276a375f22ad3f6eda73ddaf00
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.4"
3
+ VERSION = "2.1.5"
4
4
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discourse_theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
- - Sam Saffron
7
+ - Discourse Team
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-09 00:00:00.000000000 Z
10
+ date: 2025-03-03 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: minitar
@@ -235,7 +235,7 @@ dependencies:
235
235
  version: '0'
236
236
  description: CLI helper for creating Discourse themes
237
237
  email:
238
- - sam.saffron@gmail.com
238
+ - team@discourse.org
239
239
  executables:
240
240
  - discourse_theme
241
241
  extensions: []