Skip to content

Commit 8244a06

Browse files
committed
Error in scripts
1 parent 4b93eeb commit 8244a06

File tree

7 files changed

+50
-14
lines changed

7 files changed

+50
-14
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules/
1+
node_modules/
2+
*.log

packages/create-library-react/index.js

100644100755
File mode changed.

packages/react-library-scripts/index.js

100644100755
File mode changed.

packages/react-library-scripts/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@babel/plugin-proposal-class-properties": "^7.5.5",
1919
"@babel/plugin-transform-runtime": "^7.6.2",
2020
"@babel/preset-env": "^7.6.3",
21-
"@babel/preset-react": "^7.6.3"
21+
"@babel/preset-react": "^7.6.3",
22+
"babel-plugin-module-resolver": "^3.2.0"
2223
}
2324
}

packages/react-library-scripts/scripts/build.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ process.on("unhandledRejection", err => {
1717
const APP_PATH = resolverPath("src/lib");
1818
const BUILD_PATH = resolverPath("dist");
1919

20-
if (fs.existsSync(BUILD_PATH)) {
21-
deletePath(BUILD_PATH);
22-
}
23-
20+
deletePath(BUILD_PATH);
2421
fs.mkdirSync(BUILD_PATH);
2522
console.log(`Create directory:\t${BUILD_PATH}`);
2623

packages/react-library-scripts/utils/deletePath.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
"use strict";
22

33
const fs = require("fs");
4+
const path = require("path");
45

5-
const deletePath = path => {
6-
if (fs.existsSync(path)) {
7-
const files = fs.readdirSync(path);
6+
const deletePath = pathDelete => {
7+
if (fs.existsSync(pathDelete)) {
8+
const files = fs.readdirSync(pathDelete);
89

910
files.forEach(file => {
10-
const currentPath = path.join(path, file);
11+
const currentPath = path.join(pathDelete, file);
1112
if (fs.lstatSync(currentPath).isDirectory()) {
1213
deletePath(currentPath);
1314
} else {
1415
fs.unlinkSync(currentPath);
1516
}
1617
});
1718

18-
fs.rmdirSync(path);
19+
fs.rmdirSync(pathDelete);
1920
}
2021
};
2122

yarn.lock

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,6 +1778,17 @@ babel-plugin-dynamic-import-node@^2.3.0:
17781778
dependencies:
17791779
object.assign "^4.1.0"
17801780

1781+
babel-plugin-module-resolver@^3.2.0:
1782+
version "3.2.0"
1783+
resolved "https://registry.yarnpkg.com/babel-plugin-module-resolver/-/babel-plugin-module-resolver-3.2.0.tgz#ddfa5e301e3b9aa12d852a9979f18b37881ff5a7"
1784+
integrity sha512-tjR0GvSndzPew/Iayf4uICWZqjBwnlMWjSx6brryfQ81F9rxBVqwDJtFCV8oOs0+vJeefK9TmdZtkIFdFe1UnA==
1785+
dependencies:
1786+
find-babel-config "^1.1.0"
1787+
glob "^7.1.2"
1788+
pkg-up "^2.0.0"
1789+
reselect "^3.0.1"
1790+
resolve "^1.4.0"
1791+
17811792
balanced-match@^1.0.0:
17821793
version "1.0.0"
17831794
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
@@ -2686,6 +2697,14 @@ fill-range@^4.0.0:
26862697
repeat-string "^1.6.1"
26872698
to-regex-range "^2.1.0"
26882699

2700+
find-babel-config@^1.1.0:
2701+
version "1.2.0"
2702+
resolved "https://registry.yarnpkg.com/find-babel-config/-/find-babel-config-1.2.0.tgz#a9b7b317eb5b9860cda9d54740a8c8337a2283a2"
2703+
integrity sha512-jB2CHJeqy6a820ssiqwrKMeyC6nNdmrcgkKWJWmpoxpE8RKciYJXCcXRq1h2AzCo5I5BJeN2tkGEO3hLTuePRA==
2704+
dependencies:
2705+
json5 "^0.5.1"
2706+
path-exists "^3.0.0"
2707+
26892708
find-up@^1.0.0:
26902709
version "1.1.2"
26912710
resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f"
@@ -2694,7 +2713,7 @@ find-up@^1.0.0:
26942713
path-exists "^2.0.0"
26952714
pinkie-promise "^2.0.0"
26962715

2697-
find-up@^2.0.0:
2716+
find-up@^2.0.0, find-up@^2.1.0:
26982717
version "2.1.0"
26992718
resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7"
27002719
integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c=
@@ -2919,7 +2938,7 @@ glob-to-regexp@^0.3.0:
29192938
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab"
29202939
integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=
29212940

2922-
glob@^7.0.3, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4:
2941+
glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4:
29232942
version "7.1.5"
29242943
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.5.tgz#6714c69bee20f3c3e64c4dd905553e532b40cdc0"
29252944
integrity sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ==
@@ -3496,6 +3515,11 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1:
34963515
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
34973516
integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=
34983517

3518+
json5@^0.5.1:
3519+
version "0.5.1"
3520+
resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821"
3521+
integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=
3522+
34993523
json5@^2.1.0:
35003524
version "2.1.1"
35013525
resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.1.tgz#81b6cb04e9ba496f1c7005d07b4368a2638f90b6"
@@ -4454,6 +4478,13 @@ pkg-dir@^3.0.0:
44544478
dependencies:
44554479
find-up "^3.0.0"
44564480

4481+
pkg-up@^2.0.0:
4482+
version "2.0.0"
4483+
resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f"
4484+
integrity sha1-yBmscoBZpGHKscOImivjxJoATX8=
4485+
dependencies:
4486+
find-up "^2.1.0"
4487+
44574488
posix-character-classes@^0.1.0:
44584489
version "0.1.1"
44594490
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
@@ -4782,6 +4813,11 @@ require-main-filename@^2.0.0:
47824813
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"
47834814
integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==
47844815

4816+
reselect@^3.0.1:
4817+
version "3.0.1"
4818+
resolved "https://registry.yarnpkg.com/reselect/-/reselect-3.0.1.tgz#efdaa98ea7451324d092b2b2163a6a1d7a9a2147"
4819+
integrity sha1-79qpjqdFEyTQkrKyFjpqHXqaIUc=
4820+
47854821
resolve-cwd@^2.0.0:
47864822
version "2.0.0"
47874823
resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"
@@ -4804,7 +4840,7 @@ resolve-url@^0.2.1:
48044840
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
48054841
integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=
48064842

4807-
resolve@^1.10.0, resolve@^1.3.2, resolve@^1.8.1:
4843+
resolve@^1.10.0, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.8.1:
48084844
version "1.12.0"
48094845
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6"
48104846
integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==

0 commit comments

Comments
 (0)