KatalysatorAB / atom-ember-tabs

Makes atom.io work better with Ember pods.
MIT License
26 stars 5 forks source link

Support and/or Feature request: Ember package path not matching regex. #8

Closed DanChadwick closed 8 years ago

DanChadwick commented 8 years ago

I nest my components and would like to adjust the regex used to detect component paths. I receive this message in the log, for example:

[ember-tabs] filePath: C:\ember\ic\app\components\table\item-cell\component.js was not an ember package path. Checked against regex.

It would be great if I could adjust the regex expression either in the UI or in a config file. Perhaps this is possible already?

DanChadwick commented 8 years ago

Upon closer inspection, I'm not sure why the following doesn't match without any config customization:

[ember-tabs] filePath: C:\ember\ic\app\components\date-picker\component.js was not an ember package path. Checked against regex.

My .ember-cli:

{
  /**
    Ember CLI sends analytics information by default. The data is completely
    anonymous, but there are times when you might want to disable this behavior.

    Setting `disableAnalytics` to true will prevent any data from being sent.
  */
  "disableAnalytics": true,
  "usePods": true,
  "liveReload": true,
  "watcher": "polling"
}
erkie commented 8 years ago

Can you post a screenshot of the of the entire log? Thanks!

DanChadwick commented 8 years ago

You may be sorry you asked. ;)

ember-pods-project.coffee:9 [ember-tabs] Initiating pods project with root path C:\ember\ic
ember-pods-project.coffee:17 [ember-tabs] Attempting to read C:\ember\ic/.ember-cli
ember-pods-project.coffee:9 [ember-tabs] Initiating pods project with root path C:\ember\ic\node_modules\ember-table
ember-pods-project.coffee:17 [ember-tabs] Attempting to read C:\ember\ic\node_modules\ember-table/.ember-cli
index.js:52 Window load time: 2225ms
C:\Users\Dan\AppData\Local\atom\app-1.4.0\resources\app.asar\src\text-editor-component.js:915 ::shadow pseudo-element is deprecated. See https://www.chromestatus.com/features/6750456638341120 for more details.
2ember-pods-project.coffee:21 [ember-tabs] .ember-cli did exist. Trying to read it
ember-pods-project.coffee:28 [ember-tabs] Trying to parse the contents
ember-pods-project.coffee:32 [ember-tabs] Parsing worked great.
ember-pods-project.coffee:38 [ember-tabs] Everying read fine. Settings: true
ember-tabs.coffee:50 [ember-tabs] Detected Ember project.
tab-watcher.coffee:6 [ember-tabs] Shimming tabs...
ember-pods-project.coffee:28 [ember-tabs] Trying to parse the contents
ember-pods-project.coffee:32 [ember-tabs] Parsing worked great.
ember-pods-project.coffee:38 [ember-tabs] Everying read fine. Settings: undefined
ember-tabs.coffee:53 [ember-tabs] Did not detect ember project with pods enabled.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\ember-table.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\scroll-container.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\scroll-panel.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\body-table-container.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\app\components\table\item-cell\component.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\app\templates\components\body-table-container.hbs was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\lazy-table-block.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\ember-table.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\scroll-container.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\scroll-panel.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\body-table-container.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\app\components\table\item-cell\component.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\app\templates\components\body-table-container.hbs was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\lazy-table-block.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\ember-table.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\scroll-container.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\scroll-panel.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\body-table-container.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\app\components\table\item-cell\component.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\app\templates\components\body-table-container.hbs was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\lazy-table-block.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\ember-table.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\scroll-container.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\scroll-panel.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\body-table-container.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\app\components\table\item-cell\component.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\app\templates\components\body-table-container.hbs was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\lazy-table-block.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\ember-table.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\scroll-container.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\scroll-panel.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\body-table-container.js was not an ember package path. Checked against regex.
tab-watcher.coffee:79 [ember-tabs] filePath: C:\ember\ic\app\components\table\item-cell\component.js was not an ember package path. Checked against regex.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\app\templates\components\body-table-container.hbs was not an ember package path. Checked against regex.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\lazy-table-block.js was not an ember package path. Checked against regex.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\ember-table.js was not an ember package path. Checked against regex.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\scroll-container.js was not an ember package path. Checked against regex.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\scroll-panel.js was not an ember package path. Checked against regex.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\body-table-container.js was not an ember package path. Checked against regex.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\app\components\table\item-cell\component.js was not an ember package path. Checked against regex.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\app\templates\components\body-table-container.hbs was not an ember package path. Checked against regex.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\lazy-table-block.js was not an ember package path. Checked against regex.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\ember-table.js was not an ember package path. Checked against regex.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\scroll-container.js was not an ember package path. Checked against regex.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\scroll-panel.js was not an ember package path. Checked against regex.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\body-table-container.js was not an ember package path. Checked against regex.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\app\components\table\item-cell\component.js was not an ember package path. Checked against regex.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\app\templates\components\body-table-container.hbs was not an ember package path. Checked against regex.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\node_modules\ember-table\addon\components\lazy-table-block.js was not an ember package path. Checked against regex.
erkie commented 8 years ago

Can you send a screenshot of the your atom window? It seems like you have three split panes open? Is that correct? I'd like to see what it looks like so I can replicate the setup.

DanChadwick commented 8 years ago

I don't have three split panes open, but rather I had three projects in the project page. To simplify this, I closed two of them (which were under node_modules). These are the current messages:

[ember-tabs] Initiating pods project with root path C:\ember\ic
/C:/Users/Dan/.atom/packages/ember-tabs/lib/ember-pods-project.coffee:26 [ember-tabs] Attempting to read C:\ember\ic/.ember-cli
index.js:52 Window load time: 2263ms
C:\Users\Dan\AppData\Local\atom\app-1.4.1\resources\app.asar\src\text-editor-component.js:915 ::shadow pseudo-element is deprecated. See https://www.chromestatus.com/features/6750456638341120 for more details.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/ember-pods-project.coffee:30 [ember-tabs] .ember-cli did exist. Trying to read it
/C:/Users/Dan/.atom/packages/ember-tabs/lib/ember-pods-project.coffee:36 [ember-tabs] Trying to parse the contents
/C:/Users/Dan/.atom/packages/ember-tabs/lib/ember-pods-project.coffee:39 [ember-tabs] Parsing worked great.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/ember-pods-project.coffee:45 [ember-tabs] Everying read fine. Settings: true
/C:/Users/Dan/.atom/packages/ember-tabs/lib/ember-tabs.coffee:68 [ember-tabs] Detected Ember project.
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:14 [ember-tabs] Shimming tabs...
/C:/Users/Dan/.atom/packages/ember-tabs/lib/tab-watcher.coffee:124 [ember-tabs] filePath: C:\ember\ic\app\components\date-picker\component.js was not an ember package path. Checked against regex.

In this example, I have app/components/MYCOMPONENT/component.js open, which should be recognized as a pod tab. I would further like to nest components, such as app/components/MYCOMPONENT/MYSUBCOMPONENT/component.js. Since this isn't natively supported by ember (without overriding the resolver), I'm thinking that I would need to fiddle with the regex to allow this path to match.

XaserAcheron commented 8 years ago

@DanChadwick: Are you on Windows, by chance? I'm running into this as well (on Windows) and it looks to be a backslash-vs-forwardslash issue, since the regex is only checking for the latter.

I'll make a quick fork to test my theory and open a PR if it works.

DanChadwick commented 8 years ago

Yes I am on Windows. Thx

XaserAcheron commented 8 years ago

Cool! That likely solves the mystery -- got it patched on my end.

PR incoming, though I went with a string replace rather than changing the regex.

DanChadwick commented 8 years ago

Thanks so much! Version 2.2.2, which incorporates the above merge, fixes the problem and I now have ember-friendly tabs on Windows.