discourse_theme 2.1.1 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd374430e4fb62d3c7ee98ebdc23af4709f699dc5b2580c216a12dd0d52fd6fb
4
- data.tar.gz: db348e6b482980219f236b1fbbdf9a6a2d1d8e72fe46fce6386fcad35358878a
3
+ metadata.gz: 1a1b176be2b726cec5d2c4217e000357d48044bc220f4730cd4b1f4a21405230
4
+ data.tar.gz: 822de35cae0fffa0996b32f1c77a384ecb460df586eae15ef3b1cee8f132f5fb
5
5
  SHA512:
6
- metadata.gz: 79bf80af701810f3f9e35c0b17a1c2d8d854222a09ae9451eecd1796776cb2f0f6d4f5a931a529236f7eebc23c687eb040bce941c8df581b08b633b24dea1f7b
7
- data.tar.gz: 77f09a916e25c7bd87407bd6f5c466bd75709a941c2930543977079f175916193d209db336886107dd650dd4a3be128d4c0524784d915fafee048549e3364fa2
6
+ metadata.gz: 30d3d32f3df8d65702daa5d7ca9bb1f34b9730e4118bf4dbfb696afe2426c0379e36cefc17a0c75c370206b1d335eff8ba1b3fefbfa67b730bc5b2212e469f1b
7
+ data.tar.gz: dc5e86580dbf0f4350ae4a06978a3750844b9a90afbf2c3c885968f64e8b77e5076a0eccadb939c749ec9096fe9a3ebefbc275125ed2b080696bd05cfb8fdd7c
@@ -45,6 +45,9 @@ jobs:
45
45
  git config --global user.email "ci@ci.invalid"
46
46
  git config --global user.name "Discourse CI"
47
47
 
48
+ - name: Install pnpm
49
+ run: npm install -g pnpm
50
+
48
51
  - name: Setup ruby
49
52
  uses: ruby/setup-ruby@v1
50
53
  with:
data/CHANGELOG.md CHANGED
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.1.3] - 2024-10-09
9
+
10
+ ### Added
11
+
12
+ - Made `new` command compatible with the replacement of `yarn` with `pnpm` as a package manager, and will prompt users to install `pnpm` if not installed already.
13
+
14
+ ## [2.1.2] - 2024-04-16
15
+
16
+ ### Added
17
+
18
+ - Suggest the root URL of the local site when running `watch` command
19
+
8
20
  ## [2.1.1] - 2024-03-25
9
21
 
10
22
  ### Added
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  lib = File.expand_path("../lib", __FILE__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ $LOAD_PATH.unshift(lib) if !$LOAD_PATH.include?(lib)
5
5
  require "discourse_theme/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.add_development_dependency "guard"
37
37
  spec.add_development_dependency "guard-minitest"
38
38
  spec.add_development_dependency "webmock"
39
- spec.add_development_dependency "rubocop-discourse", "~> 3.6.0"
39
+ spec.add_development_dependency "rubocop-discourse", "~> 3.8.1"
40
40
  spec.add_development_dependency "m"
41
41
  spec.add_development_dependency "syntax_tree"
42
42
  spec.add_development_dependency "mocha"
@@ -61,6 +61,7 @@ module DiscourseTheme
61
61
  end
62
62
  raise DiscourseTheme::ThemeError.new "git is not installed" if !command?("git")
63
63
  raise DiscourseTheme::ThemeError.new "yarn is not installed" if !command?("yarn")
64
+ raise DiscourseTheme::ThemeError.new "pnpm is not installed" if !command?("pnpm")
64
65
 
65
66
  DiscourseTheme::Scaffold.generate(dir, name: args[1])
66
67
  watch_theme?(args)
@@ -177,7 +177,10 @@ module DiscourseTheme
177
177
  end
178
178
 
179
179
  if !url || @reset
180
- url = normalize_url(UI.ask("What is the root URL of your Discourse site?", default: url))
180
+ url =
181
+ normalize_url(
182
+ UI.ask("What is the root URL of your Discourse site?", default: settings.possible_url),
183
+ )
181
184
  url = "http://#{url}" unless url =~ %r{^https?://}
182
185
 
183
186
  # maybe this is an HTTPS redirect
@@ -22,6 +22,13 @@ class DiscourseTheme::Config
22
22
  set("url", val)
23
23
  end
24
24
 
25
+ def possible_url
26
+ return safe_config["url"] if safe_config["url"]
27
+
28
+ first_config = @config.raw_config.values.find { |config| config["url"] }
29
+ first_config["url"] if first_config
30
+ end
31
+
25
32
  def theme_id
26
33
  safe_config["theme_id"].to_i
27
34
  end
@@ -65,7 +65,14 @@ module DiscourseTheme
65
65
  exception: true
66
66
 
67
67
  UI.info "Installing dependencies"
68
- system "yarn", exception: true
68
+ if File.exist?("yarn.lock")
69
+ system "yarn", exception: true
70
+ elsif File.exist?("pnpm-lock.yaml")
71
+ system "pnpm", "install", exception: true
72
+ else
73
+ UI.warn "No lock file found. Defaulting to pnpm."
74
+ system "pnpm", "install", exception: true
75
+ end
69
76
  end
70
77
 
71
78
  puts "✅ Done!"
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module DiscourseTheme
3
- VERSION = "2.1.1"
3
+ VERSION = "2.1.3"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discourse_theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-26 00:00:00.000000000 Z
11
+ date: 2024-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitar
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 3.6.0
187
+ version: 3.8.1
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 3.6.0
194
+ version: 3.8.1
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: m
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -285,7 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
285
285
  - !ruby/object:Gem::Version
286
286
  version: '0'
287
287
  requirements: []
288
- rubygems_version: 3.5.3
288
+ rubygems_version: 3.5.16
289
289
  signing_key:
290
290
  specification_version: 4
291
291
  summary: CLI helper for creating Discourse themes