Skip to content

feat(typescript): add d.ts to pacakge.json#78

Merged
azu merged 3 commits intomasterfrom
dts-pacakge
Feb 20, 2017
Merged

feat(typescript): add d.ts to pacakge.json#78
azu merged 3 commits intomasterfrom
dts-pacakge

Conversation

@azu
Copy link
Copy Markdown
Member

@azu azu commented Feb 19, 2017

  • Add types field to pacakge.json
  • Add clean npm-run-script
  • Use cross-env for setting eviroment

fix #70

/cc @saneyuki

@azu azu force-pushed the dts-pacakge branch 2 times, most recently from 5cd2a2a to 4d4cb5f Compare February 19, 2017 10:49
Copy link
Copy Markdown
Contributor

@tetsuharuohzeki tetsuharuohzeki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I seem the current patch does not have a part to copying d.ts files from /__obj/ to /lib/.

This would not work types fields and the archive published into npm does not have any d.ts file.

package.json Outdated
"build:down_transform": "NODE_ENV=production babel __obj --out-dir lib --source-maps",
"watch": "babel src --out-dir lib --watch --source-maps",
"build:src": "npm-run-all -p build:tsc build:cp_obj",
"build:down_transform": "cross-env NODE_ENV=production babel __obj --out-dir lib --source-maps",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel we should sort script names by the order of breaking down a problem. So build -> build:src -> (build:tsc and build:cp_obj) -> build:down_transform

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed d3d01c7

@azu
Copy link
Copy Markdown
Member Author

azu commented Feb 20, 2017

I seem the current patch does not have a part to copying d.ts files from /__obj/ to /lib/.

ah, I've forget --copy-files options for babel.
I'll fix it.

@tetsuharuohzeki
Copy link
Copy Markdown
Contributor

--copy-files options for babel.

I don't know well about its option. Is it handle source map files correctly?
I'm worry that babel does not emit the source map __obj/ -> lib/ properly.

I feel it's more clear & robustness to use cpx to copy d.ts .

@azu
Copy link
Copy Markdown
Member Author

azu commented Feb 20, 2017

`--copy-files
Copy files that will not be compiled
-- https://babeljs.io/docs/usage/cli/

Compile files + Copy files that is not compiled.

@azu
Copy link
Copy Markdown
Member Author

azu commented Feb 20, 2017

I feel it's more clear & robustness to use cpx to copy d.ts .

ok.

@azu
Copy link
Copy Markdown
Member Author

azu commented Feb 20, 2017

done
almin 2017-02-20 17-32-20

I've refactor npm run-script

  • build:src:* : building script for src/
  • build:lib:* : building script fro lib/

Finally, npm run build does npm-run-all -s clean build:src build:lib.

@tetsuharuohzeki
Copy link
Copy Markdown
Contributor

looks good to me.

@azu azu merged commit 8fb02e1 into master Feb 20, 2017
@azu azu deleted the dts-pacakge branch February 20, 2017 08:46
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.

TypeScript: Add d.ts in npm

2 participants