Git Product home page Git Product logo

Comments (13)

bartvde avatar bartvde commented on May 21, 2024

ah it seems it's actually following the symlinks:

/Users/bartvandeneijnden/opengeo/git/sdk/js/components/Geocoding.jsx
../../sdk/js/components/Geocoding.jsx

from babel-plugin-react-intl.

bartvde avatar bartvde commented on May 21, 2024

Is there a way to protect the path so it never gets out of the messagesDir?

from babel-plugin-react-intl.

ericf avatar ericf commented on May 21, 2024

I don't understand the problem. What are the values for: the dir you're running Babel in, the configured messagesDir, the dir where the .js file is outputted, and the dir where the .json files are outputted?

from babel-plugin-react-intl.

bartvde avatar bartvde commented on May 21, 2024

Run babel from: /Users/bartvandeneijnden/opengeo/git/sdk-apps/tabbed/
messagesDir: /Users/bartvandeneijnden/opengeo/git/sdk-apps/tabbed/build/messages/
dir where .js is outputted: /Users/bartvandeneijnden/opengeo/git/sdk-apps/tabbed/build/
dir where json files are outputted: /Users/bartvandeneijnden/opengeo/git/sdk-apps/tabbed/sdk/js/

from babel-plugin-react-intl.

ericf avatar ericf commented on May 21, 2024

Sorry I also meant to ask the source path to a JS file. Is it not under sdk-apps/tabbed/?

What I'm thinking is that the problem is happening here: https://github.com/yahoo/babel-plugin-react-intl/blob/master/src/index.js#L157-L161

If you can step through those lines while running Babel that might show where the issue is. I haven't seen this happen before so I'm trying to figure out what's different with the inputs to this code that are resulting in the unexpected output.

from babel-plugin-react-intl.

bartvde avatar bartvde commented on May 21, 2024

Some of the source files are under the root dir of the app (sdk-apps/tabbed/), others are in sdk-apps/tabbed/node_modules/boundless-sdk/js/components/ (those are the ones causing the issue. I've stepped through that code block before but will do it again.

from babel-plugin-react-intl.

ericf avatar ericf commented on May 21, 2024

I've never tried to compile code in node_modules with Babel and this plugin, so it's likely something with that which is different. Are you using Webpack or something to run Babel on dependencies?

from babel-plugin-react-intl.

bartvde avatar bartvde commented on May 21, 2024

Here is the output from my logging:

 filename: /Users/bartvandeneijnden/opengeo/git/sdk-apps/tabbed/app.jsx
p.relative(process.cwd(), filename): app.jsx
p.dirname(p.relative(process.cwd(), filename)): .
filename: /Users/bartvandeneijnden/opengeo/git/sdk/js/components/Geocoding.jsx
p.relative(process.cwd(), filename): ../../sdk/js/components/Geocoding.jsx
p.dirname(p.relative(process.cwd(), filename)): ../../sdk/js/components
filename: /Users/bartvandeneijnden/opengeo/git/sdk/js/components/FeatureTable.jsx
p.relative(process.cwd(), filename): ../../sdk/js/components/FeatureTable.jsx
p.dirname(p.relative(process.cwd(), filename)): ../../sdk/js/components
filename: /Users/bartvandeneijnden/opengeo/git/sdk/js/components/GeocodingResults.jsx
p.relative(process.cwd(), filename): ../../sdk/js/components/GeocodingResults.jsx
p.dirname(p.relative(process.cwd(), filename)): ../../sdk/js/components
filename: /Users/bartvandeneijnden/opengeo/git/sdk/js/components/QueryBuilder.jsx
p.relative(process.cwd(), filename): ../../sdk/js/components/QueryBuilder.jsx
p.dirname(p.relative(process.cwd(), filename)): ../../sdk/js/components
filename: /Users/bartvandeneijnden/opengeo/git/sdk/js/components/Select.jsx
p.relative(process.cwd(), filename): ../../sdk/js/components/Select.jsx
p.dirname(p.relative(process.cwd(), filename)): ../../sdk/js/components
filename: /Users/bartvandeneijnden/opengeo/git/sdk/js/components/Measure.jsx
p.relative(process.cwd(), filename): ../../sdk/js/components/Measure.jsx
p.dirname(p.relative(process.cwd(), filename)): ../../sdk/js/components
filename: /Users/bartvandeneijnden/opengeo/git/sdk/js/components/Chart.jsx
p.relative(process.cwd(), filename): ../../sdk/js/components/Chart.jsx
p.dirname(p.relative(process.cwd(), filename)): ../../sdk/js/components
filename: /Users/bartvandeneijnden/opengeo/git/sdk/js/components/Geolocation.jsx
p.relative(process.cwd(), filename): ../../sdk/js/components/Geolocation.jsx
p.dirname(p.relative(process.cwd(), filename)): ../../sdk/js/components
filename: /Users/bartvandeneijnden/opengeo/git/sdk/js/components/ImageExport.jsx
p.relative(process.cwd(), filename): ../../sdk/js/components/ImageExport.jsx
p.dirname(p.relative(process.cwd(), filename)): ../../sdk/js/components
filename: /Users/bartvandeneijnden/opengeo/git/sdk/js/components/QGISLegend.jsx
p.relative(process.cwd(), filename): ../../sdk/js/components/QGISLegend.jsx
p.dirname(p.relative(process.cwd(), filename)): ../../sdk/js/components
filename: /Users/bartvandeneijnden/opengeo/git/sdk/js/components/QGISPrint.jsx
p.relative(process.cwd(), filename): ../../sdk/js/components/QGISPrint.jsx
p.dirname(p.relative(process.cwd(), filename)): ../../sdk/js/components
filename: /Users/bartvandeneijnden/opengeo/git/sdk/js/components/AddLayer.jsx
p.relative(process.cwd(), filename): ../../sdk/js/components/AddLayer.jsx
p.dirname(p.relative(process.cwd(), filename)): ../../sdk/js/components
filename: /Users/bartvandeneijnden/opengeo/git/sdk/js/components/HomeButton.jsx
p.relative(process.cwd(), filename): ../../sdk/js/components/HomeButton.jsx
p.dirname(p.relative(process.cwd(), filename)): ../../sdk/js/components
filename: /Users/bartvandeneijnden/opengeo/git/sdk/js/components/LayerListItem.jsx
p.relative(process.cwd(), filename): ../../sdk/js/components/LayerListItem.jsx
p.dirname(p.relative(process.cwd(), filename)): ../../sdk/js/components

from babel-plugin-react-intl.

bartvde avatar bartvde commented on May 21, 2024

I'm using browserify with this transform:

  "browserify": {
    "transform": [
      "cssify",
      "babelify"
    ]
  }

and this is my .babel.rc:

{
  "plugins": ["react-intl"],
  "extra": {
    "react-intl": {
        "messagesDir": "./build/messages/",
        "enforceDescriptions": true
    }
  }
}

from babel-plugin-react-intl.

bartvde avatar bartvde commented on May 21, 2024

This is a directory listing of the app's node modules:

Barts-MacBook-Air:tabbed bartvandeneijnden$ ls -l node_modules/
total 24
drwxr-xr-x  10 bartvandeneijnden  staff  340 Dec  4 09:33 babel-plugin-react-intl
drwxr-xr-x   9 bartvandeneijnden  staff  306 Dec  3 14:56 babelify
lrwxr-xr-x   1 bartvandeneijnden  staff   71 Dec  3 15:05 boundless-sdk -> ../../../../../.nvm/versions/node/v4.2.2/lib/node_modules/boundless-sdk
drwxr-xr-x  13 bartvandeneijnden  staff  442 Dec  3 14:57 browserify
drwxr-xr-x   9 bartvandeneijnden  staff  306 Dec  3 14:56 cssify
drwxr-xr-x  10 bartvandeneijnden  staff  340 Dec  3 14:56 envify
drwxr-xr-x  10 bartvandeneijnden  staff  340 Dec  3 14:56 minifyify
lrwxr-xr-x   1 bartvandeneijnden  staff   68 Dec  3 16:34 openlayers -> ../../../../../.nvm/versions/node/v4.2.2/lib/node_modules/openlayers
drwxr-xr-x   7 bartvandeneijnden  staff  238 Dec  3 14:56 pui-react-buttons
drwxr-xr-x   8 bartvandeneijnden  staff  272 Dec  3 14:56 pui-react-tabs
lrwxr-xr-x   1 bartvandeneijnden  staff   63 Dec  3 15:05 react -> ../../../../../.nvm/versions/node/v4.2.2/lib/node_modules/react
drwxr-xr-x   9 bartvandeneijnden  staff  306 Dec  3 14:56 react-dom
drwxr-xr-x  10 bartvandeneijnden  staff  340 Dec  3 14:57 react-intl
drwxr-xr-x   6 bartvandeneijnden  staff  204 Dec  4 09:05 sdk-debug-server
drwxr-xr-x   9 bartvandeneijnden  staff  306 Dec  3 14:56 through
drwxr-xr-x  12 bartvandeneijnden  staff  408 Dec  3 14:56 watchify

The symbolic links are because of the usage of npm link

When I don't use a link, all is fine. However, I need to use a link so I can edit the boundless-sdk node module from the app during development.

from babel-plugin-react-intl.

ericf avatar ericf commented on May 21, 2024

If you can edit the plugin code locally to get it to work within your setup, feel free to send a PR. When I get a chance I'll try to setup a simple project to reproduce that uses symlinks to see if I can reproduce.

from babel-plugin-react-intl.

ericf avatar ericf commented on May 21, 2024

This should now be fixed with the changes from #32

from babel-plugin-react-intl.

bartvde avatar bartvde commented on May 21, 2024

thanks!

from babel-plugin-react-intl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.