balderdashy / balderdashy/sails
ignore ts files
- Dominant language
- JavaScript
- Stars
- 22.8k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used [patch-package](https://github.com/ds300/patch-package) to patch `sails@1.5.2` for the project I'm working on.
Here is the diff that solved my problem:
```diff
diff --git a/node_modules/sails/lib/app/private/controller/load-action-modules.js b/node_modules/sails/lib/app/private/controller/load-action-modules.js
index aae04a6..5e87ca9 100644
--- a/node_modules/sails/lib/app/private/controller/load-action-modules.js
+++ b/node_modules/sails/lib/app/private/controller/load-action-modules.js
@@ -26,7 +26,7 @@ module.exports = function loadActionModules (sails, cb) {
// Load all files under the controllers folder.
includeAll.optional({
dirname: sails.config.paths.controllers,
- filter: /(^[^.]+\.(?:(?!md|txt).)+$)/,
+ filter: /(^[^.]+\.(?:(?!|ts).)+$)/,
flatten: true,
keepDirectoryPath: true
}, function(err, files) {
diff --git a/node_modules/sails/lib/hooks/helpers/private/load-helpers.js b/node_modules/sails/lib/hooks/helpers/private/load-helpers.js
index 96d8074..02a1a9f 100644
--- a/node_modules/sails/lib/hooks/helpers/private/load-helpers.js
+++ b/node_modules/sails/lib/hooks/helpers/private/load-helpers.js
@@ -23,7 +23,7 @@ module.exports = function loadHelpers(sails, done) {
// Load helper defs out of the specified folder
includeAll.optional({
dirname: sails.config.paths.helpers,
- filter: /^([^.]+)\.(?:(?!md|txt).)+$/,
+ filter: /^([^.]+)\.(?:(?!md|txt|ts).)+$/,
flatten: true,
keepDirectoryPath: true
}, function(err, helperDefs) {
diff --git a/node_modules/sails/lib/hooks/moduleloader/index.js b/node_modules/sails/lib/hooks/moduleloader/index.js
index c3e1430..4373884 100644
--- a/node_modules/sails/lib/hooks/moduleloader/index.js
+++ b/node_modules/sails/lib/hooks/moduleloader/index.js
@@ -303,7 +303,7 @@ module.exports = function(sails) {
// Get the main model files
includeAll.optional({
dirname : sails.config.paths.models,
- filter : /^(.+)\.(?:(?!md|txt).)+$/,
+ filter : /^(.+)\.(?:(?!md|txt|ts).)+$/,
replaceExpr : /^.*\//,
flatten: true
}, function(err, models) {
@@ -338,7 +338,7 @@ module.exports = function(sails) {
loadServices: function (cb) {
includeAll.optional({
dirname : sails.config.paths.services,
- filter : /^(.+)\.(?:(?!md|txt).)+$/,
+ filter : /^(.+)\.(?:(?!md|txt|ts).)+$/,
depth : 1,
caseSensitive : true
}, bindToSails(cb));
@@ -368,7 +368,7 @@ module.exports = function(sails) {
loadPolicies: function (cb) {
includeAll.optional({
dirname: sails.config.paths.policies,
- filter: /^(.+)\.(?:(?!md|txt).)+$/,
+ filter: /^(.+)\.(?:(?!|ts).)+$/,
replaceExpr: null,
flatten: true,
keepDirectoryPath: true
@@ -593,7 +593,7 @@ module.exports = function(sails) {
loadResponses: function (cb) {
includeAll.optional({
dirname: sails.config.paths.responses,
- filter: /^(.+)\.(?:(?!md|txt).)+$/,
+ filter: /^(.+)\.(?:(?!md|txt|ts).)+$/,
useGlobalIdForKeyName: true
}, bindToSails(cb));
},
```
This issue body was [partially generated by patch-package](https://github.com/ds300/patch-package/issues/296).
Contributor guide
Research direction
Start with lib/app/private/controller/load-action-modules.js, lib/hooks/helpers/private/load-helpers.js, and lib/hooks/moduleloader/index.js, where the controller, helper, model, service, policy, and response filters are defined. Check how these filters handle .ts files and verify that TypeScript files are ignored consistently across each loader path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100