CrossLead / slate-dts

Generated type definition files for the slate editor
9 stars 3 forks source link

Error while running the generation #3

Open JanLoebel opened 6 years ago

JanLoebel commented 6 years ago

Hi there, first of all thank you very much for your project and all the work :)

I've cloned the project and run: npm install and afterward npm run build. I will get the following errors (there are more for each project):

> slate-dts@0.0.1 build /Users/jan/Projects/slate-dts
> sh ./scripts/generate.sh

cloning latest version of slate...
generating typings for slate-auto-replace...
cp: ./.tmp/slate-auto-replace/dist-dts/: No such file or directory
./scripts/generate.sh: line 58: ./packages/slate-auto-replace/package.json: No such file or directory
assert.js:42
  throw new errors.AssertionError({
  ^

AssertionError [ERR_ASSERTION]: main does not exist: /Users/jan/Projects/slate-dts/packages/slate-auto-replace/index.d.ts
    at Object.bundle (/Users/jan/Projects/slate-dts/node_modules/dts-bundle/lib/index.js:79:9)
    at Object.<anonymous> (/Users/jan/Projects/slate-dts/scripts/dts-bundle.js:4:5)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
fs.js:646
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open './packages/slate-auto-replace/slate-auto-replace.d.ts'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at Object.<anonymous> (/Users/jan/Projects/slate-dts/scripts/definition-modifications.js:6:15)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
...done!
bsouthga commented 6 years ago

what operating system are you on and what shell are you using? I've only tested this on OSX (10.12.6) so far.

JanLoebel commented 6 years ago

OSX (10.13.4)

RXminuS commented 6 years ago

This seems to be because the rename command doesn't exist by default on MacOS (or any UNIX os) which causes no inputs to exist for the package (since it only looks for .ts files)

A simple brew install rename should fix it

RXminuS commented 6 years ago

On a sidenote. At the moment you pipe all the output to > /dev/null which makes debugging errors quite hard. Maybe we you should at least check the return code to see if it was successful or not