react-native-qrcode-svg 6.3.2 → 6.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Example/.bundle/config +2 -0
- package/Example/.eslintrc.js +4 -0
- package/Example/.prettierrc.js +7 -0
- package/Example/.watchmanconfig +1 -0
- package/Example/Gemfile +9 -0
- package/Example/Gemfile.lock +103 -0
- package/Example/README.md +48 -0
- package/Example/__tests__/App.test.tsx +17 -0
- package/Example/android/app/build.gradle +119 -0
- package/Example/android/app/debug.keystore +0 -0
- package/Example/android/app/proguard-rules.pro +10 -0
- package/Example/android/app/src/debug/AndroidManifest.xml +9 -0
- package/Example/android/app/src/main/AndroidManifest.xml +25 -0
- package/Example/android/app/src/main/java/com/example/MainActivity.kt +22 -0
- package/Example/android/app/src/main/java/com/example/MainApplication.kt +45 -0
- package/Example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
- package/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/Example/android/app/src/main/res/values/strings.xml +3 -0
- package/Example/android/app/src/main/res/values/styles.xml +9 -0
- package/Example/android/build.gradle +21 -0
- package/Example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/Example/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/Example/android/gradle.properties +41 -0
- package/Example/android/gradlew +249 -0
- package/Example/android/gradlew.bat +92 -0
- package/Example/android/settings.gradle +4 -0
- package/Example/app.json +4 -0
- package/Example/babel.config.js +4 -0
- package/Example/dist/index.html +24 -0
- package/Example/global.d.ts +7 -0
- package/Example/index.js +14 -0
- package/Example/ios/.xcode.env +11 -0
- package/Example/ios/Example/AppDelegate.h +6 -0
- package/Example/ios/Example/AppDelegate.mm +31 -0
- package/Example/ios/Example/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/Example/ios/Example/Images.xcassets/Contents.json +6 -0
- package/Example/ios/Example/Info.plist +52 -0
- package/Example/ios/Example/LaunchScreen.storyboard +47 -0
- package/Example/ios/Example/main.m +10 -0
- package/Example/ios/Example.xcodeproj/project.pbxproj +698 -0
- package/Example/ios/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme +88 -0
- package/Example/ios/Example.xcworkspace/contents.xcworkspacedata +10 -0
- package/Example/ios/ExampleTests/ExampleTests.m +66 -0
- package/Example/ios/ExampleTests/Info.plist +24 -0
- package/Example/ios/Podfile +55 -0
- package/Example/ios/Podfile.lock +1378 -0
- package/Example/jest.config.js +3 -0
- package/Example/macos/.xcode.env +1 -0
- package/Example/macos/.xcode.env.local +2 -0
- package/Example/macos/Example-macOS/AppDelegate.h +6 -0
- package/Example/macos/Example-macOS/AppDelegate.mm +40 -0
- package/Example/macos/Example-macOS/Assets.xcassets/AppIcon.appiconset/Contents.json +58 -0
- package/Example/macos/Example-macOS/Assets.xcassets/Contents.json +6 -0
- package/Example/macos/Example-macOS/Base.lproj/Main.storyboard +684 -0
- package/Example/macos/Example-macOS/Example.entitlements +12 -0
- package/Example/macos/Example-macOS/Info.plist +47 -0
- package/Example/macos/Example-macOS/main.m +5 -0
- package/Example/macos/Example.xcodeproj/project.pbxproj +567 -0
- package/Example/macos/Example.xcodeproj/xcshareddata/xcschemes/Example-macOS.xcscheme +78 -0
- package/Example/macos/Example.xcworkspace/contents.xcworkspacedata +10 -0
- package/Example/macos/Podfile +26 -0
- package/Example/macos/Podfile.lock +1233 -0
- package/Example/metro.config.js +47 -0
- package/Example/package.json +53 -0
- package/Example/src/App.tsx +130 -0
- package/Example/src/assets/google.png +0 -0
- package/Example/src/assets/ruby.svg +12 -0
- package/Example/src/components/Description.tsx +16 -0
- package/Example/src/styles.ts +21 -0
- package/Example/tsconfig.json +9 -0
- package/Example/webpack.config.js +60 -0
- package/Example/yarn.lock +8957 -0
- package/README.md +0 -6
- package/index.d.ts +10 -2
- package/package.json +11 -2
- package/src/LogoSVG/index.js +22 -0
- package/src/LogoSVG/index.native.js +24 -0
- package/src/index.js +158 -125
- package/src/utils.js +7 -0
- package/.github/workflows/npmpublish.yml +0 -31
- package/.huskyrc +0 -5
- package/.lintstagedrc +0 -3
package/README.md
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import type {ImageSourcePropType} from "react-native";
|
|
3
|
+
import type {SvgProps} from "react-native-svg";
|
|
3
4
|
|
|
4
5
|
declare class QRCode extends React.PureComponent<QRCodeProps, any> {}
|
|
5
6
|
|
|
@@ -12,13 +13,20 @@ export interface QRCodeProps {
|
|
|
12
13
|
color?: string;
|
|
13
14
|
/* the color of the background */
|
|
14
15
|
backgroundColor?: string;
|
|
16
|
+
/* SVG to render as logo.
|
|
17
|
+
* Can be either a svg string or a React component if you're using ex: '@svgr/webpack' or similar
|
|
18
|
+
* In case both this prop and `logo` are provided, then this prop takes precedence and `logo` will be ignored. */
|
|
19
|
+
logoSVG?: React.FC<SvgProps> | string;
|
|
15
20
|
/* an image source object. example {uri: 'base64string'} or {require('pathToImage')} */
|
|
16
|
-
logo?: ImageSourcePropType;
|
|
21
|
+
logo?: ImageSourcePropType | string;
|
|
17
22
|
/* logo size in pixels */
|
|
18
23
|
logoSize?: number;
|
|
19
24
|
/* the logo gets a filled rectangular background with this color. Use 'transparent'
|
|
20
25
|
if your logo already has its own backdrop. Default = same as backgroundColor */
|
|
21
26
|
logoBackgroundColor?: string;
|
|
27
|
+
/* If the logo is provided via `logoSVG` prop, this color will be set as it's `fill` property,
|
|
28
|
+
* otherwise it does nothing */
|
|
29
|
+
logoColor?: string;
|
|
22
30
|
/* logo's distance to its wrapper */
|
|
23
31
|
logoMargin?: number;
|
|
24
32
|
/* the border-radius of logo image */
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-qrcode-svg",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.11",
|
|
4
4
|
"description": "A QR Code generator for React Native based on react-native-svg and javascript-qrcode.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"
|
|
8
|
+
"prepack": "rm -rf example",
|
|
9
9
|
"test": "jest",
|
|
10
10
|
"test:update": "npm run test -- --updateSnapshot",
|
|
11
11
|
"lint": "standard 'src/**/*.js'",
|
|
@@ -30,6 +30,14 @@
|
|
|
30
30
|
"type": "git",
|
|
31
31
|
"url": "git+ssh://git@github.com/awesomejerry/react-native-qrcode-svg.git"
|
|
32
32
|
},
|
|
33
|
+
"files": [
|
|
34
|
+
"Example",
|
|
35
|
+
"screenshot",
|
|
36
|
+
"src",
|
|
37
|
+
"babel.config.js",
|
|
38
|
+
"index.d.ts",
|
|
39
|
+
"index.js"
|
|
40
|
+
],
|
|
33
41
|
"keywords": [
|
|
34
42
|
"react-native",
|
|
35
43
|
"qrcode",
|
|
@@ -52,6 +60,7 @@
|
|
|
52
60
|
"text-encoding": "^0.7.0"
|
|
53
61
|
},
|
|
54
62
|
"devDependencies": {
|
|
63
|
+
"@types/react": "^18.2.75",
|
|
55
64
|
"babel-eslint": "^10.1.0",
|
|
56
65
|
"babel-jest": "^27.4.2",
|
|
57
66
|
"husky": "^7.0.4",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Image } from "react-native-svg";
|
|
3
|
+
import { isString, isUrlString } from "../utils";
|
|
4
|
+
|
|
5
|
+
const LogoSVG = ({ svg, logoSize, logoColor }) => {
|
|
6
|
+
if (isString(svg)) {
|
|
7
|
+
const href = isUrlString(svg)
|
|
8
|
+
? svg
|
|
9
|
+
: `data:image/svg+xml;base64,${window.btoa(svg)}`;
|
|
10
|
+
|
|
11
|
+
return <Image href={encodeURI(href)} width={logoSize} height={logoSize} />;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// if `svg` prop is actually a svg asset wrapped in a React component, then we can just render it
|
|
15
|
+
const LogoSVGComponent = svg;
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<LogoSVGComponent fill={logoColor} width={logoSize} height={logoSize} />
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default LogoSVG;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LocalSvg } from "react-native-svg/css";
|
|
3
|
+
import { SvgUri, SvgXml } from "react-native-svg";
|
|
4
|
+
import { isString, isUrlString } from "../utils";
|
|
5
|
+
|
|
6
|
+
const LogoSVG = ({ svg, logoSize, logoColor }) => {
|
|
7
|
+
if (isString(svg)) {
|
|
8
|
+
if (isUrlString(svg)) {
|
|
9
|
+
return (
|
|
10
|
+
<SvgUri uri={svg} fill={logoColor} width={logoSize} height={logoSize} />
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<SvgXml xml={svg} fill={logoColor} width={logoSize} height={logoSize} />
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<LocalSvg asset={svg} fill={logoColor} width={logoSize} height={logoSize} />
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default LogoSVG;
|
package/src/index.js
CHANGED
|
@@ -1,150 +1,183 @@
|
|
|
1
|
-
global.TextEncoder = require(
|
|
1
|
+
global.TextEncoder = require("text-encoding").TextEncoder;
|
|
2
2
|
|
|
3
|
-
import React, { useMemo } from
|
|
4
|
-
import Svg, {
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import React, { useMemo } from "react";
|
|
4
|
+
import Svg, {
|
|
5
|
+
Defs,
|
|
6
|
+
G,
|
|
7
|
+
Path,
|
|
8
|
+
Rect,
|
|
9
|
+
Image,
|
|
10
|
+
ClipPath,
|
|
11
|
+
LinearGradient,
|
|
12
|
+
Stop,
|
|
13
|
+
} from "react-native-svg";
|
|
14
|
+
import genMatrix from "./genMatrix";
|
|
15
|
+
import transformMatrixIntoPath from "./transformMatrixIntoPath";
|
|
16
|
+
import LogoSVG from "./LogoSVG";
|
|
7
17
|
|
|
8
18
|
const renderLogo = ({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
size,
|
|
20
|
+
backgroundColor,
|
|
21
|
+
logo,
|
|
22
|
+
logoSVG,
|
|
23
|
+
logoSize,
|
|
24
|
+
logoBackgroundColor,
|
|
25
|
+
logoColor,
|
|
26
|
+
logoMargin,
|
|
27
|
+
logoBorderRadius,
|
|
15
28
|
}) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
29
|
+
const logoPosition = (size - logoSize - logoMargin * 2) / 2;
|
|
30
|
+
const logoBackgroundSize = logoSize + logoMargin * 2;
|
|
31
|
+
const logoBackgroundBorderRadius =
|
|
32
|
+
logoBorderRadius + (logoMargin / logoSize) * logoBorderRadius;
|
|
20
33
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
34
|
+
return (
|
|
35
|
+
<G x={logoPosition} y={logoPosition}>
|
|
36
|
+
<Defs>
|
|
37
|
+
<ClipPath id="clip-logo-background">
|
|
38
|
+
<Rect
|
|
39
|
+
width={logoBackgroundSize}
|
|
40
|
+
height={logoBackgroundSize}
|
|
41
|
+
rx={logoBackgroundBorderRadius}
|
|
42
|
+
ry={logoBackgroundBorderRadius}
|
|
43
|
+
/>
|
|
44
|
+
</ClipPath>
|
|
45
|
+
<ClipPath id="clip-logo">
|
|
46
|
+
<Rect
|
|
47
|
+
width={logoSize}
|
|
48
|
+
height={logoSize}
|
|
49
|
+
rx={logoBorderRadius}
|
|
50
|
+
ry={logoBorderRadius}
|
|
51
|
+
/>
|
|
52
|
+
</ClipPath>
|
|
53
|
+
</Defs>
|
|
54
|
+
<G>
|
|
55
|
+
<Rect
|
|
56
|
+
width={logoBackgroundSize}
|
|
57
|
+
height={logoBackgroundSize}
|
|
58
|
+
fill={backgroundColor}
|
|
59
|
+
clipPath="url(#clip-logo-background)"
|
|
60
|
+
/>
|
|
61
|
+
</G>
|
|
62
|
+
<G x={logoMargin} y={logoMargin} clipPath="url(#clip-logo)">
|
|
63
|
+
<Rect
|
|
64
|
+
width={logoBackgroundSize - logoMargin}
|
|
65
|
+
height={logoBackgroundSize - logoMargin}
|
|
66
|
+
fill={logoBackgroundColor}
|
|
67
|
+
/>
|
|
68
|
+
{logoSVG ? (
|
|
69
|
+
<LogoSVG svg={logoSVG} logoSize={logoSize} logoColor={logoColor} />
|
|
70
|
+
) : (
|
|
71
|
+
<Image
|
|
72
|
+
width={logoSize}
|
|
73
|
+
height={logoSize}
|
|
74
|
+
preserveAspectRatio="xMidYMid slice"
|
|
75
|
+
href={logo}
|
|
76
|
+
clipPath="url(#clip-logo)"
|
|
77
|
+
/>
|
|
78
|
+
)}
|
|
79
|
+
</G>
|
|
80
|
+
</G>
|
|
81
|
+
);
|
|
60
82
|
};
|
|
61
83
|
|
|
62
84
|
const QRCode = ({
|
|
63
|
-
value =
|
|
85
|
+
value = "this is a QR code",
|
|
64
86
|
size = 100,
|
|
65
|
-
color =
|
|
66
|
-
backgroundColor =
|
|
87
|
+
color = "black",
|
|
88
|
+
backgroundColor = "white",
|
|
67
89
|
logo,
|
|
90
|
+
logoSVG,
|
|
68
91
|
logoSize = size * 0.2,
|
|
69
|
-
logoBackgroundColor =
|
|
92
|
+
logoBackgroundColor = "transparent",
|
|
93
|
+
logoColor,
|
|
70
94
|
logoMargin = 2,
|
|
71
95
|
logoBorderRadius = 0,
|
|
72
96
|
quietZone = 0,
|
|
73
97
|
enableLinearGradient = false,
|
|
74
|
-
gradientDirection = [
|
|
75
|
-
linearGradient = [
|
|
76
|
-
ecl =
|
|
98
|
+
gradientDirection = ["0%", "0%", "100%", "100%"],
|
|
99
|
+
linearGradient = ["rgb(255,0,0)", "rgb(0,255,255)"],
|
|
100
|
+
ecl = "M",
|
|
77
101
|
getRef,
|
|
78
102
|
onError,
|
|
79
|
-
testID
|
|
103
|
+
testID,
|
|
80
104
|
}) => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
}, [value, size, ecl]);
|
|
93
|
-
|
|
94
|
-
if (!result) {
|
|
95
|
-
return null;
|
|
105
|
+
const result = useMemo(() => {
|
|
106
|
+
try {
|
|
107
|
+
return transformMatrixIntoPath(genMatrix(value, ecl), size);
|
|
108
|
+
} catch (error) {
|
|
109
|
+
if (onError && typeof onError === "function") {
|
|
110
|
+
onError(error);
|
|
111
|
+
} else {
|
|
112
|
+
// Pass the error when no handler presented
|
|
113
|
+
throw error;
|
|
114
|
+
}
|
|
96
115
|
}
|
|
116
|
+
}, [value, size, ecl]);
|
|
117
|
+
|
|
118
|
+
if (!result) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
97
121
|
|
|
98
|
-
|
|
122
|
+
const { path, cellSize } = result;
|
|
123
|
+
const displayLogo = logo || logoSVG;
|
|
99
124
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
125
|
+
return (
|
|
126
|
+
<Svg
|
|
127
|
+
testID={testID}
|
|
128
|
+
ref={getRef}
|
|
129
|
+
viewBox={[
|
|
130
|
+
-quietZone,
|
|
131
|
+
-quietZone,
|
|
132
|
+
size + quietZone * 2,
|
|
133
|
+
size + quietZone * 2,
|
|
134
|
+
].join(" ")}
|
|
135
|
+
width={size}
|
|
136
|
+
height={size}
|
|
137
|
+
>
|
|
138
|
+
<Defs>
|
|
139
|
+
<LinearGradient
|
|
140
|
+
id="grad"
|
|
141
|
+
x1={gradientDirection[0]}
|
|
142
|
+
y1={gradientDirection[1]}
|
|
143
|
+
x2={gradientDirection[2]}
|
|
144
|
+
y2={gradientDirection[3]}
|
|
107
145
|
>
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
logoMargin,
|
|
144
|
-
logoBorderRadius,
|
|
145
|
-
})}
|
|
146
|
-
</Svg>
|
|
147
|
-
);
|
|
146
|
+
<Stop offset="0" stopColor={linearGradient[0]} stopOpacity="1" />
|
|
147
|
+
<Stop offset="1" stopColor={linearGradient[1]} stopOpacity="1" />
|
|
148
|
+
</LinearGradient>
|
|
149
|
+
</Defs>
|
|
150
|
+
<G>
|
|
151
|
+
<Rect
|
|
152
|
+
x={-quietZone}
|
|
153
|
+
y={-quietZone}
|
|
154
|
+
width={size + quietZone * 2}
|
|
155
|
+
height={size + quietZone * 2}
|
|
156
|
+
fill={backgroundColor}
|
|
157
|
+
/>
|
|
158
|
+
</G>
|
|
159
|
+
<G>
|
|
160
|
+
<Path
|
|
161
|
+
d={path}
|
|
162
|
+
strokeLinecap="butt"
|
|
163
|
+
stroke={enableLinearGradient ? "url(#grad)" : color}
|
|
164
|
+
strokeWidth={cellSize}
|
|
165
|
+
/>
|
|
166
|
+
</G>
|
|
167
|
+
{displayLogo &&
|
|
168
|
+
renderLogo({
|
|
169
|
+
size,
|
|
170
|
+
backgroundColor,
|
|
171
|
+
logo,
|
|
172
|
+
logoSVG,
|
|
173
|
+
logoSize,
|
|
174
|
+
logoBackgroundColor,
|
|
175
|
+
logoColor,
|
|
176
|
+
logoMargin,
|
|
177
|
+
logoBorderRadius,
|
|
178
|
+
})}
|
|
179
|
+
</Svg>
|
|
180
|
+
);
|
|
148
181
|
};
|
|
149
182
|
|
|
150
183
|
export default QRCode;
|
package/src/utils.js
ADDED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
name: Node.js Package
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
build:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
steps:
|
|
12
|
-
- uses: actions/checkout@v1
|
|
13
|
-
- uses: actions/setup-node@v1
|
|
14
|
-
with:
|
|
15
|
-
node-version: 12
|
|
16
|
-
- run: npm ci
|
|
17
|
-
- run: npm test
|
|
18
|
-
|
|
19
|
-
publish-npm:
|
|
20
|
-
needs: build
|
|
21
|
-
runs-on: ubuntu-latest
|
|
22
|
-
steps:
|
|
23
|
-
- uses: actions/checkout@v1
|
|
24
|
-
- uses: actions/setup-node@v1
|
|
25
|
-
with:
|
|
26
|
-
node-version: 12
|
|
27
|
-
registry-url: https://registry.npmjs.org/
|
|
28
|
-
- run: npm ci
|
|
29
|
-
- run: npm publish
|
|
30
|
-
env:
|
|
31
|
-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
package/.huskyrc
DELETED
package/.lintstagedrc
DELETED