Skip to content

Commit 49c0b80

Browse files
author
Alexey Ryazanov
committed
fix: add files to publishing
1 parent 36a40aa commit 49c0b80

File tree

5 files changed

+38
-21
lines changed

5 files changed

+38
-21
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
run: npm run build
3939

4040
- name: Copy declaration files
41-
run: npm run copy-declaration-files
41+
run: npm run copy-release-files
4242

4343
- name: Release
4444
run: npm run release

.release-it.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"github": {
66
"release": true
77
},
8+
"npm": {
9+
"publishPath": "./build"
10+
},
811
"plugins": {
912
"@release-it/conventional-changelog": {
1013
"preset": "conventionalcommits",

package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"docs": "node ./generate/docs/index.js",
1212
"test": "jest --coverage",
1313
"test:ci": "npm run test -- --maxWorkers=50%",
14-
"copy-declaration-files": "node tools/copy-declaration-files.js"
14+
"copy-release-files": "node tools/copy-release-files.js"
1515
},
1616
"description": "Fast, small and purely functional utility library",
1717
"repository": "https://github.com/Tinkoff/utils.js",
@@ -24,13 +24,11 @@
2424
"curry",
2525
"performance"
2626
],
27-
"files": [
28-
"build",
29-
".npmignore",
30-
"CHANGELOG.md"
31-
],
3227
"sideEffects": false,
3328
"license": "Apache-2.0",
29+
"publishConfig": {
30+
"access": "public"
31+
},
3432
"devDependencies": {
3533
"@babel/cli": "^7.0.0",
3634
"@babel/core": "^7.0.0",

tools/copy-declaration-files.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

tools/copy-release-files.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const path = require('path');
2+
const fsExtra = require('fs-extra');
3+
const recursiveReadSync = require('recursive-readdir-sync');
4+
5+
const ROOT_PATH = path.join(__dirname, '..')
6+
const BUILD_PATH = path.join(ROOT_PATH, 'build')
7+
8+
const copyReleaseFiles = async () => {
9+
await Promise.all(
10+
recursiveReadSync(path.join(ROOT_PATH, 'ts_temp'))
11+
.filter(fileName => fileName.endsWith('.d.ts'))
12+
.map(fileName =>
13+
fsExtra.copy(
14+
fileName,
15+
fileName.replace('ts_temp', 'build')
16+
)
17+
)
18+
);
19+
20+
await Promise.all(
21+
['package.json', '.npmignore', 'README.md', 'LICENSE', 'CHANGELOG.md'].map(fileName =>
22+
fsExtra.copy(
23+
path.join(ROOT_PATH, fileName),
24+
path.join(BUILD_PATH, fileName)
25+
)
26+
)
27+
);
28+
}
29+
30+
copyReleaseFiles().then(() => {})

0 commit comments

Comments
 (0)