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

ci: add initial CI workflow #2

Merged
merged 2 commits into from
Sep 6, 2023
Merged

ci: add initial CI workflow #2

merged 2 commits into from
Sep 6, 2023

Conversation

rainx
Copy link
Contributor

@rainx rainx commented Sep 5, 2023

Create CI for the following tasks

  • Lint
  • Test
  • Build
  • Publish

tsconfig.build.json

I created a separate tsconfig.build.json file for the build job cause the tsconfig.json needs to be used for ESLint and will include more files than the build task (like ./tests files)

package.json files option

Change from ./dist to dist, ref: #2 (comment)

Remove source map files

source-map files are usually not in the NPM package.

@rainx rainx force-pushed the feature/add-basic-ci branch 5 times, most recently from 1f73cb7 to d0483a3 Compare September 5, 2023 15:22
@rainx
Copy link
Contributor Author

rainx commented Sep 6, 2023

@frantic1048 确认,
pnpm publish 对 files 格式的解析和 npm publish 不同,会导致之前遇到的只打包了 index.js 文件的问题

我试了一下在 feature/add-basic-ci 分支跑 pnpm run build ,然后分别用 pnpm pack 和 npm pack 打包
pnpm pack: dist 目录只包含了 dist/index.js
npm pack : dist 目录包含了 phpdoc-parser 目录,以及 d.ts 和 sourcemap 等内容
看到比较相关的 issue
pnpm/pnpm#6997
pnpm/pnpm#4452


我调整了一下 files 的配置,发现 pnpm pack 也能包含和 npm 同样的 dist 目录内容了
只有 index.js :files: [ './dist/' ]

包含完整的 dist 目录:
files: [ 'dist/' ]
files: [ 'dist' ]
files: [ '/dist' ]
files: [ 'dist/*' ]

@rainx rainx merged commit e6fa037 into main Sep 6, 2023
1 check passed
@rainx rainx deleted the feature/add-basic-ci branch September 6, 2023 12:39
rainx added a commit that referenced this pull request Sep 6, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants