platformos-check 0.4.13 → 0.4.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/data/platformos_liquid/documentation/latest.json +1 -1
- data/lib/platformos_check/app.rb +23 -14
- data/lib/platformos_check/app_file.rb +25 -4
- data/lib/platformos_check/asset_file.rb +1 -1
- data/lib/platformos_check/file_system_storage.rb +1 -1
- data/lib/platformos_check/form_file.rb +1 -1
- data/lib/platformos_check/graphql_file.rb +1 -1
- data/lib/platformos_check/language_server/completion_context.rb +2 -0
- data/lib/platformos_check/layout_file.rb +1 -1
- data/lib/platformos_check/partial_file.rb +1 -1
- data/lib/platformos_check/translation_file.rb +1 -1
- data/lib/platformos_check/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e71a05c1655cf1a33b9290f29812cfefffaf5c221a953536f28cd46588f604d
|
4
|
+
data.tar.gz: ecc1f13f479711da984373e405f59b5ae55c6c558eef8dc172c1d1d9670ea4e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 496da6087ec91931dec08e7a3939a0b02e0eb43051dd59f7e363a11989be1d59d097380d50628168b088728a86edd978a738e42f0d27207842312767da7f8d87
|
7
|
+
data.tar.gz: 5786d06421eefbc59bcd2c7a5eba753db923875f89c170e6918b3a46f2db94bc22a99bb723125ffe382633b93b7e60b6046af9e7f2ba62c69f6f6d6271164839
|
data/CHANGELOG.md
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
|
2
|
-
{"revision":"
|
2
|
+
{"revision":"57d415b98a26ca47bb6449b1433e8f009a3ca3b9"}
|
data/lib/platformos_check/app.rb
CHANGED
@@ -6,20 +6,20 @@ require "pathname"
|
|
6
6
|
|
7
7
|
module PlatformosCheck
|
8
8
|
class App
|
9
|
-
API_CALLS_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|modules/(.+)(private|public|marketplace_builder|app)/)?)(notifications/api_call_notifications|api_calls)/(.+)\.liquid\z}
|
10
|
-
ASSETS_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|modules/(.+)(private|public|marketplace_builder|app)/)?)assets/}
|
11
|
-
EMAILS_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|modules/(.+)(private|public|marketplace_builder|app)/)?)(notifications/email_notifications|emails)/(.+)\.liquid\z}
|
12
|
-
GRAPHQL_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|modules/(.+)(private|public|marketplace_builder|app)/)?)(graph_queries|graphql)s?/(.+)\.graphql\z}
|
13
|
-
|
14
|
-
MIGRATIONS_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|modules/(.+)(private|public|marketplace_builder|app)/)?)migrations/(.+)\.liquid\z}
|
15
|
-
PAGES_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|modules/(.+)(private|public|marketplace_builder|app)/)?)(pages|views/pages)/(.+).liquid\z}
|
16
|
-
PARTIALS_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|modules/(.+)(private|public|marketplace_builder|app)/)?)(views/partials|lib)/(.+)\.liquid\z}
|
17
|
-
FORMS_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|modules/(.+)(private|public|marketplace_builder|app)/)?)(form_configurations|forms)/(.+)\.liquid\z}
|
18
|
-
LAYOUTS_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|modules/(.+)(private|public|marketplace_builder|app)/)?)(views/layouts)/(.+).liquid\z}
|
19
|
-
SCHEMA_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|modules/(.+)(private|public|marketplace_builder|app)/)?)(custom_model_types|model_schemas|schema)/(.+)\.yml\z}
|
20
|
-
SMSES_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|modules/(.+)(private|public|marketplace_builder|app)/)?)(notifications/sms_notifications|smses)/(.+)\.liquid\z}
|
9
|
+
API_CALLS_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|(app/)?modules/(.+)(private|public|marketplace_builder|app)/)?)(notifications/api_call_notifications|api_calls)/(.+)\.liquid\z}
|
10
|
+
ASSETS_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|(app/)?modules/(.+)(private|public|marketplace_builder|app)/)?)assets/}
|
11
|
+
EMAILS_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|(app/)?modules/(.+)(private|public|marketplace_builder|app)/)?)(notifications/email_notifications|emails)/(.+)\.liquid\z}
|
12
|
+
GRAPHQL_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|(app/)?modules/(.+)(private|public|marketplace_builder|app)/)?)(graph_queries|graphql)s?/(.+)\.graphql\z}
|
13
|
+
|
14
|
+
MIGRATIONS_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|(app/)?modules/(.+)(private|public|marketplace_builder|app)/)?)migrations/(.+)\.liquid\z}
|
15
|
+
PAGES_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|(app/)?modules/(.+)(private|public|marketplace_builder|app)/)?)(pages|views/pages)/(.+).liquid\z}
|
16
|
+
PARTIALS_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|(app/)?modules/(.+)(private|public|marketplace_builder|app)/)?)(views/partials|lib)/(.+)\.liquid\z}
|
17
|
+
FORMS_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|(app/)?modules/(.+)(private|public|marketplace_builder|app)/)?)(form_configurations|forms)/(.+)\.liquid\z}
|
18
|
+
LAYOUTS_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|(app/)?modules/(.+)(private|public|marketplace_builder|app)/)?)(views/layouts)/(.+).liquid\z}
|
19
|
+
SCHEMA_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|(app/)?modules/(.+)(private|public|marketplace_builder|app)/)?)(custom_model_types|model_schemas|schema)/(.+)\.yml\z}
|
20
|
+
SMSES_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|(app/)?modules/(.+)(private|public|marketplace_builder|app)/)?)(notifications/sms_notifications|smses)/(.+)\.liquid\z}
|
21
21
|
USER_SCHEMA_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/)?)user.yml}
|
22
|
-
TRANSLATIONS_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|modules/(.+)(private|public|marketplace_builder|app)/)?)translations/(.+)\.yml}
|
22
|
+
TRANSLATIONS_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/|(app/)?modules/(.+)(private|public|marketplace_builder|app)/)?)translations/(.+)\.yml}
|
23
23
|
CONFIG_REGEX = %r{\A(?-mix:^/?((marketplace_builder|app)/)?)config.yml}
|
24
24
|
|
25
25
|
REGEXP_MAP = {
|
@@ -60,10 +60,19 @@ module PlatformosCheck
|
|
60
60
|
next unless regexp
|
61
61
|
|
62
62
|
f = klass.new(path, storage)
|
63
|
+
|
63
64
|
if remove
|
64
65
|
@grouped_files[klass].delete(f.name)
|
66
|
+
if f.module_overwrite_file? && storage.files.include?(f.module_original_file_path)
|
67
|
+
original_file = klass.new(f.module_original_file_path, storage)
|
68
|
+
@grouped_files[klass][original_file.name] = original_file
|
69
|
+
elsif f.module_original_file? && storage.files.include?(f.module_overwrite_file_path)
|
70
|
+
overwrite_file = klass.new(f.module_overwrite_file_path, storage)
|
71
|
+
@grouped_files[klass][overwrite_file.name] = overwrite_file
|
72
|
+
end
|
65
73
|
else
|
66
|
-
|
74
|
+
# we want to keep the reference to a module overwrite, if exists
|
75
|
+
@grouped_files[klass][f.name] = f unless f.module_original_file? && @grouped_files[klass][f.name] && @grouped_files[klass][f.name].module_overwrite_file?
|
67
76
|
end
|
68
77
|
end
|
69
78
|
@grouped_files
|
@@ -48,10 +48,31 @@ module PlatformosCheck
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def module_name
|
51
|
-
@module_name ||=
|
52
|
-
|
53
|
-
|
54
|
-
|
51
|
+
@module_name ||= if module_original_file?
|
52
|
+
dir_names[1]
|
53
|
+
elsif module_overwrite_file?
|
54
|
+
return dir_names[2]
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def module_original_file?
|
59
|
+
dir_names[0] == 'modules'
|
60
|
+
end
|
61
|
+
|
62
|
+
def module_overwrite_file?
|
63
|
+
dir_names[0] == 'app' && dir_names[1] == 'modules'
|
64
|
+
end
|
65
|
+
|
66
|
+
def module_overwrite_file_path
|
67
|
+
@module_overwrite_file_path ||= module_original_file? ? 'app/' + relative_path.to_s : nil
|
68
|
+
end
|
69
|
+
|
70
|
+
def module_original_file_path
|
71
|
+
@module_original_file_path ||= module_overwrite_file? ? dir_names[1..].join(File::SEPARATOR) : nil
|
72
|
+
end
|
73
|
+
|
74
|
+
def dir_names
|
75
|
+
@dir_names ||= @relative_path.split(File::SEPARATOR).reject(&:empty?)
|
55
76
|
end
|
56
77
|
|
57
78
|
# For the corrector to work properly, we should have a
|
@@ -4,7 +4,7 @@ require "zlib"
|
|
4
4
|
|
5
5
|
module PlatformosCheck
|
6
6
|
class AssetFile < AppFile
|
7
|
-
DIR_PREFIX = %r{\A/?((marketplace_builder|app)/assets/|modules/((\w|-)*)/(private|public)/assets/)}
|
7
|
+
DIR_PREFIX = %r{\A/?((marketplace_builder|app)/assets/|(app/)?modules/((\w|-)*)/(private|public)/assets/)}
|
8
8
|
|
9
9
|
def initialize(relative_path, storage)
|
10
10
|
super
|
@@ -31,7 +31,7 @@ module PlatformosCheck
|
|
31
31
|
|
32
32
|
file(relative_path).dirname.mkpath unless file(relative_path).dirname.directory?
|
33
33
|
file(relative_path).write(content, mode: 'w+b', encoding: 'UTF-8')
|
34
|
-
@platformos_app&.update([relative_path])
|
34
|
+
@platformos_app&.update([relative_path], remove: !file_exists?(relative_path))
|
35
35
|
end
|
36
36
|
|
37
37
|
def remove(relative_path)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module PlatformosCheck
|
4
4
|
class FormFile < LiquidFile
|
5
|
-
DIR_PREFIX = %r{\A/?((marketplace_builder|app)/(form_configurations|forms)/|modules/((\w|-)*)/(private|public)/(form_configurations|forms)/)}
|
5
|
+
DIR_PREFIX = %r{\A/?((marketplace_builder|app)/(form_configurations|forms)/|(app/)?modules/((\w|-)*)/(private|public)/(form_configurations|forms)/)}
|
6
6
|
|
7
7
|
def form?
|
8
8
|
true
|
@@ -4,7 +4,7 @@ require 'graphql'
|
|
4
4
|
|
5
5
|
module PlatformosCheck
|
6
6
|
class GraphqlFile < AppFile
|
7
|
-
DIR_PREFIX = %r{\A/?((marketplace_builder|app)/(graph_queries|graphql)s?/|modules/((\w|-)*)/(private|public)/(graph_queries|graphql)s?/)}
|
7
|
+
DIR_PREFIX = %r{\A/?((marketplace_builder|app)/(graph_queries|graphql)s?/|(app/)?modules/((\w|-)*)/(private|public)/(graph_queries|graphql)s?/)}
|
8
8
|
|
9
9
|
def write
|
10
10
|
content = rewriter.to_s
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module PlatformosCheck
|
4
4
|
class LayoutFile < LiquidFile
|
5
|
-
DIR_PREFIX = %r{\A/?((marketplace_builder|app)/(views/layouts)/|modules/((\w|-)*)/(private|public)/(views/layouts)/)}
|
5
|
+
DIR_PREFIX = %r{\A/?((marketplace_builder|app)/(views/layouts)/|(app/)?modules/((\w|-)*)/(private|public)/(views/layouts)/)}
|
6
6
|
|
7
7
|
def layout?
|
8
8
|
true
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module PlatformosCheck
|
4
4
|
class PartialFile < LiquidFile
|
5
|
-
DIR_PREFIX = %r{\A/?((marketplace_builder|app)/(views/partials|liquid_views|views|lib)/|modules/((\w|-)*)/(private|public)/(views/partials|liquid_views|views|lib)/)}
|
5
|
+
DIR_PREFIX = %r{\A/?((marketplace_builder|app)/(views/partials|liquid_views|views|lib)/|(app/)?modules/((\w|-)*)/(private|public)/(views/partials|liquid_views|views|lib)/)}
|
6
6
|
|
7
7
|
def partial?
|
8
8
|
true
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module PlatformosCheck
|
4
4
|
class TranslationFile < YamlFile
|
5
|
-
DIR_PREFIX = %r{\A/?((marketplace_builder|app)/(translations)/|modules/((\w|-)*)/(private|public)/(translations)/)}
|
5
|
+
DIR_PREFIX = %r{\A/?((marketplace_builder|app)/(translations)/|(app/)?modules/((\w|-)*)/(private|public)/(translations)/)}
|
6
6
|
TRANSLATION_FILTERS = Set.new(%w[t t_escape translate translate_escape]).freeze
|
7
7
|
attr_reader :language
|
8
8
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: platformos-check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Bliszczyk
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-10-
|
13
|
+
date: 2024-10-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: graphql
|