aurelia / cli

The Aurelia 1 command line tool. Use the CLI to create projects, scaffold components, and bundle your app for release.
MIT License
407 stars 134 forks source link

Possible problems with packages that have a dot in their name #186

Closed ggrimbert closed 8 years ago

ggrimbert commented 8 years ago

Hi,

I am trying to use the Aurelia CLI on my project, but I'm having a problem.

I added aurelia-validatejs into the aurelia.json, and the aurelia-validate.js imports validate.js, but I can't make it works, I always have the following :

{ uid: 9,
  name: 'writeBundles',
  branch: false,
  error: 
   { [Error: ENOENT: no such file or directory, open '/home/ggrimbert/edevelo/local/Aurelia/toto/testWebApp/validate.js']
     errno: -2,
     code: 'ENOENT',
     syscall: 'open',
     path: '/home/ggrimbert/edevelo/local/Aurelia/toto/testWebApp/validate.js' },
  duration: [ 10, 146550430 ],
  time: 1466688527952 }
{ uid: 1,
  name: '<series>',
  branch: true,
  error: 
   { [Error: ENOENT: no such file or directory, open '/home/ggrimbert/edevelo/local/Aurelia/toto/testWebApp/validate.js']
     errno: -2,
     code: 'ENOENT',
     syscall: 'open',
     path: '/home/ggrimbert/edevelo/local/Aurelia/toto/testWebApp/validate.js' },
  duration: [ 26, 974138194 ],
  time: 1466688527955 }
{ uid: 0,
  name: '<series>',
  branch: true,
  error: 
   { [Error: ENOENT: no such file or directory, open '/home/ggrimbert/edevelo/local/Aurelia/toto/testWebApp/validate.js']
     errno: -2,
     code: 'ENOENT',
     syscall: 'open',
     path: '/home/ggrimbert/edevelo/local/Aurelia/toto/testWebApp/validate.js' },
  duration: [ 26, 975734468 ],
  time: 1466688527955 }
{ [Error: ENOENT: no such file or directory, open '/home/ggrimbert/edevelo/local/Aurelia/toto/testWebApp/validate.js']
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/home/ggrimbert/edevelo/local/Aurelia/toto/testWebApp/validate.js' }

I tried to import validate.js inside the aurelia.json, and have the following : Tracing validate.js...

is it possible that the problem comes from the name of the package itself ? I believe that the dot in the name is the main problem...

Here is the content of my aurelia.json :

{
  "name": "testWebApp",
  "type": "project:application",
  "platform": {
    "id": "default",
    "displayName": "Default",
    "output": "scripts"
  },
  "transpiler": {
    "id": "babel",
    "displayName": "Babel",
    "fileExtension": ".js",
    "options": {
      "plugins": [
        "transform-es2015-modules-amd"
      ]
    },
    "source": "src/**/*.js"
  },
  "markupProcessor": {
    "id": "none",
    "displayName": "None",
    "fileExtension": ".html",
    "source": "src/**/*.html"
  },
  "cssProcessor": {
    "id": "none",
    "displayName": "None",
    "fileExtension": ".css",
    "source": "src/**/*.css"
  },
  "editor": {
    "id": "vscode",
    "displayName": "Visual Studio Code"
  },
  "unitTestRunner": {
    "id": "karma",
    "displayName": "Karma",
    "source": "test/unit/**/*.js"
  },
  "paths": {
    "root": "src",
    "resources": "src/resources",
    "elements": "src/resources/elements",
    "attributes": "src/resources/attributes",
    "valueConverters": "src/resources/value-converters",
    "bindingBehaviors": "src/resources/binding-behaviors"
  },
  "testFramework": {
    "id": "jasmine",
    "displayName": "Jasmine"
  },
  "build": {
    "targets": [
      {
        "id": "default",
        "displayName": "Default",
        "output": "scripts"
      }
    ],
    "loader": {
      "type": "require",
      "configTarget": "vendor-bundle.js",
      "includeBundleMetadataInConfig": "auto",
      "plugins": [
        {
          "name": "text",
          "extensions": [
            ".html",
            ".css"
          ],
          "stub": true
        }
      ]
    },
    "options": {
      "minify": "stage & prod",
      "sourcemaps": "dev & stage"
    },
    "bundles": [
      {
        "name": "app-bundle.js",
        "source": [
          "[**/*.js]",
          "**/*.{css,html}"
        ]
      },
      {
        "name": "vendor-bundle.js",
        "prepend": [
          "node_modules/bluebird/js/browser/bluebird.core.js",
          "scripts/require.js"
        ],
        "dependencies": [
          "aurelia-binding",
          "aurelia-bootstrapper",
          "aurelia-dependency-injection",
          "aurelia-event-aggregator",
          "aurelia-framework",
          "aurelia-history",
          "aurelia-history-browser",
          "aurelia-loader",
          "aurelia-loader-default",
          "aurelia-logging",
          "aurelia-logging-console",
          "aurelia-metadata",
          "aurelia-pal",
          "aurelia-pal-browser",
          "aurelia-path",
          "aurelia-polyfills",
          "aurelia-route-recognizer",
          "aurelia-router",
          "aurelia-task-queue",
          "aurelia-templating",
          "aurelia-templating-binding",
          "validate.js",
          "whatwg-fetch",
          {
            "name": "text",
            "path": "../scripts/text"
          },
          "aurelia-validatejs",
          {
            "name": "aurelia-templating-resources",
            "path": "../node_modules/aurelia-templating-resources/dist/amd",
            "main": "aurelia-templating-resources"
          },
           {
            "name": "aurelia-validation",
            "path": "../node_modules/aurelia-validation/dist/amd",
            "main": "aurelia-validation"
          },
          {
            "name": "aurelia-templating-router",
            "path": "../node_modules/aurelia-templating-router/dist/amd",
            "main": "aurelia-templating-router"
          },
          {
            "name": "aurelia-testing",
            "path": "../node_modules/aurelia-testing/dist/amd",
            "main": "aurelia-testing",
            "env": "dev"
          }
        ]
      }
    ]
  }
}

I have also tried to import it like that, but it's not working :

{
            "name": "validate.js",
            "path": "../node_modules/validate.js/validate"
          },
dwarry commented 8 years ago

This worked in my dependencies:

          {
            "name": "aurelia-validation",
            "path": "../node_modules/aurelia-validation/dist/amd/",
            "main": "aurelia-validation"
          },
          {
            "name": "aurelia-validatejs",
            "path": "../node_modules/aurelia-validatejs/dist/amd/",
            "main": "aurelia-validatejs"
          },
          {
            "name": "validate.js",
            "path": "../node_modules/validate.js/",
            "main": "validate"
          }

[And by "worked", I mean "built without errors"]

ggrimbert commented 8 years ago

This seems to work, I don't understand why It doesn't worked yesterday because I've added the same as you.

Thanks