hephaestus 0.8.12 → 0.8.12.1

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: '06528561509ef978d2df34dc6ae67b75a91d26a67fda79fa97fbdd4dde886ab4'
4
- data.tar.gz: eb3559c45d3a7bf42221d346a344baaabbe44880dd755c87da5ff8109da11e93
3
+ metadata.gz: 89c0585bf79ff89a4a35d183a6bdec69ec180effa6c5254aec22467093efeefa
4
+ data.tar.gz: 0aefd45fc0dd8549a845f49b510ba9ec7fbe991c85af3f7c9e65e79ed613c9ca
5
5
  SHA512:
6
- metadata.gz: 56d6a0b8f9f823cc930230c9d2462d6f0fec6f801487acdbae3add9a63d7508100cf862c48c836e18bdfdcd30f7b261b77726469be194db352cb55ba90fdb119
7
- data.tar.gz: 1ea2bffff5ee8de27ae0de2a4657775bbad4bdddb82f369787e09ebb3fc9ec541316564e69609eb3fa70e708c9970667816e6f7e57a596fd50f567071c514a3a
6
+ metadata.gz: 1dcf277f2074215cbf3b207d99534f5bdcf2fd6deb9ed62d6c10e3c87680da8184a30a7e5cfce6ce58e05df6173fb1d808e1fc48edb45f4f1ee4627af2bf2054
7
+ data.tar.gz: 96c5fbb95236e5fe15fd538742c89010e6d9a581b2cfbf3ce70677b7412a1a48301c8f58a68521b7f0b0d45a79f253ca0f5eb31f2475049584d322c491b6214a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # [v0.8.12.1] - 16-12-2024
2
+ ## What's Changed
3
+ * general updates by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/95
4
+
5
+
6
+ **Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.8.12...v0.8.12.1
1
7
  # [v0.8.12] - 16-12-2024
2
8
  ## What's Changed
3
9
  * Update template generator by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/93
data/bin/hephaestus CHANGED
@@ -34,6 +34,16 @@ if (str = ARGV.first)
34
34
  end
35
35
  end
36
36
 
37
+ if ARGV.empty?
38
+ puts "Please provide a path for the new application"
39
+ puts
40
+ puts "See --help for more info"
41
+ exit 0
42
+ elsif ["-v", "--version"].include?(ARGV[0])
43
+ puts Hephaestus::VERSION
44
+ exit 0
45
+ end
46
+
37
47
  if ENV.fetch("HEPHAESTUS_NO_EXTERNAL", "0") == "1"
38
48
  puts Rainbow("Skipping Hephaestus check...").yellow
39
49
  else
@@ -59,16 +69,6 @@ end
59
69
 
60
70
  puts Rainbow("Looking good! Proceeding...").blue
61
71
 
62
- if ARGV.empty?
63
- puts "Please provide a path for the new application"
64
- puts
65
- puts "See --help for more info"
66
- exit 0
67
- elsif ["-v", "--version"].include?(ARGV[0])
68
- puts Hephaestus::VERSION
69
- exit 0
70
- end
71
-
72
72
  path = ARGV.first
73
73
  if File.exist?(path)
74
74
  puts Rainbow("\nError: The directory #{path} already exists.").red
@@ -8,7 +8,6 @@ require "tempfile"
8
8
  require "hephaestus/app_name"
9
9
  module Hephaestus
10
10
  class AppGenerator < Rails::Generators::AppGenerator
11
- include ExitOnFailure
12
11
  include Hephaestus::AppName
13
12
 
14
13
  hide!
@@ -55,12 +54,17 @@ module Hephaestus
55
54
 
56
55
  def customize_gemfile
57
56
  say(set_color("Customizing Gemfile...", :cyan))
58
- build(:replace_gemfile)
57
+ template("Gemfile", "Gemfile", force: true)
58
+ # FIXME: unsure why, but when the generators are called, Rails expects Gemfiles in these locations?
59
+ copy_file("Gemfile", File.join(Hephaestus::AppGenerator.source_root, "Gemfile"))
60
+ copy_file("Gemfile", File.join(Hephaestus::AppGenerator.source_root, "..", "Gemfile"))
61
+ replace_in_files(Hephaestus::AppGenerator.source_root, %|ruby File.read(".ruby-version").strip|, %|ruby "#{Hephaestus::RUBY_VERSION}"|)
62
+
59
63
  unless ENV.fetch("HEPHAESTUS_NO_EXTERNAL", "0") == "1"
60
64
  capture_stdout do
61
- bundle_command("install")
62
- bundle_command("update")
63
- bundle_command("lock --add-platform x86_64-linux")
65
+ run("BUNDLE_GEMFILE=\"#{destination_root}/Gemfile\" bundle install", abort_on_failure: false)
66
+ run("BUNDLE_GEMFILE=\"#{destination_root}/Gemfile\" bundle update")
67
+ run("BUNDLE_GEMFILE=\"#{destination_root}/Gemfile\" bundle lock --add-platform x86_64-linux")
64
68
  end
65
69
  end
66
70
  end
@@ -69,7 +73,7 @@ module Hephaestus
69
73
  say(set_color("Copying GitHub Actions...", :cyan))
70
74
 
71
75
  capture_stdout do
72
- directory(Hephaestus.source_path(".github"), ".github", force: true)
76
+ directory("hephaestus_github", ".github", force: true)
73
77
  end
74
78
  end
75
79
 
@@ -77,7 +81,7 @@ module Hephaestus
77
81
  say(set_color("Copying .vscode/...", :cyan))
78
82
 
79
83
  capture_stdout do
80
- directory(Hephaestus.source_path(".vscode"), ".vscode")
84
+ directory("hephaestus_vscode", ".vscode")
81
85
  end
82
86
  end
83
87
 
@@ -132,7 +136,6 @@ module Hephaestus
132
136
  directory("lib/schemas/api/2023-03-06", "lib/schemas/api/2023-03-06")
133
137
  end
134
138
 
135
- # This is h
136
139
  # we do this to specify the template source, otherwise the generator wants to use Rails own `bin` dir
137
140
  source = File.join(Hephaestus::Engine.root, "templates", "bin")
138
141
  directory(source, "bin", force: true)
@@ -173,6 +176,9 @@ module Hephaestus
173
176
  # generate("hephaestus:sorbet")
174
177
  # end
175
178
 
179
+ replace_in_file(File.join("lib", "schemas", "api", "2023-03-06", "openapi.json"), %r{app/paths.json}, "#{plug_name}/paths.json")
180
+ File.rename(File.join(destination_root, "lib", "schemas", "api", "2023-03-06", "paths", "app.json"), File.join(destination_root, "lib", "schemas", "api", "2023-03-06", "paths", "#{plug_name}.json"))
181
+
176
182
  say(set_color("Creating first commit...", :cyan))
177
183
  capture_stdout do
178
184
  invoke(:commit)
@@ -8,7 +8,6 @@ module Hephaestus
8
8
  module Generators
9
9
  class Base < Rails::Generators::Base
10
10
  include Hephaestus::Actions
11
- include ExitOnFailure
12
11
 
13
12
  class << self
14
13
  def default_source_root
@@ -10,8 +10,8 @@ module Hephaestus
10
10
  end
11
11
 
12
12
  def dotenv
13
- copy_file(".env.sample", ".env")
14
- copy_file(".env.sample", ".env.sample")
13
+ copy_file("hephaestus_env.sample", ".env")
14
+ copy_file("hephaestus_env.sample", ".env.sample")
15
15
  end
16
16
 
17
17
  def docker
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Hephaestus
5
- VERSION = "0.8.12"
5
+ VERSION = "0.8.12.1"
6
6
  RAILS_VERSION = ">= 8.0"
7
7
  RUBY_VERSION = File
8
8
  .read("#{File.dirname(__FILE__)}/../../.ruby-version")
data/lib/hephaestus.rb CHANGED
@@ -11,7 +11,6 @@ require "debug" if debugging?
11
11
 
12
12
  require "hephaestus/version"
13
13
  require "hephaestus/engine"
14
- require "hephaestus/exit_on_failure"
15
14
 
16
15
  require "hephaestus/generators/app_generator"
17
16
  require "hephaestus/generators/config_generator"
@@ -0,0 +1,12 @@
1
+ # RAILS_MASTER_KEY="GENERATE_A_NEW_KEY"
2
+ YETTO_PLUG_PEM="REPLACE_ME_WITH_YETTO_VALUE"
3
+ YETTO_SIGNING_SECRET="super-secret"
4
+ YETTO_PLUG_ID="REPLACE_ME_WITH_YETTO_VALUE"
5
+
6
+ # don't forget to add these into your credentials file: `bin/rails credentials:edit --environment development`
7
+ # APP_ID: find this in 1pass
8
+ # APP_CLIENT_ID: find this in 1pass
9
+ # APP_CLIENT_SECRET: find this in 1pass
10
+ # APP_NONCE: generate this randomly
11
+ # JWT_PEM: find this in 1pass
12
+
@@ -0,0 +1,27 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: weekly
7
+ day: monday
8
+ time: "09:00"
9
+ timezone: "Etc/UTC"
10
+ groups:
11
+ github-actions:
12
+ patterns:
13
+ - "*"
14
+ open-pull-requests-limit: 10
15
+
16
+ - package-ecosystem: bundler
17
+ directory: "/"
18
+ schedule:
19
+ interval: monthly
20
+ day: monday
21
+ time: "09:00"
22
+ timezone: "Etc/UTC"
23
+ open-pull-requests-limit: 10
24
+ groups:
25
+ bundler-dependencies:
26
+ patterns:
27
+ - "*"
@@ -0,0 +1,14 @@
1
+ name: PR auto-{approve,merge}
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request_target:
6
+
7
+ permissions:
8
+ pull-requests: write
9
+ contents: write
10
+
11
+ jobs:
12
+ bot-check:
13
+ uses: yettoapp/actions/.github/workflows/automerge.yml@main
14
+ secrets: inherit
@@ -0,0 +1,30 @@
1
+ name: Deployments
2
+ on:
3
+ push:
4
+ branches:
5
+ - production
6
+ workflow_dispatch:
7
+ inputs:
8
+ target:
9
+ required: true
10
+ type: choice
11
+ description: The name of the environment that you're deploying the application to
12
+ options:
13
+ - staging
14
+ - production
15
+ forced:
16
+ description: "Whether to perform the deploy regardless of test state."
17
+ required: false
18
+ type: boolean
19
+ default: false
20
+
21
+ jobs:
22
+ deployment:
23
+ name: Deploy app
24
+ uses: yettoapp/actions/.github/workflows/fly_deployment.yml@main
25
+ with:
26
+ target: ${{ github.event_name != 'workflow_dispatch' && 'production' || inputs.target }}
27
+ forced: ${{ github.event_name == 'workflow_dispatch' && inputs.forced || false }}
28
+ secrets:
29
+ gh_token: ${{ secrets.GH_DEPLOYMENTS_TOKEN }}
30
+ fly_token: ${{ inputs.target == 'staging' && secrets.FLY_STAGING_API_TOKEN || secrets.FLY_PRODUCTION_API_TOKEN }}
@@ -0,0 +1,17 @@
1
+ name: License
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request_target:
6
+
7
+ permissions:
8
+ pull-requests: write
9
+ contents: write
10
+
11
+ jobs:
12
+ verify:
13
+ uses: yettoapp/actions/.github/workflows/run_license_verify.yml@main
14
+ secrets:
15
+ gh_token: ${{ secrets.GH_SISYPHUS_YETTO_REPO_TOKEN }}
16
+ with:
17
+ ruby: true
@@ -0,0 +1,17 @@
1
+ name: Linting
2
+
3
+ on:
4
+ pull_request:
5
+ paths:
6
+ - "**/*.rb"
7
+
8
+ env:
9
+ RAILS_ENV: test
10
+
11
+ jobs:
12
+ verify:
13
+ uses: yettoapp/actions/.github/workflows/lint.yml@main
14
+ secrets:
15
+ gh_token: ${{ secrets.GH_SISYPHUS_YETTO_REPO_TOKEN }}
16
+ with:
17
+ ruby: true
@@ -0,0 +1,19 @@
1
+ name: Security
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request_target:
6
+
7
+ env:
8
+ RAILS_ENV: test
9
+ BUNDLE_WITH: "ci"
10
+
11
+ permissions:
12
+ pull-requests: write
13
+ contents: write
14
+
15
+ jobs:
16
+ ruby:
17
+ uses: yettoapp/actions/.github/workflows/ruby_security_checks.yml@main
18
+ secrets:
19
+ gh_token: ${{ secrets.GH_SISYPHUS_YETTO_REPO_TOKEN }}
@@ -0,0 +1,19 @@
1
+ name: Sorbet
2
+
3
+ on:
4
+ pull_request_target:
5
+ paths:
6
+ - "**/*.rb"
7
+ - "Gemfile.lock"
8
+
9
+ jobs:
10
+ update:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ ref: ${{ github.head_ref }}
17
+ token: ${{ secrets.GH_SISYPHUS_YETTO_REPO_TOKEN }}
18
+
19
+ - uses: yettoapp/actions/run-sorbet-update@main
@@ -0,0 +1,21 @@
1
+ name: Test
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request_target:
6
+
7
+ jobs:
8
+ ruby:
9
+ uses: yettoapp/actions/.github/workflows/rails_sqlite_test_suite.yml@main
10
+ secrets:
11
+ gh_token: ${{ secrets.GH_SISYPHUS_YETTO_REPO_TOKEN }}
12
+ with:
13
+ system_tests: false
14
+
15
+ docker:
16
+ uses: yettoapp/actions/.github/workflows/test_dockerbuild.yml@main
17
+ secrets:
18
+ gh_token: ${{ secrets.GH_SISYPHUS_YETTO_REPO_TOKEN }}
19
+ fly_token: ${{ secrets.FLY_PRODUCTION_API_TOKEN }}
20
+ with:
21
+ app_name: "plug-<%= plug_name %>-production"
@@ -0,0 +1,18 @@
1
+ name: Updates
2
+ on:
3
+ workflow_dispatch:
4
+ inputs:
5
+ action:
6
+ required: true
7
+ type: string
8
+ value:
9
+ required: false
10
+ type: string
11
+
12
+ jobs:
13
+ update:
14
+ name: Update app
15
+ uses: yettoapp/actions/.github/workflows/updater.yml@main
16
+ with:
17
+ action: ${{ inputs.action }}
18
+ value: ${{ inputs.value }}
@@ -0,0 +1,9 @@
1
+ {
2
+ "recommendations": [
3
+ "shopify.ruby-extensions-pack",
4
+ "bradlc.vscode-tailwindcss",
5
+ "johnpapa.vscode-peacock",
6
+ "manuelpuyol.erb-linter",
7
+ "esbenp.prettier-vscode"
8
+ ]
9
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "type": "rdbg",
9
+ "name": "Attach rdbg",
10
+ "request": "attach"
11
+ },
12
+ ]
13
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "[javascript]" : {
3
+ "editor.codeActionsOnSave" : {
4
+ "source.fixAll.eslint" : "explicit"
5
+ }
6
+ },
7
+ "[json]" : {
8
+ "editor.defaultFormatter" : "vscode.json-language-features"
9
+ },
10
+ "[markdown]" : {
11
+ "editor.defaultFormatter" : "esbenp.prettier-vscode"
12
+ },
13
+ "[ruby]" : {
14
+ "editor.defaultFormatter" : "Shopify.ruby-lsp"
15
+ },
16
+ "files.associations" : {
17
+ "*.css" : "tailwindcss",
18
+ "*.rbedited" : "ruby",
19
+ "*.rbi" : "ruby",
20
+ "*.rbupdated" : "ruby"
21
+ },
22
+ "peacock.color" : "#26FF9A",
23
+ "rubyLsp.enabledFeatures" : {
24
+ "codeActions" : true,
25
+ "diagnostics" : true,
26
+ "documentHighlights" : true,
27
+ "documentLink" : true,
28
+ "documentSymbols" : true,
29
+ "foldingRanges" : true,
30
+ "formatting" : true,
31
+ "onTypeFormatting" : true,
32
+ "selectionRanges" : true,
33
+ "semanticHighlighting" : true
34
+ },
35
+ "tailwindCSS.emmetCompletions" : true,
36
+ "tailwindCSS.includeLanguages" : {
37
+ "plaintext" : "html"
38
+ },
39
+ "workbench.colorCustomizations" : {
40
+ "activityBar.activeBackground" : "#59ffb2",
41
+ "activityBar.background" : "#59ffb2",
42
+ "activityBar.foreground" : "#15202b",
43
+ "activityBar.inactiveForeground" : "#15202b99",
44
+ "activityBarBadge.background" : "#c480ff",
45
+ "activityBarBadge.foreground" : "#15202b",
46
+ "commandCenter.border" : "#15202b99",
47
+ "sash.hoverBorder" : "#59ffb2",
48
+ "statusBar.background" : "#26ff9a",
49
+ "statusBar.foreground" : "#15202b",
50
+ "statusBarItem.hoverBackground" : "#00f281",
51
+ "statusBarItem.remoteBackground" : "#26ff9a",
52
+ "statusBarItem.remoteForeground" : "#15202b",
53
+ "titleBar.activeBackground" : "#26ff9a",
54
+ "titleBar.activeForeground" : "#15202b",
55
+ "titleBar.inactiveBackground" : "#26ff9a99",
56
+ "titleBar.inactiveForeground" : "#15202b99"
57
+ }
58
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hephaestus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.12
4
+ version: 0.8.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
@@ -430,7 +430,6 @@ files:
430
430
  - lib/hephaestus/app_builder.rb
431
431
  - lib/hephaestus/app_name.rb
432
432
  - lib/hephaestus/engine.rb
433
- - lib/hephaestus/exit_on_failure.rb
434
433
  - lib/hephaestus/generators/app_generator.rb
435
434
  - lib/hephaestus/generators/base.rb
436
435
  - lib/hephaestus/generators/config_generator.rb
@@ -492,7 +491,20 @@ files:
492
491
  - templates/config/routes.rb.tt
493
492
  - templates/db/queue_schema.rb
494
493
  - templates/db/schema.rb
494
+ - templates/hephaestus_env.sample
495
+ - templates/hephaestus_github/dependabot.yml
496
+ - templates/hephaestus_github/workflows/automerge.yml
497
+ - templates/hephaestus_github/workflows/deploy.yml
498
+ - templates/hephaestus_github/workflows/licenses.yml
499
+ - templates/hephaestus_github/workflows/lint.yml
500
+ - templates/hephaestus_github/workflows/security.yml
501
+ - templates/hephaestus_github/workflows/sorbet.yml
502
+ - templates/hephaestus_github/workflows/test.yml.tt
503
+ - templates/hephaestus_github/workflows/updater.yml
495
504
  - templates/hephaestus_gitignore
505
+ - templates/hephaestus_vscode/extensions.json
506
+ - templates/hephaestus_vscode/launch.json
507
+ - templates/hephaestus_vscode/settings.json
496
508
  - templates/lib/plug_app/schemas/api/2023-03-06/components/parameters/headers/yetto.json
497
509
  - templates/lib/plug_app/schemas/api/2023-03-06/components/parameters/plugInstallation.json
498
510
  - templates/lib/plug_app/schemas/api/2023-03-06/components/schemas/plug.json
@@ -1,22 +0,0 @@
1
- # typed: false
2
- # frozen_string_literal: true
3
-
4
- require "active_support/concern"
5
- require "English"
6
-
7
- module Hephaestus
8
- module ExitOnFailure
9
- extend ActiveSupport::Concern
10
-
11
- def bundle_command(*)
12
- super
13
- exit(false) if $CHILD_STATUS.exitstatus.nonzero? # rubocop:disable Rails/Exit
14
- end
15
-
16
- module ClassMethods
17
- def exit_on_failure?
18
- true
19
- end
20
- end
21
- end
22
- end