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

Build Process Documentation #63

Closed
samdeane opened this issue Feb 5, 2020 · 6 comments · Fixed by #64
Closed

Build Process Documentation #63

samdeane opened this issue Feb 5, 2020 · 6 comments · Fixed by #64

Comments

@samdeane
Copy link

samdeane commented Feb 5, 2020

Could you document the build process a bit?

I'm trying to tweak the formatting, but am not sure how to recreate dist/index.js (js/ts is a bit out of my comfort zone).

When I do npm run build I'm getting errors:

~/Projects/slatify> npm run build                                                                                          (master)

> [email protected] build /Users/developer/Projects/slatify
> ncc build src/index.ts

ncc: Version 0.20.5
ncc: Compiling file index.js
ncc: Using [email protected] (local user-provided)
Error: [tsl] ERROR in /Users/developer/Projects/slatify/src/slack.ts(91,41)
      TS2339: Property 'repos' does not exist on type 'GitHub'.
    at evalmachine.<anonymous>:1:1483065
    at eval (eval at create (evalmachine.<anonymous>:1:273347), <anonymous>:13:1)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

I guess I've got a bad dependency or the wrong version of @actions/github?

@homoluctus
Copy link
Member

homoluctus commented Feb 7, 2020

@samdeane

Have you installed dependencies not only devDependencies ?

The build procedure ↓

1. Install dependencies

npm install

2. Compile

npm run build

Output example

> [email protected] build /Projects/slatify
> ncc build src/index.ts

ncc: Version 0.20.5
ncc: Compiling file index.js
ncc: Using [email protected] (local user-provided)
523kB  dist/index.js
523kB  [2585ms] - ncc 0.20.5

@samdeane
Copy link
Author

samdeane commented Feb 7, 2020

Thanks for getting back to me!

I have indeed run npm install first.

I tried to reset everything as much as possible, including removing the lock file, and here's what I get:

~/Projects/slatify> rm package-lock.json && rm -rf node_modules &&  npm install && npm run build                           (master)
npm WARN deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated [email protected]: use String.prototype.padStart()

> [email protected] install /Users/developer/Projects/slatify/node_modules/fsevents
> node-gyp rebuild

  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
  SOLINK_MODULE(target) Release/fse.node
npm notice created a lockfile as package-lock.json. You should commit this file.
added 616 packages from 467 contributors and audited 897236 packages in 12.706s
found 0 vulnerabilities


> [email protected] build /Users/developer/Projects/slatify
> ncc build src/index.ts

ncc: Version 0.20.5
ncc: Compiling file index.js
ncc: Using [email protected] (local user-provided)
Error: [tsl] ERROR in /Users/developer/Projects/slatify/src/slack.ts(95,41)
      TS2339: Property 'repos' does not exist on type 'GitHub'.
    at evalmachine.<anonymous>:1:1483065
    at eval (eval at create (evalmachine.<anonymous>:1:273347), <anonymous>:13:1)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `ncc build src/index.ts`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/developer/.npm/_logs/2020-02-07T10_27_36_828Z-debug.log

Is it possible that I've picked up too new a version of one of the dependencies? Should you maybe check in your lock file?

@homoluctus
Copy link
Member

@samdeane

I ran the same command and got the same result.
The reason for failure is written here.

I'll fix this bug.

Thanks for the great feedback.

@homoluctus
Copy link
Member

I fixed this bug.
Now you can build.

@samdeane
Copy link
Author

samdeane commented Feb 7, 2020

I can confirm it's working for me now.
Thanks!

  1. Install dependencies

npm install
2. Compile

npm run build

Might be worth adding that to the Contribute section of the read me?

@homoluctus
Copy link
Member

OK, I'll add build process to the Contribution section.
Thanks @samdeane .

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