ts_schema 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +0 -1
- data/lib/generators/install_generator.rb +1 -4
- data/lib/tasks/ts_schema_tasks.rake +2 -0
- data/lib/ts_schema/version.rb +1 -1
- data/lib/ts_schema.rb +3 -1
- metadata +1 -63
- data/.gitignore +0 -9
- data/Gemfile +0 -10
- data/Gemfile.lock +0 -160
- data/bin/test +0 -5
- data/test/dummy/Rakefile +0 -6
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/schema.d.ts +0 -71
- data/test/dummy/app/assets/stylesheets/application.css +0 -1
- data/test/dummy/app/controllers/application_controller.rb +0 -2
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/frontend/types/schema.d.ts +0 -71
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/jobs/application_job.rb +0 -7
- data/test/dummy/app/models/application_record.rb +0 -3
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/models/example.rb +0 -15
- data/test/dummy/app/models/five.rb +0 -3
- data/test/dummy/app/models/four.rb +0 -4
- data/test/dummy/app/models/one.rb +0 -4
- data/test/dummy/app/models/three.rb +0 -4
- data/test/dummy/app/models/two.rb +0 -3
- data/test/dummy/app/views/layouts/application.html.erb +0 -15
- data/test/dummy/bin/rails +0 -4
- data/test/dummy/bin/rake +0 -4
- data/test/dummy/bin/setup +0 -33
- data/test/dummy/config/application.rb +0 -41
- data/test/dummy/config/boot.rb +0 -5
- data/test/dummy/config/database.yml +0 -86
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -63
- data/test/dummy/config/environments/production.rb +0 -76
- data/test/dummy/config/environments/test.rb +0 -53
- data/test/dummy/config/initializers/config/initializers/ts_schema.rb +0 -30
- data/test/dummy/config/initializers/content_security_policy.rb +0 -26
- data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -8
- data/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/dummy/config/initializers/permissions_policy.rb +0 -11
- data/test/dummy/config/locales/en.yml +0 -33
- data/test/dummy/config/puma.rb +0 -43
- data/test/dummy/config/routes.rb +0 -6
- data/test/dummy/config/storage.yml +0 -34
- data/test/dummy/config.ru +0 -6
- data/test/dummy/db/migrate/20220401195333_create_examples.rb +0 -23
- data/test/dummy/db/migrate/20220402131712_create_ones.rb +0 -9
- data/test/dummy/db/migrate/20220402131955_create_twos.rb +0 -9
- data/test/dummy/db/migrate/20220402132415_create_threes.rb +0 -7
- data/test/dummy/db/migrate/20220402132543_create_fours.rb +0 -10
- data/test/dummy/db/migrate/20220402132906_create_fives.rb +0 -12
- data/test/dummy/db/schema.rb +0 -81
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/public/404.html +0 -67
- data/test/dummy/public/422.html +0 -67
- data/test/dummy/public/500.html +0 -66
- data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/test/dummy/public/apple-touch-icon.png +0 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/install_generator_test.rb +0 -13
- data/test/test_helper.rb +0 -18
- data/test/tmp/config/initializers/ts_schema.rb +0 -30
- data/test/ts_schema_test.rb +0 -26
- data/ts_schema.gemspec +0 -20
data/test/dummy/lib/assets/.keep
DELETED
File without changes
|
data/test/dummy/log/.keep
DELETED
File without changes
|
data/test/dummy/public/404.html
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<style>
|
7
|
-
.rails-default-error-page {
|
8
|
-
background-color: #EFEFEF;
|
9
|
-
color: #2E2F30;
|
10
|
-
text-align: center;
|
11
|
-
font-family: arial, sans-serif;
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
|
-
|
15
|
-
.rails-default-error-page div.dialog {
|
16
|
-
width: 95%;
|
17
|
-
max-width: 33em;
|
18
|
-
margin: 4em auto 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
.rails-default-error-page div.dialog > div {
|
22
|
-
border: 1px solid #CCC;
|
23
|
-
border-right-color: #999;
|
24
|
-
border-left-color: #999;
|
25
|
-
border-bottom-color: #BBB;
|
26
|
-
border-top: #B00100 solid 4px;
|
27
|
-
border-top-left-radius: 9px;
|
28
|
-
border-top-right-radius: 9px;
|
29
|
-
background-color: white;
|
30
|
-
padding: 7px 12% 0;
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
-
}
|
33
|
-
|
34
|
-
.rails-default-error-page h1 {
|
35
|
-
font-size: 100%;
|
36
|
-
color: #730E15;
|
37
|
-
line-height: 1.5em;
|
38
|
-
}
|
39
|
-
|
40
|
-
.rails-default-error-page div.dialog > p {
|
41
|
-
margin: 0 0 1em;
|
42
|
-
padding: 1em;
|
43
|
-
background-color: #F7F7F7;
|
44
|
-
border: 1px solid #CCC;
|
45
|
-
border-right-color: #999;
|
46
|
-
border-left-color: #999;
|
47
|
-
border-bottom-color: #999;
|
48
|
-
border-bottom-left-radius: 4px;
|
49
|
-
border-bottom-right-radius: 4px;
|
50
|
-
border-top-color: #DADADA;
|
51
|
-
color: #666;
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
-
}
|
54
|
-
</style>
|
55
|
-
</head>
|
56
|
-
|
57
|
-
<body class="rails-default-error-page">
|
58
|
-
<!-- This file lives in public/404.html -->
|
59
|
-
<div class="dialog">
|
60
|
-
<div>
|
61
|
-
<h1>The page you were looking for doesn't exist.</h1>
|
62
|
-
<p>You may have mistyped the address or the page may have moved.</p>
|
63
|
-
</div>
|
64
|
-
<p>If you are the application owner check the logs for more information.</p>
|
65
|
-
</div>
|
66
|
-
</body>
|
67
|
-
</html>
|
data/test/dummy/public/422.html
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>The change you wanted was rejected (422)</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<style>
|
7
|
-
.rails-default-error-page {
|
8
|
-
background-color: #EFEFEF;
|
9
|
-
color: #2E2F30;
|
10
|
-
text-align: center;
|
11
|
-
font-family: arial, sans-serif;
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
|
-
|
15
|
-
.rails-default-error-page div.dialog {
|
16
|
-
width: 95%;
|
17
|
-
max-width: 33em;
|
18
|
-
margin: 4em auto 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
.rails-default-error-page div.dialog > div {
|
22
|
-
border: 1px solid #CCC;
|
23
|
-
border-right-color: #999;
|
24
|
-
border-left-color: #999;
|
25
|
-
border-bottom-color: #BBB;
|
26
|
-
border-top: #B00100 solid 4px;
|
27
|
-
border-top-left-radius: 9px;
|
28
|
-
border-top-right-radius: 9px;
|
29
|
-
background-color: white;
|
30
|
-
padding: 7px 12% 0;
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
-
}
|
33
|
-
|
34
|
-
.rails-default-error-page h1 {
|
35
|
-
font-size: 100%;
|
36
|
-
color: #730E15;
|
37
|
-
line-height: 1.5em;
|
38
|
-
}
|
39
|
-
|
40
|
-
.rails-default-error-page div.dialog > p {
|
41
|
-
margin: 0 0 1em;
|
42
|
-
padding: 1em;
|
43
|
-
background-color: #F7F7F7;
|
44
|
-
border: 1px solid #CCC;
|
45
|
-
border-right-color: #999;
|
46
|
-
border-left-color: #999;
|
47
|
-
border-bottom-color: #999;
|
48
|
-
border-bottom-left-radius: 4px;
|
49
|
-
border-bottom-right-radius: 4px;
|
50
|
-
border-top-color: #DADADA;
|
51
|
-
color: #666;
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
-
}
|
54
|
-
</style>
|
55
|
-
</head>
|
56
|
-
|
57
|
-
<body class="rails-default-error-page">
|
58
|
-
<!-- This file lives in public/422.html -->
|
59
|
-
<div class="dialog">
|
60
|
-
<div>
|
61
|
-
<h1>The change you wanted was rejected.</h1>
|
62
|
-
<p>Maybe you tried to change something you didn't have access to.</p>
|
63
|
-
</div>
|
64
|
-
<p>If you are the application owner check the logs for more information.</p>
|
65
|
-
</div>
|
66
|
-
</body>
|
67
|
-
</html>
|
data/test/dummy/public/500.html
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>We're sorry, but something went wrong (500)</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<style>
|
7
|
-
.rails-default-error-page {
|
8
|
-
background-color: #EFEFEF;
|
9
|
-
color: #2E2F30;
|
10
|
-
text-align: center;
|
11
|
-
font-family: arial, sans-serif;
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
|
-
|
15
|
-
.rails-default-error-page div.dialog {
|
16
|
-
width: 95%;
|
17
|
-
max-width: 33em;
|
18
|
-
margin: 4em auto 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
.rails-default-error-page div.dialog > div {
|
22
|
-
border: 1px solid #CCC;
|
23
|
-
border-right-color: #999;
|
24
|
-
border-left-color: #999;
|
25
|
-
border-bottom-color: #BBB;
|
26
|
-
border-top: #B00100 solid 4px;
|
27
|
-
border-top-left-radius: 9px;
|
28
|
-
border-top-right-radius: 9px;
|
29
|
-
background-color: white;
|
30
|
-
padding: 7px 12% 0;
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
-
}
|
33
|
-
|
34
|
-
.rails-default-error-page h1 {
|
35
|
-
font-size: 100%;
|
36
|
-
color: #730E15;
|
37
|
-
line-height: 1.5em;
|
38
|
-
}
|
39
|
-
|
40
|
-
.rails-default-error-page div.dialog > p {
|
41
|
-
margin: 0 0 1em;
|
42
|
-
padding: 1em;
|
43
|
-
background-color: #F7F7F7;
|
44
|
-
border: 1px solid #CCC;
|
45
|
-
border-right-color: #999;
|
46
|
-
border-left-color: #999;
|
47
|
-
border-bottom-color: #999;
|
48
|
-
border-bottom-left-radius: 4px;
|
49
|
-
border-bottom-right-radius: 4px;
|
50
|
-
border-top-color: #DADADA;
|
51
|
-
color: #666;
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
-
}
|
54
|
-
</style>
|
55
|
-
</head>
|
56
|
-
|
57
|
-
<body class="rails-default-error-page">
|
58
|
-
<!-- This file lives in public/500.html -->
|
59
|
-
<div class="dialog">
|
60
|
-
<div>
|
61
|
-
<h1>We're sorry, but something went wrong.</h1>
|
62
|
-
</div>
|
63
|
-
<p>If you are the application owner check the logs for more information.</p>
|
64
|
-
</div>
|
65
|
-
</body>
|
66
|
-
</html>
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require "test_helper"
|
2
|
-
|
3
|
-
class InstallGeneratorTest < Rails::Generators::TestCase
|
4
|
-
tests TsSchema::Generators::InstallGenerator
|
5
|
-
destination File.expand_path("../tmp", __FILE__)
|
6
|
-
setup :prepare_destination
|
7
|
-
|
8
|
-
test "it creats a file" do
|
9
|
-
run_generator
|
10
|
-
|
11
|
-
assert_file "config/initializers/ts_schema.rb"
|
12
|
-
end
|
13
|
-
end
|
data/test/test_helper.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# Configure Rails Environment
|
2
|
-
ENV["RAILS_ENV"] = "test"
|
3
|
-
|
4
|
-
require_relative "../test/dummy/config/environment"
|
5
|
-
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../test/dummy/db/migrate", __dir__)]
|
6
|
-
require "rails/test_help"
|
7
|
-
|
8
|
-
# Load fixtures from the engine
|
9
|
-
if ActiveSupport::TestCase.respond_to?(:fixture_path=)
|
10
|
-
ActiveSupport::TestCase.fixture_path = File.expand_path("fixtures", __dir__)
|
11
|
-
ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
|
12
|
-
ActiveSupport::TestCase.file_fixture_path = ActiveSupport::TestCase.fixture_path + "/files"
|
13
|
-
ActiveSupport::TestCase.fixtures :all
|
14
|
-
end
|
15
|
-
|
16
|
-
# For generators
|
17
|
-
require "rails/generators/test_case"
|
18
|
-
require "generators/install_generator"
|
@@ -1,30 +0,0 @@
|
|
1
|
-
TsSchema.setup do |config|
|
2
|
-
# Options: camel|snake|pascal
|
3
|
-
# config.case = :camel
|
4
|
-
|
5
|
-
# Customize output path and file name
|
6
|
-
# config.output = Rails.root.join('app', 'assets', 'javascripts', 'schema.d.ts')
|
7
|
-
|
8
|
-
# Whether to generate the schema file on migrations and rollbacks
|
9
|
-
# config.auto_generate = true
|
10
|
-
|
11
|
-
# Add custom type mappings or overrides
|
12
|
-
# config.custom_types = {
|
13
|
-
#
|
14
|
-
# }
|
15
|
-
|
16
|
-
# Default type for unrecognized types
|
17
|
-
# config.default_type = :string
|
18
|
-
|
19
|
-
# Whether to generate types for associations
|
20
|
-
# config.include_associated = true
|
21
|
-
|
22
|
-
# Namespace
|
23
|
-
# config.namespace = :schema
|
24
|
-
|
25
|
-
# Options: tab|space
|
26
|
-
# config.indent = :tab
|
27
|
-
|
28
|
-
# If indent is spaces, specify how many
|
29
|
-
# config.spaces = 2
|
30
|
-
end
|
data/test/ts_schema_test.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require "test_helper"
|
2
|
-
|
3
|
-
class TsSchemaTest < ActiveSupport::TestCase
|
4
|
-
test "it loads custom config values from initializer" do
|
5
|
-
assert TsSchema.configuration.case
|
6
|
-
assert TsSchema.configuration.output
|
7
|
-
assert TsSchema.configuration.auto_generate
|
8
|
-
assert TsSchema.configuration.types
|
9
|
-
assert TsSchema.configuration.custom_types
|
10
|
-
assert TsSchema.configuration.default_type
|
11
|
-
assert TsSchema.configuration.include_associated
|
12
|
-
assert TsSchema.configuration.namespace
|
13
|
-
end
|
14
|
-
|
15
|
-
test "it generates a schema file" do
|
16
|
-
path = TsSchema.configuration.output
|
17
|
-
File.delete(path) if File.exist?(path)
|
18
|
-
|
19
|
-
TsSchema.generate
|
20
|
-
assert File.exist?(path)
|
21
|
-
end
|
22
|
-
|
23
|
-
test "it has a version number" do
|
24
|
-
assert TsSchema::VERSION
|
25
|
-
end
|
26
|
-
end
|
data/ts_schema.gemspec
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
require_relative "lib/ts_schema/version"
|
2
|
-
|
3
|
-
Gem::Specification.new do |spec|
|
4
|
-
spec.name = "ts_schema"
|
5
|
-
spec.version = TsSchema::VERSION
|
6
|
-
spec.authors = ["Avram Walden"]
|
7
|
-
spec.email = ["aviemet@gmail.com"]
|
8
|
-
spec.homepage = "https://github.com/aviemet"
|
9
|
-
spec.summary = "Generates typescript definitions from ActiveRecord"
|
10
|
-
spec.description = ""
|
11
|
-
spec.license = "MIT"
|
12
|
-
|
13
|
-
spec.metadata["homepage_uri"] = spec.homepage
|
14
|
-
spec.metadata["source_code_uri"] = "https://github.com/aviemet/ts_schema"
|
15
|
-
|
16
|
-
spec.files = `git ls-files`.split("\n")
|
17
|
-
spec.require_paths = ["lib"]
|
18
|
-
|
19
|
-
spec.add_dependency 'rails', '~> 7.0', '>= 7.0.2.3'
|
20
|
-
end
|