Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework extensions folder to use paranext-multi-extension-template #693

Merged
merged 48 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
915dd76
Started formatting to match multi-template
tjcouch-sil Dec 15, 2023
fe950b2
Updated menu command names for paratextDotBible
tjcouch-sil Dec 15, 2023
a8c4248
Removed extensions folder to prepare for adding multi-template
tjcouch-sil Dec 18, 2023
7781e37
Merge commit '906f14535d3bd9823151592edd815ef894274e62' as 'extensions'
tjcouch-sil Dec 18, 2023
906f145
Squashed 'extensions/' content from commit 56b2862f
tjcouch-sil Dec 18, 2023
1683efc
Re-added extensions folder over multi-template
tjcouch-sil Dec 20, 2023
35d984c
Updated extensions git commands for being a subfolder of this repo
tjcouch-sil Dec 20, 2023
0a618aa
Merge commit 'b596e458e3ce3c4d027b7ccfaad1b7764d323a84' as 'extension…
tjcouch-sil Dec 20, 2023
b596e45
Squashed 'extensions/src/resource-viewer/' content from commit 239accaa
tjcouch-sil Dec 20, 2023
07ca8cb
Readded Resource Viewer code
tjcouch-sil Jan 2, 2024
752ab6c
Fixed formatting of extensions and particularly tsconfig.json
tjcouch-sil Jan 2, 2024
83b3243
Added extensions that are just copied directly to dist, fixed eslint …
tjcouch-sil Jan 2, 2024
71a6b2a
Squashed 'extensions/src/quick-verse/' content from commit 239accaa
tjcouch-sil Jan 2, 2024
aaed3f9
Merge commit '71a6b2abbb740a58f27038c5a8cf333c179982a1' as 'extension…
tjcouch-sil Jan 2, 2024
9734ca9
Added extension quick-verse from template
tjcouch-sil Jan 2, 2024
c15d0a6
Readded quick-verse code
tjcouch-sil Jan 2, 2024
18dd709
Squashed 'extensions/src/hello-world/' content from commit 239accaa
tjcouch-sil Jan 2, 2024
fb4ea2c
Merge commit '18dd70960142880f3d3a37e4df2e9228ab026748' as 'extension…
tjcouch-sil Jan 2, 2024
47ea272
Prep hello-world folder
tjcouch-sil Jan 2, 2024
75f40b6
Readded hello-world code
tjcouch-sil Jan 2, 2024
5387300
Squashed 'extensions/src/hello-someone/' content from commit 239accaa
tjcouch-sil Jan 2, 2024
8779c37
Merge commit '5387300ced38dc0f5fee5350192cf746f6f87849' as 'extension…
tjcouch-sil Jan 2, 2024
7bc9c65
Formatted hello-someone
tjcouch-sil Jan 2, 2024
d9a5414
Readded hello-someone
tjcouch-sil Jan 2, 2024
d492ccf
Accommodate rename paratextDotBible to paratextBible
tjcouch-sil Jan 3, 2024
790e4a4
Merge remote-tracking branch 'origin/main' into 486-multi-extension-t…
tjcouch-sil Jan 3, 2024
bf0d9cc
Updated licenses, added 'shared with' statements to various style fil…
tjcouch-sil Jan 4, 2024
01b546a
Merge commit 'f0c055c73c0afda560dd9d249aadd39039a00603' into 486-mult…
tjcouch-sil Jan 5, 2024
f0c055c
Squashed 'extensions/' changes from 56b2862f..6fd7212c
tjcouch-sil Jan 5, 2024
d137211
Merge commit 'af34259c0367a916c315dba2bb49177f30c6ab1e' into 486-mult…
tjcouch-sil Jan 5, 2024
af34259
Squashed 'extensions/src/hello-someone/' changes from 239accaa..80e78c86
tjcouch-sil Jan 5, 2024
4a819eb
Merge commit '7c24ef0d7c52bcd3608209970b84b9056763258c' into 486-mult…
tjcouch-sil Jan 5, 2024
7c24ef0
Squashed 'extensions/src/hello-world/' changes from 239accaa..80e78c86
tjcouch-sil Jan 5, 2024
3c32772
Merge commit '413464f6dbf362a7a627f80a60109310a7c18075' into 486-mult…
tjcouch-sil Jan 5, 2024
413464f
Squashed 'extensions/src/quick-verse/' changes from 239accaa..80e78c86
tjcouch-sil Jan 5, 2024
4ec2003
Merge commit '99972f5ea81225943d729c6ecb6a478a0256eec9' into 486-mult…
tjcouch-sil Jan 5, 2024
99972f5
Squashed 'extensions/src/resource-viewer/' changes from 239accaa..80e…
tjcouch-sil Jan 5, 2024
470a0a7
Removed no-non-null-assertion as it is covered by no-type-assertion
tjcouch-sil Jan 5, 2024
d902a78
Squashed 'extensions/' changes from 6fd7212c..79123d5c
tjcouch-sil Jan 5, 2024
de3e604
Merge commit 'd902a78889d1ee5c8ea9d7e0a88cdb00300ebae8' into 486-mult…
tjcouch-sil Jan 5, 2024
9e54d10
Squashed 'extensions/src/hello-someone/' changes from 80e78c86..2bfae618
tjcouch-sil Jan 5, 2024
214a3ae
Merge commit '9e54d107277c56bd339e34c003bf3f90e2d2364a' into 486-mult…
tjcouch-sil Jan 5, 2024
58a5194
Squashed 'extensions/src/hello-world/' changes from 80e78c86..2bfae618
tjcouch-sil Jan 5, 2024
10ce1b9
Merge commit '58a51948f83937f2e296a2e1192d5d33d99061d7' into 486-mult…
tjcouch-sil Jan 5, 2024
dcb7c6d
Squashed 'extensions/src/quick-verse/' changes from 80e78c86..2bfae618
tjcouch-sil Jan 5, 2024
c4062f3
Merge commit 'dcb7c6d08bc616cf581e67f9f429b9bb994cca35' into 486-mult…
tjcouch-sil Jan 5, 2024
6c05a2f
Squashed 'extensions/src/resource-viewer/' changes from 80e78c86..2bf…
tjcouch-sil Jan 5, 2024
8a5f4eb
Merge commit '6c05a2f08f64048ab948ca6241b245002d082fea' into 486-mult…
tjcouch-sil Jan 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ node_modules
release/app/dist
release/build
.erb/dll
dev-appdata

.idea
npm-debug.log.*
Expand Down
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ module.exports = {
],

rules: {
// #region shared with https://github.com/paranext/paranext-multi-extension-template/blob/main/.eslintrc.cjs and https://github.com/paranext/paranext-extension-template/blob/main/.eslintrc.js except certain overrides

// #region ERB rules

'import/extensions': 'off',
Expand All @@ -23,7 +25,7 @@ module.exports = {

// #endregion

// #region Paranext rules
// #region Platform.Bible rules

// Rules in each section are generally in alphabetical order. However, several
// `@typescript-eslint` rules require disabling the equivalent ESLint rule. So in these cases
Expand Down Expand Up @@ -89,6 +91,8 @@ module.exports = {
'react/require-default-props': 'off',

// #endregion

// #endregion
},
globals: {
globalThis: 'readonly',
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ node_modules
release/app/dist
release/build
.erb/dll
dev-appdata

.idea
npm-debug.log.*
Expand Down
5 changes: 4 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Please keep this file in sync with the .prettierrc.js file in the paranext-extension-template repo
// #region shared with https://github.com/paranext/paranext-multi-extension-template/blob/main/.prettierrc.js and https://github.com/paranext/paranext-extension-template/blob/main/.prettierrc.js

module.exports = {
tabWidth: 2,
trailingComma: 'all',
Expand All @@ -14,3 +15,5 @@ module.exports = {
},
],
};

// #endregion
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ node_modules
release/app/dist
release/build
.erb/dll
dev-appdata

.idea
npm-debug.log.*
Expand Down
5 changes: 4 additions & 1 deletion .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Please keep this file in sync with the .stylelintrc.js file in the paranext-extension-template repo
// #region shared with https://github.com/paranext/paranext-multi-extension-template/blob/main/.stylelintrc.js and https://github.com/paranext/paranext-extension-template/blob/main/.stylelintrc.js

module.exports = {
extends: ['stylelint-config-recommended', 'stylelint-config-sass-guidelines'],
overrides: [
Expand All @@ -16,3 +17,5 @@ module.exports = {
'selector-max-id': 1,
},
};

// #endregion
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022-present SIL International
Copyright (c) 2022-2024 SIL International

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 16 additions & 0 deletions extensions/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100

[*.md]
trim_trailing_whitespace = false

[*.cs]
indent_size = 4
26 changes: 26 additions & 0 deletions extensions/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
# #region shared with https://github.com/paranext/paranext-extension-template/blob/main/.eslintignore

# Please keep this file in sync with .prettierignore and .stylelintignore

# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

# OSX
.DS_Store

.idea
npm-debug.log.*
*.css.d.ts
*.sass.d.ts
*.scss.d.ts

# Built files
dist
release
temp-build

# generated files
package-lock.json

# #endregion
121 changes: 119 additions & 2 deletions extensions/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,55 @@
// #region shared with https://github.com/paranext/paranext-extension-template/blob/main/.eslintrc.js

module.exports = {
extends: '../.eslintrc.js',
extends: [
// https://github.com/electron-react-boilerplate/eslint-config-erb/blob/main/index.js
// airbnb rules are embedded in erb https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb
'erb',
// Make sure this is last so it gets the chance to override other configs.
// See https://github.com/prettier/eslint-config-prettier and https://github.com/prettier/eslint-plugin-prettier
'plugin:prettier/recommended',
],

rules: {
'import/no-unresolved': ['error', { ignore: ['@papi'] }],
// Some rules in this following shared region are not applied since they are overridden in subsequent regions
// #region shared with https://github.com/paranext/paranext-core/blob/main/.eslintrc.js except certain overrides

// #region ERB rules

'import/extensions': 'off',
// A temporary hack related to IDE not resolving correct package.json
'import/no-extraneous-dependencies': 'off',
'import/no-import-module-exports': 'off',
'import/no-unresolved': 'error',
'react/jsx-filename-extension': 'off',
'react/react-in-jsx-scope': 'off',

// #endregion

// #region Platform.Bible rules

// Rules in each section are generally in alphabetical order. However, several
// `@typescript-eslint` rules require disabling the equivalent ESLint rule. So in these cases
// each ESLint rule is turned off immediately above the corresponding `@typescript-eslint` rule.
'import/no-anonymous-default-export': ['error', { allowCallExpression: false }],
'@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }],
'lines-between-class-members': 'off',
'@typescript-eslint/lines-between-class-members': [
'error',
'always',
{ exceptAfterSingleLine: true, exceptAfterOverload: true },
],
'@typescript-eslint/member-ordering': 'error',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': [
'error',
{
allow: ['arrowFunctions', 'functions', 'methods'],
},
],
'@typescript-eslint/no-explicit-any': 'error',
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'error',
'no-restricted-imports': [
'error',
{
Expand All @@ -13,8 +61,57 @@ module.exports = {
],
},
],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': [
'error',
{ functions: false, allowNamedExports: true, typedefs: false, ignoreTypeReferences: true },
],
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'comma-dangle': ['error', 'always-multiline'],
indent: 'off',
'jsx-a11y/label-has-associated-control': [
'error',
{
assert: 'either',
},
],
// Should use our logger anytime you want logs that persist. Otherwise use console only in testing
'no-console': 'warn',
'no-null/no-null': 2,
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'no-type-assertion/no-type-assertion': 'error',
'prettier/prettier': ['warn', { tabWidth: 2, trailingComma: 'all' }],
'react/jsx-indent-props': ['warn', 2],
'react/jsx-props-no-spreading': ['error', { custom: 'ignore' }],
'react/require-default-props': 'off',

// #endregion

// #endregion

// #region Overrides to rules from paranext-core

'import/no-unresolved': ['error', { ignore: ['@papi'] }],

// #endregion
},
globals: {
globalThis: 'readonly',
},
overrides: [
{
// Allow this file to have overrides to rules from paranext-core
files: ['.eslintrc.*js'],
rules: {
'no-dupe-keys': 'off',
},
},
{
files: ['*.js'],
rules: {
Expand All @@ -28,7 +125,25 @@ module.exports = {
'import/prefer-default-export': 'off',
},
},
{
files: ['./lib/*', './webpack/*'],
rules: {
// These files are scripts not running in Platform.Bible, so they can't use the logger
'no-console': 'off',
},
},
],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
project: './tsconfig.json',
tsconfigRootDir: __dirname,
createDefaultProgram: true,
},
// Note: this folder's package.json does not contain these plugins or any other eslint packages
// because eslint was finding multiple copies of plugins and failing. So we use the packages from
// repo root instead
plugins: ['@typescript-eslint', 'no-type-assertion', 'no-null'],
settings: {
'import/resolver': {
// See https://github.com/benmosher/eslint-plugin-import/issues/1396#issuecomment-575727774 for line below
Expand All @@ -45,3 +160,5 @@ module.exports = {
},
},
};

// #endregion
7 changes: 7 additions & 0 deletions extensions/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# #region shared with https://github.com/paranext/paranext-extension-template/blob/main/.gitignore

# Logs
logs
*.log
Expand All @@ -13,6 +15,9 @@ release
dist-ssr
*.local

# formatting and linting
.eslintcache

# Editor directories and files
.idea
.DS_Store
Expand All @@ -24,3 +29,5 @@ dist-ssr

# Temporary intermediate build files
temp-build

# #endregion
26 changes: 26 additions & 0 deletions extensions/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
# #region shared with https://github.com/paranext/paranext-extension-template/blob/main/.prettierignore

# Please keep this file in sync with .eslintignore and .stylelintignore

# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

# OSX
.DS_Store

.idea
npm-debug.log.*
*.css.d.ts
*.sass.d.ts
*.scss.d.ts

# Built files
dist
release
temp-build

# generated files
package-lock.json

# #endregion
19 changes: 19 additions & 0 deletions extensions/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// #region shared with https://github.com/paranext/paranext-core/blob/main/.prettierrc.js and https://github.com/paranext/paranext-extension-template/blob/main/.prettierrc.js

module.exports = {
tabWidth: 2,
trailingComma: 'all',
endOfLine: 'lf',
singleQuote: true,
// prettier-plugin-jsdoc options
tsdoc: true,
plugins: ['prettier-plugin-jsdoc'],
overrides: [
{
files: '*.json',
options: { parser: 'json' },
},
],
};

// #endregion
1 change: 0 additions & 1 deletion extensions/.prettierrc.json

This file was deleted.

Loading