Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--outdir file path not reflected in package.json #40

Closed
2 tasks done
juliexiong opened this issue Jun 24, 2021 · 6 comments · Fixed by #41
Closed
2 tasks done

--outdir file path not reflected in package.json #40

juliexiong opened this issue Jun 24, 2021 · 6 comments · Fixed by #41

Comments

@juliexiong
Copy link

juliexiong commented Jun 24, 2021

Checklist

  • Did you run the analyzer with the --dev flag to get more information?
  • Did you create a minimal reproduction in the playground?

Bug
I set the output directory for my manifest file to /dist/, but it is not reflected in package.json after running cem analyze script.

Expected behavior
I expect that if I set --outdir to dist in the script, --outdir will be reflected in package.json:

Command:

cem analyze --globs src/foo-*.ts --litelement --outdir dist

package.json:

{
  "name": "foo-button",
  "customElements": "dist/custom-elements.json"
}
@thepassle
Copy link
Member

Ugh, sorry about that. I had the feeling I'd forgotten something. Should be fixed in 0.3.4, thanks for reporting!

@juliexiong
Copy link
Author

Ugh, sorry about that. I had the feeling I'd forgotten something. Should be fixed in 0.3.4, thanks for reporting!

Haha, no worries. Greatly appreciate how fast you address issues!

Unfortunately, this fix is outputting the path as "customElements": "dist\\custom-elements.json" instead of "customElements": "dist/custom-elements.json"

@thepassle
Copy link
Member

Thats weird, which command are you running and which OS are you on?

I just call path.join on whatever the outdir is and 'custom-elements.json'

@juliexiong
Copy link
Author

juliexiong commented Jun 24, 2021

Yeah, I was looking at the changes you made and it shouldn't have affected the output. Strange.

I'm on Windows 10 Enterprise, and running the command via a node script in my package.json:

package.json:

{
  "devDependencies": {
    "@custom-elements-manifest/analyzer": "^0.3.4"
  },
  "scripts": {
    "analyze": "cem analyze --globs src/zui-*.ts --litelement --outdir dist"
  }
}

Command I run:

yarn run analyze

Output in package.json after running script:

{
  "devDependencies": {
    "@custom-elements-manifest/analyzer": "^0.3.4"
  },
  "scripts": {
    "analyze": "cem analyze --globs src/zui-*.ts --litelement --outdir dist"
  },
  "customElements": "dist\\custom-elements.json"
}

Must be a Windows thing?

@thepassle
Copy link
Member

Hm, looks like I might have to path.normalize() the path, which turns it into dist\custom-elements.json, which would be the expected path for windows right?

Also, does the actual json file get output to the dist folder correctly?

@juliexiong
Copy link
Author

Yeah, that sounds right to me. And yep, custom-elements.json outputs into the dist folder as specified with --outdir dist!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants