neeto-commons-backend 1.0.89
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.eslintignore +14 -0
- data/.eslintrc.js +87 -0
- data/.husky/helpers/verify_neeto_audit.sh +18 -0
- data/.husky/pre-push +5 -0
- data/.neetoci/neetoci.yml +26 -0
- data/.prettierrc.js +15 -0
- data/.rubocop.yml +626 -0
- data/.ruby-version +1 -0
- data/.semaphore/semaphore.yml +32 -0
- data/.semaphore/staging-deploy.yml +23 -0
- data/Gemfile +92 -0
- data/Gemfile.lock +461 -0
- data/README.md +286 -0
- data/Rakefile +18 -0
- data/app/controllers/api/base_controller.rb +6 -0
- data/app/controllers/neeto_commons_backend/api/base_controller.rb +9 -0
- data/app/controllers/neeto_commons_backend/api/direct_uploads_controller.rb +57 -0
- data/app/controllers/neeto_commons_backend/app_versions_controller.rb +20 -0
- data/app/controllers/neeto_commons_backend/failures_controller.rb +29 -0
- data/app/controllers/neeto_commons_backend/health_check_controller.rb +9 -0
- data/app/controllers/neeto_commons_backend/well_knowns_controller.rb +13 -0
- data/app/mailers/neeto_commons_backend/application_mailer.rb +22 -0
- data/app/models/concerns/neeto_commons_backend/sluggable.rb +27 -0
- data/app/models/concerns/neeto_commons_backend/soft_deletable.rb +20 -0
- data/app/services/neeto_commons_backend/sample_data/common/admin_service.rb +26 -0
- data/app/services/neeto_commons_backend/sample_data/common/app_organization_service.rb +11 -0
- data/app/services/neeto_commons_backend/sample_data/common/base.rb +49 -0
- data/app/services/neeto_commons_backend/sample_data/common/database_cleanup_service.rb +13 -0
- data/app/services/neeto_commons_backend/sample_data/common/loader_service.rb +30 -0
- data/app/services/neeto_commons_backend/sample_data/common/neeto_team_members_service.rb +16 -0
- data/app/services/neeto_commons_backend/sample_data/common/organization_base.rb +36 -0
- data/app/services/neeto_commons_backend/sample_data/common/organization_service.rb +11 -0
- data/app/services/neeto_commons_backend/source_map_publish_service.rb +47 -0
- data/app/views/neeto_commons_backend/failures/show.html.erb +1 -0
- data/app/views/shared/_common.html.erb +8 -0
- data/app/views/shared/_neeto_engineering_replay_widget.html.erb +31 -0
- data/app/views/shared/_neeto_widget.html.erb +30 -0
- data/app/workers/neeto_commons_backend/base_workers/auth.rb +9 -0
- data/app/workers/neeto_commons_backend/base_workers/base.rb +52 -0
- data/app/workers/neeto_commons_backend/base_workers/default.rb +8 -0
- data/app/workers/neeto_commons_backend/base_workers/low.rb +9 -0
- data/app/workers/neeto_commons_backend/base_workers/urgent.rb +9 -0
- data/app/workers/neeto_commons_backend/purge_unattached_files_worker.rb +11 -0
- data/babel.config.js +47 -0
- data/bin/console +15 -0
- data/bin/rails +16 -0
- data/bin/setup +8 -0
- data/config/brakeman.ignore +52 -0
- data/config/locales/en.yml +5 -0
- data/docs/carriers/README.md +5 -0
- data/docs/controller_concerns/README.md +34 -0
- data/docs/controllers/README.md +27 -0
- data/docs/gemfiles/README.md +5 -0
- data/docs/helpers/README.md +21 -0
- data/docs/mailers/README.md +5 -0
- data/docs/model_concerns/README.md +39 -0
- data/docs/routes/README.md +44 -0
- data/docs/scripts/README.md +5 -0
- data/docs/semaphore/README.md +5 -0
- data/docs/services/README.md +23 -0
- data/docs/workers/README.md +32 -0
- data/docs/workflows/README.md +9 -0
- data/lib/Rakefile +4 -0
- data/lib/neeto-commons-backend.rb +62 -0
- data/lib/neeto_commons_backend/.circleci/config.yml +84 -0
- data/lib/neeto_commons_backend/.slugignore +17 -0
- data/lib/neeto_commons_backend/carriers/app_url_carrier.rb +71 -0
- data/lib/neeto_commons_backend/common_files/.bundler-version +1 -0
- data/lib/neeto_commons_backend/common_files/.editorconfig +10 -0
- data/lib/neeto_commons_backend/common_files/.erb-lint.yml +20 -0
- data/lib/neeto_commons_backend/common_files/.eslintignore +14 -0
- data/lib/neeto_commons_backend/common_files/.eslintrc.js +2 -0
- data/lib/neeto_commons_backend/common_files/.gitignore +132 -0
- data/lib/neeto_commons_backend/common_files/.husky/helpers/lint_staged.sh +5 -0
- data/lib/neeto_commons_backend/common_files/.husky/helpers/prevent_conflict_markers.sh +35 -0
- data/lib/neeto_commons_backend/common_files/.husky/helpers/prevent_pushing_to_main.sh +24 -0
- data/lib/neeto_commons_backend/common_files/.husky/helpers/verify_neeto_audit.sh +17 -0
- data/lib/neeto_commons_backend/common_files/.husky/pre-commit +9 -0
- data/lib/neeto_commons_backend/common_files/.husky/pre-push +7 -0
- data/lib/neeto_commons_backend/common_files/.node-version +1 -0
- data/lib/neeto_commons_backend/common_files/.nvmrc +1 -0
- data/lib/neeto_commons_backend/common_files/.postcssrc.yml +6 -0
- data/lib/neeto_commons_backend/common_files/.prettierrc.js +1 -0
- data/lib/neeto_commons_backend/common_files/.rubocop.yml +625 -0
- data/lib/neeto_commons_backend/common_files/.ruby-version +1 -0
- data/lib/neeto_commons_backend/common_files/.semaphore/commands/run_eslint_on_modified_files.sh +5 -0
- data/lib/neeto_commons_backend/common_files/.vscode/extensions.json +10 -0
- data/lib/neeto_commons_backend/common_files/.vscode/settings.json +21 -0
- data/lib/neeto_commons_backend/common_files/Dockerfile.dev +50 -0
- data/lib/neeto_commons_backend/common_files/app/javascript/jsconfig.json +62 -0
- data/lib/neeto_commons_backend/common_files/app/javascript/src/types.d.ts +36 -0
- data/lib/neeto_commons_backend/common_files/babel.config.js +1 -0
- data/lib/neeto_commons_backend/common_files/bin/bundle +5 -0
- data/lib/neeto_commons_backend/common_files/bin/rails +6 -0
- data/lib/neeto_commons_backend/common_files/bin/rake +6 -0
- data/lib/neeto_commons_backend/common_files/bin/setup +40 -0
- data/lib/neeto_commons_backend/common_files/bin/update +33 -0
- data/lib/neeto_commons_backend/common_files/bin/webpacker +17 -0
- data/lib/neeto_commons_backend/common_files/bin/webpacker-dev-server +17 -0
- data/lib/neeto_commons_backend/common_files/bin/yarn +19 -0
- data/lib/neeto_commons_backend/common_files/cypress-tests/.eslintrc.js +57 -0
- data/lib/neeto_commons_backend/common_files/cypress-tests/cypress/plugins/index.js +63 -0
- data/lib/neeto_commons_backend/common_files/github/workflows/auto_update_prs_with_latest_master.yml +21 -0
- data/lib/neeto_commons_backend/common_files/neeto_gems/github/workflows/bump_version.yml +51 -0
- data/lib/neeto_commons_backend/common_files/newrelic.yml +31 -0
- data/lib/neeto_commons_backend/common_files/package-common.json +119 -0
- data/lib/neeto_commons_backend/common_files/roles.yml +34 -0
- data/lib/neeto_commons_backend/common_files/semaphore/semaphore.yml +58 -0
- data/lib/neeto_commons_backend/common_files/sitemap.xml +15 -0
- data/lib/neeto_commons_backend/common_files/test/support/assertion_support.rb +9 -0
- data/lib/neeto_commons_backend/common_files/webpacker.yml +90 -0
- data/lib/neeto_commons_backend/config/secrets.yml +169 -0
- data/lib/neeto_commons_backend/controllers/concerns/api_exceptions.rb +83 -0
- data/lib/neeto_commons_backend/controllers/concerns/api_helpers.rb +9 -0
- data/lib/neeto_commons_backend/controllers/concerns/api_responders.rb +33 -0
- data/lib/neeto_commons_backend/controllers/concerns/authenticatable.rb +51 -0
- data/lib/neeto_commons_backend/controllers/concerns/honeybadger_context.rb +17 -0
- data/lib/neeto_commons_backend/controllers/concerns/store_user_location.rb +23 -0
- data/lib/neeto_commons_backend/cypress/cypress.review.json +13 -0
- data/lib/neeto_commons_backend/cypress/jsconfig.json +17 -0
- data/lib/neeto_commons_backend/cypress/package.json +51 -0
- data/lib/neeto_commons_backend/cypress/resolve.js +16 -0
- data/lib/neeto_commons_backend/cypress/webpack.config.js +21 -0
- data/lib/neeto_commons_backend/engine.rb +6 -0
- data/lib/neeto_commons_backend/environments/application.rb +33 -0
- data/lib/neeto_commons_backend/environments/development.rb +46 -0
- data/lib/neeto_commons_backend/environments/heroku.rb +35 -0
- data/lib/neeto_commons_backend/environments/production.rb +45 -0
- data/lib/neeto_commons_backend/environments/staging.rb +43 -0
- data/lib/neeto_commons_backend/environments/test.rb +29 -0
- data/lib/neeto_commons_backend/gemfiles/Gemfile.common.rb +240 -0
- data/lib/neeto_commons_backend/helpers/auth_server_api.rb +92 -0
- data/lib/neeto_commons_backend/helpers/favicon.rb +18 -0
- data/lib/neeto_commons_backend/helpers/global_props.rb +76 -0
- data/lib/neeto_commons_backend/helpers/neeto_widget_helper.rb +19 -0
- data/lib/neeto_commons_backend/helpers/test_helper.rb +90 -0
- data/lib/neeto_commons_backend/initializers/_enable_extension_hack.rb +32 -0
- data/lib/neeto_commons_backend/initializers/assets.rb +11 -0
- data/lib/neeto_commons_backend/initializers/bullet.rb +26 -0
- data/lib/neeto_commons_backend/initializers/cache_store.rb +27 -0
- data/lib/neeto_commons_backend/initializers/common.rb +33 -0
- data/lib/neeto_commons_backend/initializers/cookies_serializer.rb +11 -0
- data/lib/neeto_commons_backend/initializers/cors.rb +16 -0
- data/lib/neeto_commons_backend/initializers/database_cleaner.rb +11 -0
- data/lib/neeto_commons_backend/initializers/datetime.rb +14 -0
- data/lib/neeto_commons_backend/initializers/email_setup.rb +25 -0
- data/lib/neeto_commons_backend/initializers/filter_parameter_logging.rb +11 -0
- data/lib/neeto_commons_backend/initializers/honeybadger.rb +23 -0
- data/lib/neeto_commons_backend/initializers/kaminari_config.rb +13 -0
- data/lib/neeto_commons_backend/initializers/mime_types.rb +12 -0
- data/lib/neeto_commons_backend/initializers/mini_profiler.rb +14 -0
- data/lib/neeto_commons_backend/initializers/neeto_email_prefixer.rb +40 -0
- data/lib/neeto_commons_backend/initializers/neeto_mail_interceptor.rb +35 -0
- data/lib/neeto_commons_backend/initializers/post_compilation.rb +17 -0
- data/lib/neeto_commons_backend/initializers/rack_attack.rb +38 -0
- data/lib/neeto_commons_backend/initializers/rack_deflater.rb +11 -0
- data/lib/neeto_commons_backend/initializers/rack_timeout.rb +15 -0
- data/lib/neeto_commons_backend/initializers/rails_email_preview.rb +21 -0
- data/lib/neeto_commons_backend/initializers/redis_client_patch.rb +18 -0
- data/lib/neeto_commons_backend/initializers/remove_backtrace_silencers.rb +11 -0
- data/lib/neeto_commons_backend/initializers/session_store.rb +21 -0
- data/lib/neeto_commons_backend/initializers/shared_redis.rb +13 -0
- data/lib/neeto_commons_backend/initializers/sidekiq.rb +46 -0
- data/lib/neeto_commons_backend/initializers/strong_migrations.rb +13 -0
- data/lib/neeto_commons_backend/initializers/wrap_parameters.rb +13 -0
- data/lib/neeto_commons_backend/models/concerns/devise_validator.rb +19 -0
- data/lib/neeto_commons_backend/railtie.rb +20 -0
- data/lib/neeto_commons_backend/routes/catch_all.rb +9 -0
- data/lib/neeto_commons_backend/routes/devise.rb +16 -0
- data/lib/neeto_commons_backend/routes/direct_uploads.rb +9 -0
- data/lib/neeto_commons_backend/routes/draw.rb +29 -0
- data/lib/neeto_commons_backend/routes/email_previews.rb +5 -0
- data/lib/neeto_commons_backend/routes/errors.rb +7 -0
- data/lib/neeto_commons_backend/routes/health.rb +8 -0
- data/lib/neeto_commons_backend/routes/letter_opener.rb +5 -0
- data/lib/neeto_commons_backend/routes/sidekiq.rb +22 -0
- data/lib/neeto_commons_backend/routes/well_knowns.rb +10 -0
- data/lib/neeto_commons_backend/scripts/sync_with_wheel.sh +54 -0
- data/lib/neeto_commons_backend/secrets_management.rb +41 -0
- data/lib/neeto_commons_backend/services/custom_domain_service.rb +40 -0
- data/lib/neeto_commons_backend/tasks/assets.rake +27 -0
- data/lib/neeto_commons_backend/tasks/before_assets_precompile.rake +13 -0
- data/lib/neeto_commons_backend/tasks/simplecov_coverage.rake +25 -0
- data/lib/neeto_commons_backend/version.rb +5 -0
- data/neeto-commons-backend.gemspec +52 -0
- data/package.json +31 -0
- data/yarn.lock +2530 -0
- metadata +497 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"target": "ESNext",
|
4
|
+
"allowSyntheticDefaultImports": true,
|
5
|
+
"strictNullChecks": true,
|
6
|
+
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
7
|
+
"module": "ESNext",
|
8
|
+
"moduleResolution": "NodeNext",
|
9
|
+
"baseUrl": ".",
|
10
|
+
"paths": {
|
11
|
+
// don't modify the below paths without consulting with neetoCompliance team
|
12
|
+
"apis": ["src/apis"],
|
13
|
+
"apis/*": ["src/apis/*"],
|
14
|
+
"assets": ["src/assets"],
|
15
|
+
"assets/*": ["src/assets/*"],
|
16
|
+
"components/*": ["src/components/*"],
|
17
|
+
"hooks": ["src/hooks"],
|
18
|
+
"hooks/*": ["src/hooks/*"],
|
19
|
+
"reducers": ["src/reducers"],
|
20
|
+
"reducers/*": ["src/reducers/*"],
|
21
|
+
"routes": ["src/routes"],
|
22
|
+
"routes/*": ["src/routes/*"],
|
23
|
+
"translations": ["src/translations"],
|
24
|
+
"translations/*": ["src/translations/*"],
|
25
|
+
"utils": ["src/utils"],
|
26
|
+
"utils/*": ["src/utils/*"],
|
27
|
+
"neetoui": ["../../node_modules/@bigbinary/neetoui"],
|
28
|
+
"neetoui/*": ["../../node_modules/@bigbinary/neetoui/*"],
|
29
|
+
"neetocommons": ["../../node_modules/@bigbinary/neeto-commons-frontend"],
|
30
|
+
"neetocommons/*": [
|
31
|
+
"../../node_modules/@bigbinary/neeto-commons-frontend/*"
|
32
|
+
],
|
33
|
+
"neetoicons": ["../../node_modules/@bigbinary/neeto-icons"],
|
34
|
+
"neetoicons/*": ["../../node_modules/@bigbinary/neeto-icons/*"],
|
35
|
+
"neetoteam": [
|
36
|
+
"../../node_modules/@bigbinary/neeto-team-members-frontend"
|
37
|
+
],
|
38
|
+
"neetoteam/*": [
|
39
|
+
"../../node_modules/@bigbinary/neeto-team-members-frontend/*"
|
40
|
+
],
|
41
|
+
"neetoeditor": ["../../node_modules/@bigbinary/neeto-editor"],
|
42
|
+
"neetoeditor/*": ["../../node_modules/@bigbinary/neeto-editor/*"],
|
43
|
+
"neetofilters": ["../../node_modules/@bigbinary/neeto-filters-frontend"],
|
44
|
+
"neetofilters/*": [
|
45
|
+
"../../node_modules/@bigbinary/neeto-filters-frontend/*"
|
46
|
+
],
|
47
|
+
"neetomolecules/*": [
|
48
|
+
"../../node_modules/@bigbinary/neeto-molecules/types/*"
|
49
|
+
],
|
50
|
+
"neetopayments": ["../../node_modules/@bigbinary/neeto-payments-frontend"],
|
51
|
+
"neetopayments/*": ["../../node_modules@bigbinary/neeto-payments-frontend/*"]
|
52
|
+
// You can add custom project specific paths below this comment
|
53
|
+
},
|
54
|
+
"pretty": true,
|
55
|
+
"experimentalDecorators": true,
|
56
|
+
"esModuleInterop": true,
|
57
|
+
"checkJs": true,
|
58
|
+
"jsx": "preserve"
|
59
|
+
},
|
60
|
+
"exclude": ["**/node_modules", "**/.*/"],
|
61
|
+
"include": ["./**/*.js", "./**/*.jsx", "./**/*.d.ts"]
|
62
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import axios from "axios";
|
2
|
+
import { GlobalLogger } from "js-logger";
|
3
|
+
|
4
|
+
declare module "axios" {
|
5
|
+
interface CustomRequestConfig extends AxiosRequestConfig {
|
6
|
+
showToastr?: Boolean;
|
7
|
+
includeMetadataInResponse?: Boolean;
|
8
|
+
transformResponseCase?: Boolean;
|
9
|
+
transformRequestCase?: Boolean;
|
10
|
+
redirectOnError?: Boolean;
|
11
|
+
show404ErrorPage?: Boolean;
|
12
|
+
}
|
13
|
+
export interface AxiosInstance {
|
14
|
+
request(config: CustomRequestConfig): Promise<any>;
|
15
|
+
get(url: string, config?: CustomRequestConfig): Promise<any>;
|
16
|
+
delete(url: string, config?: CustomRequestConfig): Promise<any>;
|
17
|
+
head(url: string, config?: CustomRequestConfig): Promise<any>;
|
18
|
+
post(url: string, data?: any, config?: CustomRequestConfig): Promise<any>;
|
19
|
+
put(url: string, data?: any, config?: CustomRequestConfig): Promise<any>;
|
20
|
+
patch(url: string, data?: any, config?: CustomRequestConfig): Promise<any>;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
declare global {
|
25
|
+
var logger: GlobalLogger;
|
26
|
+
|
27
|
+
declare module "images/*" {
|
28
|
+
const content: any;
|
29
|
+
export default content;
|
30
|
+
}
|
31
|
+
|
32
|
+
declare module "*.json" {
|
33
|
+
const content: any;
|
34
|
+
export default content;
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
module.exports = require("@bigbinary/neeto-commons-frontend/configs/babel.js");
|
@@ -0,0 +1,40 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "fileutils"
|
5
|
+
|
6
|
+
# path to your application root.
|
7
|
+
APP_ROOT = File.expand_path("..", __dir__)
|
8
|
+
|
9
|
+
def system!(*args)
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
11
|
+
end
|
12
|
+
|
13
|
+
FileUtils.chdir APP_ROOT do
|
14
|
+
# This script is a way to set up or update your development environment automatically.
|
15
|
+
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
|
16
|
+
# Add necessary setup steps to this file.
|
17
|
+
puts "== Installing dependencies =="
|
18
|
+
cmd = "gem install bundler --conservative"
|
19
|
+
puts "Executing #{cmd}"
|
20
|
+
system! cmd
|
21
|
+
system("bundle check") || system!("bundle install")
|
22
|
+
|
23
|
+
puts "\n== Executing yarn =="
|
24
|
+
system!("bin/yarn")
|
25
|
+
|
26
|
+
puts "\n== Creating config/database.yml file =="
|
27
|
+
if !ENV["DOCKER_ENV"]
|
28
|
+
system! "rm -f config/database.yml"
|
29
|
+
system! "cp config/database.yml.postgresql config/database.yml"
|
30
|
+
end
|
31
|
+
|
32
|
+
puts "\n== Executing rake setup =="
|
33
|
+
system! "bundle exec rake setup"
|
34
|
+
|
35
|
+
puts "\n== Removing logs and tempfiles =="
|
36
|
+
system! "bin/rails log:clear tmp:clear"
|
37
|
+
|
38
|
+
puts "\n== Restarting application server =="
|
39
|
+
system! "bundle exec rails restart"
|
40
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "fileutils"
|
5
|
+
include FileUtils
|
6
|
+
|
7
|
+
# path to your application root.
|
8
|
+
APP_ROOT = File.expand_path("..", __dir__)
|
9
|
+
|
10
|
+
def system!(*args)
|
11
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
12
|
+
end
|
13
|
+
|
14
|
+
chdir APP_ROOT do
|
15
|
+
# This script is a way to update your development environment automatically.
|
16
|
+
# Add necessary update steps to this file.
|
17
|
+
|
18
|
+
puts "== Installing dependencies =="
|
19
|
+
system! "gem install bundler --conservative"
|
20
|
+
system("bundle check") || system!("bundle install")
|
21
|
+
|
22
|
+
# Install JavaScript dependencies if using Yarn
|
23
|
+
# system('bin/yarn')
|
24
|
+
|
25
|
+
puts "\n== Updating database =="
|
26
|
+
system! "bin/rails db:migrate"
|
27
|
+
|
28
|
+
puts "\n== Removing old logs and tempfiles =="
|
29
|
+
system! "bin/rails log:clear tmp:clear"
|
30
|
+
|
31
|
+
puts "\n== Restarting application server =="
|
32
|
+
system! "bin/rails restart"
|
33
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "pathname"
|
5
|
+
require "rubygems"
|
6
|
+
require "bundler/setup"
|
7
|
+
require "webpacker"
|
8
|
+
require "webpacker/webpack_runner"
|
9
|
+
|
10
|
+
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
11
|
+
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
APP_ROOT = File.expand_path("..", __dir__)
|
15
|
+
Dir.chdir(APP_ROOT) do
|
16
|
+
Webpacker::WebpackRunner.run(ARGV)
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "pathname"
|
5
|
+
require "rubygems"
|
6
|
+
require "bundler/setup"
|
7
|
+
require "webpacker"
|
8
|
+
require "webpacker/dev_server_runner"
|
9
|
+
|
10
|
+
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
11
|
+
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
APP_ROOT = File.expand_path("..", __dir__)
|
15
|
+
Dir.chdir(APP_ROOT) do
|
16
|
+
Webpacker::DevServerRunner.run(ARGV)
|
17
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
APP_ROOT = File.expand_path("..", __dir__)
|
5
|
+
Dir.chdir(APP_ROOT) do
|
6
|
+
yarn = ENV["PATH"].split(File::PATH_SEPARATOR)
|
7
|
+
.select { |dir| File.expand_path(dir) != __dir__ }
|
8
|
+
.product(["yarn", "yarnpkg", "yarn.cmd", "yarn.ps1"])
|
9
|
+
.map { |dir, file| File.expand_path(file, dir) }
|
10
|
+
.find { |file| File.executable?(file) }
|
11
|
+
|
12
|
+
if yarn
|
13
|
+
exec yarn, *ARGV
|
14
|
+
else
|
15
|
+
$stderr.puts "Yarn executable was not detected in the system."
|
16
|
+
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
17
|
+
exit 1
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
// DO NOT ADD ANY OTHER RULES TO THIS FILE WITHOUT
|
2
|
+
// CONSULTING WITH THE WHEEL TEAM.
|
3
|
+
|
4
|
+
const {
|
5
|
+
buildPathGroupsBasedOnWebpackAliases,
|
6
|
+
} = require(`${__dirname}/../node_modules/@bigbinary/neeto-commons-frontend/configs/eslint/helpers`);
|
7
|
+
|
8
|
+
const pathGroups = buildPathGroupsBasedOnWebpackAliases({
|
9
|
+
customJSRoot: "cypress-tests/",
|
10
|
+
customAliasPath: "cypress-tests/cypress/resolve.js",
|
11
|
+
});
|
12
|
+
|
13
|
+
const pathGroupForKeepingReactImportsAtTop = {
|
14
|
+
pattern: "react+(-native|)",
|
15
|
+
group: "external",
|
16
|
+
position: "before",
|
17
|
+
};
|
18
|
+
|
19
|
+
pathGroups.push(pathGroupForKeepingReactImportsAtTop);
|
20
|
+
|
21
|
+
module.exports = {
|
22
|
+
root: true,
|
23
|
+
extends: ["../.eslintrc"],
|
24
|
+
rules: {
|
25
|
+
// disable async/await for cypress given that cypress doesn't allow async/await syntax
|
26
|
+
// https://docs.cypress.io/faq/questions/using-cypress-faq#Can-I-use-the-new-ES7-async-await-syntax
|
27
|
+
"promise/prefer-await-to-then": "off",
|
28
|
+
"import/order": [
|
29
|
+
"error",
|
30
|
+
{
|
31
|
+
"newlines-between": "always",
|
32
|
+
alphabetize: { order: "asc", caseInsensitive: true },
|
33
|
+
warnOnUnassignedImports: true,
|
34
|
+
groups: [
|
35
|
+
"builtin",
|
36
|
+
"external",
|
37
|
+
"internal",
|
38
|
+
"index",
|
39
|
+
"sibling",
|
40
|
+
"parent",
|
41
|
+
"object",
|
42
|
+
"type",
|
43
|
+
],
|
44
|
+
/*
|
45
|
+
* Currently we check for existence of webpack alias
|
46
|
+
* config and then iterate over the aliases and create
|
47
|
+
* these pathGroups. Only caveat with this mechanism
|
48
|
+
* is that in VSCode eslint plugin won't dynamically
|
49
|
+
* read it. But eslint cli would!
|
50
|
+
*/
|
51
|
+
pathGroups,
|
52
|
+
// Ignore react imports so that they're always ordered to the top of the file.
|
53
|
+
pathGroupsExcludedImportTypes: ["react", "react-native"],
|
54
|
+
},
|
55
|
+
],
|
56
|
+
},
|
57
|
+
};
|
@@ -0,0 +1,63 @@
|
|
1
|
+
/// <reference types="cypress" />
|
2
|
+
// ***********************************************************
|
3
|
+
// This example plugins/index.js can be used to load plugins
|
4
|
+
//
|
5
|
+
// You can change the location of this file or turn off loading
|
6
|
+
// the plugins file with the 'pluginsFile' configuration option.
|
7
|
+
//
|
8
|
+
// You can read more here:
|
9
|
+
// https://on.cypress.io/plugins-guide
|
10
|
+
// ***********************************************************
|
11
|
+
|
12
|
+
// This function is called when a project is opened or re-opened (e.g. due to
|
13
|
+
// the project's config changing)
|
14
|
+
|
15
|
+
/**
|
16
|
+
* @type {Cypress.PluginConfig}
|
17
|
+
*/
|
18
|
+
// eslint-disable-next-line no-unused-vars
|
19
|
+
const path = require("path");
|
20
|
+
|
21
|
+
const webpack = require("@cypress/webpack-preprocessor");
|
22
|
+
const {
|
23
|
+
cypressBrowserPermissionsPlugin,
|
24
|
+
} = require("cypress-browser-permissions");
|
25
|
+
const fs = require("fs-extra");
|
26
|
+
|
27
|
+
const getConfigurationByFile = file => {
|
28
|
+
const pathToConfigFile = `config/cypress.${file}.json`;
|
29
|
+
|
30
|
+
return file && fs.readJsonSync(path.join(__dirname, "../", pathToConfigFile));
|
31
|
+
};
|
32
|
+
|
33
|
+
const merge = (target, source = {}) => {
|
34
|
+
Object.keys(source).forEach(key => {
|
35
|
+
if (source[key] && typeof source[key] === "object") {
|
36
|
+
merge((target[key] = target[key] || {}), source[key]);
|
37
|
+
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
target[key] = source[key];
|
41
|
+
});
|
42
|
+
|
43
|
+
return target;
|
44
|
+
};
|
45
|
+
|
46
|
+
module.exports = (on, config) => {
|
47
|
+
const environment = config.env.configFile;
|
48
|
+
const configForEnvironment = getConfigurationByFile(environment);
|
49
|
+
const options = {
|
50
|
+
// send in the options from your webpack.config.js
|
51
|
+
webpackOptions: require("../webpack.config"),
|
52
|
+
watchOptions: {},
|
53
|
+
};
|
54
|
+
on("file:preprocessor", webpack(options));
|
55
|
+
|
56
|
+
config = cypressBrowserPermissionsPlugin(on, config);
|
57
|
+
|
58
|
+
const newEnvironment = merge(config, configForEnvironment);
|
59
|
+
require("@cypress/grep/src/plugin")(newEnvironment);
|
60
|
+
require("@cypress/code-coverage/task")(on, newEnvironment);
|
61
|
+
|
62
|
+
return config, newEnvironment;
|
63
|
+
};
|
data/lib/neeto_commons_backend/common_files/github/workflows/auto_update_prs_with_latest_master.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
name: PR-autoupdate-from-main
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
Auto:
|
10
|
+
name: Auto-update
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
steps:
|
13
|
+
- uses: bigbinary/pr-auto-update@v2.2.2
|
14
|
+
with:
|
15
|
+
github_token: ${{ secrets.AUTOREBASE_TOKEN }}
|
16
|
+
skip_labels: |
|
17
|
+
cypress-happy-path-run
|
18
|
+
cypress-run
|
19
|
+
cypress-triggered
|
20
|
+
cypress-happy-path-triggered
|
21
|
+
pause-auto-update
|
@@ -0,0 +1,51 @@
|
|
1
|
+
name: Bump version
|
2
|
+
on:
|
3
|
+
pull_request:
|
4
|
+
branches:
|
5
|
+
- main
|
6
|
+
types:
|
7
|
+
- closed
|
8
|
+
jobs:
|
9
|
+
release:
|
10
|
+
name: Bump version
|
11
|
+
permissions: write-all
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
if: >-
|
14
|
+
${{ github.event.pull_request.merged == true && !contains(github.event.pull_request.labels.*.name, 'skip-version-bump') }}
|
15
|
+
steps:
|
16
|
+
- name: Checkout code
|
17
|
+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
18
|
+
with:
|
19
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
20
|
+
|
21
|
+
- name: Setup ruby
|
22
|
+
uses: ruby/setup-ruby@904f3fef85a9c80a3750cbe7d5159268fd5caa9f # v1.138.0
|
23
|
+
with:
|
24
|
+
ruby-version: '3.2'
|
25
|
+
bundler-cache: true
|
26
|
+
|
27
|
+
- name: Bump version and create PR
|
28
|
+
uses: bigbinary/bump-product-version@v1.1.3
|
29
|
+
continue-on-error: true
|
30
|
+
with:
|
31
|
+
labels: ${{ join(github.event.pull_request.labels.*.name, ',') }}
|
32
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
33
|
+
default_bump_label: patch
|
34
|
+
|
35
|
+
- name: Find bump version PR
|
36
|
+
uses: juliangruber/find-pull-request-action@v1
|
37
|
+
id: find-pull-request
|
38
|
+
with:
|
39
|
+
branch: bump-gem-version
|
40
|
+
state: all
|
41
|
+
|
42
|
+
- name: Add mergepr label
|
43
|
+
uses: actions/github-script@v6
|
44
|
+
with:
|
45
|
+
script: |
|
46
|
+
github.rest.issues.addLabels({
|
47
|
+
issue_number: ${{ steps.find-pull-request.outputs.number }},
|
48
|
+
owner: context.repo.owner,
|
49
|
+
repo: context.repo.repo,
|
50
|
+
labels: ["mergepr"]
|
51
|
+
})
|
@@ -0,0 +1,31 @@
|
|
1
|
+
common: &default_settings
|
2
|
+
license_key: f36e8e91ae6931816b64b0f2e5da8401ba5dNRAL
|
3
|
+
|
4
|
+
app_name: <%= Rails.application.class.module_parent_name.underscore.dasherize + "-web" %>
|
5
|
+
|
6
|
+
log_level: info
|
7
|
+
|
8
|
+
distributed_tracing.enabled: true
|
9
|
+
|
10
|
+
error_collector.ignore_classes: ["ActiveRecord::RecordNotFound"]
|
11
|
+
|
12
|
+
monitor_mode: false
|
13
|
+
|
14
|
+
development:
|
15
|
+
<<: *default_settings
|
16
|
+
app_name: <%= Rails.application.class.module_parent_name.underscore.dasherize + "-web (Development)" %>
|
17
|
+
|
18
|
+
test:
|
19
|
+
<<: *default_settings
|
20
|
+
|
21
|
+
heroku:
|
22
|
+
<<: *default_settings
|
23
|
+
|
24
|
+
staging:
|
25
|
+
<<: *default_settings
|
26
|
+
app_name: <%= Rails.application.class.module_parent_name.underscore.dasherize + "-web (Staging)" %>
|
27
|
+
monitor_mode: true
|
28
|
+
|
29
|
+
production:
|
30
|
+
<<: *default_settings
|
31
|
+
monitor_mode: true
|
@@ -0,0 +1,119 @@
|
|
1
|
+
{
|
2
|
+
"engines": {
|
3
|
+
"node": "18.12",
|
4
|
+
"npm": "9.x",
|
5
|
+
"yarn": "1.22.x"
|
6
|
+
},
|
7
|
+
"lint-staged": {
|
8
|
+
"app/**/*.{html,md,js,css,jsx,json,yml}": [
|
9
|
+
"prettier --write",
|
10
|
+
"eslint --cache --fix"
|
11
|
+
],
|
12
|
+
"cypress-tests/**/*.{html,md,js,css,jsx,json,yml}": [
|
13
|
+
"prettier --write",
|
14
|
+
"eslint --cache --fix"
|
15
|
+
],
|
16
|
+
"{package.json,.eslintrc.js,.prettierrc.js}": [
|
17
|
+
"prettier --write",
|
18
|
+
"eslint --cache --fix"
|
19
|
+
],
|
20
|
+
".eslint-rules/**/*": ["prettier --write", "eslint --cache --fix"],
|
21
|
+
"./**/*.rb": ["bundle exec rubocop -a --force-exclusion"],
|
22
|
+
"{Gemfile,Rakefile,config.ru}": [
|
23
|
+
"bundle exec rubocop -a --force-exclusion"
|
24
|
+
],
|
25
|
+
"app/views/**/*.html.erb": [
|
26
|
+
"bundle exec erblint --lint-all --format compact -a"
|
27
|
+
]
|
28
|
+
},
|
29
|
+
"devDependencies": {
|
30
|
+
"@babel/eslint-parser": "7.17.0",
|
31
|
+
"@bigbinary/eslint-plugin-neeto": "1.0.46",
|
32
|
+
"eslint": "8.14.0",
|
33
|
+
"eslint-config-prettier": "8.5.0",
|
34
|
+
"eslint-plugin-cypress": "2.12.1",
|
35
|
+
"eslint-plugin-import": "2.26.0",
|
36
|
+
"eslint-plugin-jam3": "0.2.3",
|
37
|
+
"eslint-plugin-json": "3.1.0",
|
38
|
+
"eslint-plugin-prettier": "4.0.0",
|
39
|
+
"eslint-plugin-promise": "6.0.0",
|
40
|
+
"eslint-plugin-react": "7.29.4",
|
41
|
+
"eslint-plugin-react-hooks": "4.5.0",
|
42
|
+
"eslint-plugin-unused-imports": "2.0.0",
|
43
|
+
"husky": "7.0.4",
|
44
|
+
"lint-staged": "12.4.1",
|
45
|
+
"prettier": "2.6.2",
|
46
|
+
"prettier-plugin-tailwindcss": "0.1.10",
|
47
|
+
"webpack-dev-server": "^4.11.0"
|
48
|
+
},
|
49
|
+
"dependencies": {
|
50
|
+
"@babel/core": "^7.19.1",
|
51
|
+
"@babel/plugin-transform-runtime": "^7.19.1",
|
52
|
+
"@babel/preset-env": "7.17.10",
|
53
|
+
"@babel/preset-react": "7.16.7",
|
54
|
+
"@bigbinary/babel-preset-neeto": "^1.0.3",
|
55
|
+
"@babel/preset-typescript": "^7.18.6",
|
56
|
+
"@babel/runtime": "^7.19.0",
|
57
|
+
"@bigbinary/neeto-editor": "1.26.12",
|
58
|
+
"@bigbinary/neeto-filters-frontend": "2.11.5",
|
59
|
+
"@bigbinary/neeto-icons": "1.11.0",
|
60
|
+
"@bigbinary/neeto-commons-frontend": "2.0.73",
|
61
|
+
"@bigbinary/neeto-molecules": "1.0.30",
|
62
|
+
"@bigbinary/neeto-tags-frontend": "1.1.5",
|
63
|
+
"@honeybadger-io/react": "2.0.1",
|
64
|
+
"@bigbinary/neetoui": "4.4.27",
|
65
|
+
"antd": "4.24.3",
|
66
|
+
"autoprefixer": "^10.4.5",
|
67
|
+
"axios": "0.27.2",
|
68
|
+
"babel-loader": "^8.2.5",
|
69
|
+
"babel-plugin-istanbul": "^6.1.1",
|
70
|
+
"babel-plugin-js-logger": "1.0.17",
|
71
|
+
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
|
72
|
+
"babel-preset-react": "6.24.1",
|
73
|
+
"babel-preset-typescript": "^7.0.0-alpha.19",
|
74
|
+
"buffer": "^6.0.3",
|
75
|
+
"classnames": "2.3.1",
|
76
|
+
"compression-webpack-plugin": "^10.0.0",
|
77
|
+
"crypto-browserify": "^3.12.0",
|
78
|
+
"css-loader": "^6.7.1",
|
79
|
+
"dayjs": "1.11.1",
|
80
|
+
"dotenv-webpack": "^8.0.1",
|
81
|
+
"formik": "2.2.9",
|
82
|
+
"i18next": "21.7.0",
|
83
|
+
"js-logger": "1.6.1",
|
84
|
+
"mini-css-extract-plugin": "^2.6.1",
|
85
|
+
"path-browserify": "^1.0.1",
|
86
|
+
"postcss": "^8.4.17",
|
87
|
+
"postcss-import": "^15.0.0",
|
88
|
+
"postcss-loader": "^7.0.1",
|
89
|
+
"postcss-preset-env": "7.8.2",
|
90
|
+
"process": "^0.11.10",
|
91
|
+
"prop-types": "15.8.1",
|
92
|
+
"ramda": "0.28.0",
|
93
|
+
"react": "17.0.2",
|
94
|
+
"react-dom": "17.0.2",
|
95
|
+
"react-i18next": "11.16.8",
|
96
|
+
"react-query": "3.39.2",
|
97
|
+
"react-router-dom": "5.3.1",
|
98
|
+
"react-svg-loader": "3.0.3",
|
99
|
+
"react-toastify": "8.0.2",
|
100
|
+
"react_ujs": "2.6.2",
|
101
|
+
"sass": "^1.54.9",
|
102
|
+
"sass-loader": "^13.0.2",
|
103
|
+
"shakapacker": "6.5.2",
|
104
|
+
"source-map-loader": "4.0.1",
|
105
|
+
"stream-browserify": "^3.0.0",
|
106
|
+
"style-loader": "^3.3.1",
|
107
|
+
"terser-webpack-plugin": "^5.3.6",
|
108
|
+
"url": "^0.11.0",
|
109
|
+
"util": "^0.12.5",
|
110
|
+
"webpack": "^5.76.0",
|
111
|
+
"webpack-assets-manifest": "^5.1.0",
|
112
|
+
"webpack-cli": "^4.10.0",
|
113
|
+
"webpack-merge": "^5.8.0",
|
114
|
+
"webpack-sources": "^3.2.3",
|
115
|
+
"yup": "0.32.11",
|
116
|
+
"react-helmet": "^6.1.0",
|
117
|
+
"zustand": "4.3.2"
|
118
|
+
}
|
119
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# ATTRIBUTES
|
2
|
+
# name - The name of the organization's role. (Required)
|
3
|
+
# description - The description of the organization's role. (Required)
|
4
|
+
# kind - The kind of organization role. The acceptable values are "system" or "custom".
|
5
|
+
# System roles cannot be deleted or modified. (Required)
|
6
|
+
# permissions - The permissions for that organization role (Required).
|
7
|
+
#
|
8
|
+
# For all the permissions:
|
9
|
+
# permissions: all
|
10
|
+
#
|
11
|
+
# For no permission:
|
12
|
+
# permissions: none
|
13
|
+
#
|
14
|
+
# For only some permissions:
|
15
|
+
# permissions:
|
16
|
+
# only:
|
17
|
+
# - <permission_1_name>
|
18
|
+
# - <permission_2_name>
|
19
|
+
#
|
20
|
+
# For permissions expect some permissions:
|
21
|
+
# permissions:
|
22
|
+
# except:
|
23
|
+
# - <permission_1_name>
|
24
|
+
# - <permission_2_name>
|
25
|
+
|
26
|
+
roles:
|
27
|
+
- name: Admin
|
28
|
+
description: This role applies to the organization admin.
|
29
|
+
kind: system
|
30
|
+
permissions: all
|
31
|
+
- name: Standard
|
32
|
+
description: This role applies to all the organization's standard users.
|
33
|
+
kind: system
|
34
|
+
permissions: none
|