Skip to content

Conversation

@bajtos
Copy link
Member

@bajtos bajtos commented Oct 5, 2018

As a follow-up for #1803 and #1809, this pull request is removing remaining usages of dist-util package and marking the package as deprecated. My intention is to remove dist-util from loopback-next before 4.0 GA.

Checklist

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

@bajtos bajtos self-assigned this Oct 5, 2018
@bajtos bajtos requested a review from raymondfeng October 5, 2018 12:17
@bajtos bajtos force-pushed the deprecate-dist-util branch from 1f83065 to effc7c8 Compare October 5, 2018 12:22
@mightytyphoon
Copy link

mightytyphoon commented Oct 6, 2018

Hi, I come from : #1817
I think this broke the management of dist folders somehow. I could fix it but now tests are not working.
Here are my scripts in package.json

  "scripts": {
    "build:apidocs": "lb-apidocs",
    "build": "lb-tsc es2018",
    "build:watch": "lb-tsc es2018 --watch", //removed --outDir to deal with dist, dist10 or dist8 problems
    "clean": "lb-clean dist10", //lb-clean works
    "lint": "npm run prettier:check && npm run tslint",
    "lint:fix": "npm run tslint:fix && npm run prettier:fix",
    "prettier:cli": "lb-prettier \"**/*.ts\" \"**/*.js\"",
    "prettier:check": "npm run prettier:cli -- -l",
    "prettier:fix": "npm run prettier:cli -- --write",
    "tslint": "lb-tslint",
    "tslint:fix": "npm run tslint -- --fix",
    "pretest": "npm run clean && npm run build",
    "test": "lb-mocha --allow-console-logs \"dist10/test\"", //tests are launched but then error
    "posttest": "npm run lint",
    "test:dev": "lb-mocha --allow-console-logs dist/test/**/*.js && npm run posttest",
    "prestart": "start npm run build:watch",
    "start": "nodemon --watch dist10 dist8",
    "prepublishOnly": "npm run test"
  }

Edit : it does not work either with es2017 and dist8
full output :

D:\Work\playground\loopback-test\test>npm test

> test@1.0.0 pretest D:\Work\playground\loopback-test\test
> npm run clean && npm run build


> test@1.0.0 clean D:\Work\playground\loopback-test\test
> lb-clean dist10


> test@1.0.0 build D:\Work\playground\loopback-test\test
> lb-tsc es2018


> test@1.0.0 test D:\Work\playground\loopback-test\test
> lb-mocha --allow-console-logs "dist10/test"



  ..

  2 passing (125ms)


> test@1.0.0 posttest D:\Work\playground\loopback-test\test
> npm run lint


> test@1.0.0 lint D:\Work\playground\loopback-test\test
> npm run prettier:check && npm run tslint


> test@1.0.0 prettier:check D:\Work\playground\loopback-test\test
> npm run prettier:cli -- -l


> test@1.0.0 prettier:cli D:\Work\playground\loopback-test\test
> lb-prettier "**/*.ts" "**/*.js" "-l"

dist10\src\application.d.ts
dist10\src\controllers\home-page.controller.d.ts
dist10\src\controllers\ping.controller.d.ts
dist10\src\index.d.ts
dist10\src\sequence.d.ts
dist10\test\acceptance\test-helper.d.ts
src\controllers\home-page.controller.ts
dist10\index.js
dist10\src\application.js
dist10\src\controllers\home-page.controller.js
dist10\src\controllers\index.js
dist10\src\controllers\ping.controller.js
dist10\src\index.js
dist10\src\sequence.js
dist10\test\acceptance\home-page.controller.acceptance.js
dist10\test\acceptance\ping.controller.acceptance.js
dist10\test\acceptance\test-helper.js
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test@1.0.0 prettier:cli: `lb-prettier "**/*.ts" "**/*.js" "-l"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test@1.0.0 prettier:cli 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!     C:\Users\laurent\AppData\Roaming\npm-cache\_logs\2018-10-06T10_55_39_800Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test@1.0.0 prettier:check: `npm run prettier:cli -- -l`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test@1.0.0 prettier:check 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!     C:\Users\laurent\AppData\Roaming\npm-cache\_logs\2018-10-06T10_55_39_843Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test@1.0.0 lint: `npm run prettier:check && npm run tslint`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test@1.0.0 lint 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!     C:\Users\laurent\AppData\Roaming\npm-cache\_logs\2018-10-06T10_55_39_886Z-debug.log
npm ERR! Test failed.  See above for more details.

@raymondfeng
Copy link
Contributor

@mightytyphoon I don't this PR is the root cause as it has not been merged yet.

The issue is that some existing projects have left-over dist8 or dist10 folders before we switch a single dist mode. Now npm run clean does not remove such files and they may cause issues and confusions.

Try to run npx lerna run clean -- dist* to remove such left-over dirs.

@raymondfeng raymondfeng merged commit 91a343c into master Oct 6, 2018
@raymondfeng raymondfeng deleted the deprecate-dist-util branch October 6, 2018 20:03
@mightytyphoon
Copy link

@raymondfeng Hi, thanks for your answer, this was actually a problem with the 0.29.0 version, someone had the same problem here : #1817 but 0.30.0 is running well, tests also. So it's all good. There is just a warning at the end of the tests on a clean cli install :

no-unused-variable is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead.

But this deals with tslint apparently some infos there

Thank you for the support.

Regards.

@bajtos bajtos mentioned this pull request Oct 8, 2018
1 task
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 this pull request may close these issues.

4 participants