@sproutsocial/racine 11.2.4-linkupdate.0 → 11.2.5-sproutTheme-beta.1

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/__flow__/Button/index.stories.js +21 -6
  3. package/__flow__/ThemeProvider/index.js +1 -1
  4. package/__flow__/index.js +4 -0
  5. package/__flow__/themes/extendedThemes/sproutTheme/dark/colors.js +0 -0
  6. package/__flow__/themes/extendedThemes/sproutTheme/dark/theme.js +43 -0
  7. package/__flow__/themes/extendedThemes/sproutTheme/index.js +2 -0
  8. package/__flow__/themes/extendedThemes/sproutTheme/light/colors.js +0 -0
  9. package/__flow__/themes/extendedThemes/sproutTheme/light/theme.js +53 -0
  10. package/__flow__/themes/extendedThemes/sproutTheme/otherVals/theme.js +6 -0
  11. package/__flow__/types/theme.flow.js +2 -0
  12. package/commonjs/index.js +8 -1
  13. package/commonjs/themes/extendedThemes/sproutTheme/dark/colors.js +1 -0
  14. package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.js +48 -0
  15. package/commonjs/themes/extendedThemes/sproutTheme/index.js +14 -0
  16. package/commonjs/themes/extendedThemes/sproutTheme/light/colors.js +1 -0
  17. package/commonjs/themes/extendedThemes/sproutTheme/light/theme.js +58 -0
  18. package/commonjs/themes/extendedThemes/sproutTheme/otherVals/theme.js +9 -0
  19. package/lib/index.js +1 -0
  20. package/lib/themes/extendedThemes/sproutTheme/dark/colors.js +0 -0
  21. package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +40 -0
  22. package/lib/themes/extendedThemes/sproutTheme/index.js +2 -0
  23. package/lib/themes/extendedThemes/sproutTheme/light/colors.js +0 -0
  24. package/lib/themes/extendedThemes/sproutTheme/light/theme.js +50 -0
  25. package/lib/themes/extendedThemes/sproutTheme/otherVals/theme.js +5 -0
  26. package/package.json +2 -1
  27. package/bin/buildNpm.js +0 -58
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 11.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - a73cdfb: remove weird characters from props descriptions
8
+
3
9
  ## 11.2.4
4
10
 
5
11
  ### Patch Changes
@@ -3,6 +3,11 @@ import { boolean, text, number } from "@storybook/addon-knobs";
3
3
  import Button from "./index";
4
4
  import Icon from "../Icon";
5
5
  import Box from "../Box";
6
+ import ThemeProvider from "../ThemeProvider";
7
+ import {
8
+ sproutLightTheme,
9
+ sproutDarkTheme,
10
+ } from "../themes/extendedThemes/sproutTheme";
6
11
 
7
12
  export default {
8
13
  title: "Button",
@@ -22,12 +27,22 @@ defaultStory.story = {
22
27
  };
23
28
 
24
29
  export const primary = () => (
25
- <Button
26
- appearance={text("appearance", "primary")}
27
- onClick={() => alert("Testing...")}
28
- >
29
- Primary Button
30
- </Button>
30
+ <>
31
+ <Button
32
+ appearance={text("appearance", "primary")}
33
+ onClick={() => alert("Testing...")}
34
+ >
35
+ Primary Button
36
+ </Button>
37
+ <ThemeProvider theme={(theme) => sproutLightTheme(theme)}>
38
+ <Button
39
+ appearance={text("appearance", "primary")}
40
+ onClick={() => alert("Testing...")}
41
+ >
42
+ Primary Button
43
+ </Button>
44
+ </ThemeProvider>
45
+ </>
31
46
  );
32
47
 
33
48
  primary.story = {
@@ -3,7 +3,7 @@ import * as React from "react";
3
3
  import { ThemeProvider as BaseThemeProvider } from "styled-components";
4
4
  import theme from "../themes/light/theme";
5
5
 
6
- import typeof { default as TypeTheme } from "../themes/light/theme";
6
+ import type { TypeTheme } from "../types/theme.flow";
7
7
 
8
8
  type TypeProps = $ReadOnly<{|
9
9
  theme?: TypeTheme,
package/__flow__/index.js CHANGED
@@ -6,6 +6,10 @@ export { visuallyHidden, focusRing, disabled } from "./utils/mixins";
6
6
  export { useSelect, useMultiselect, useTextContent } from "./utils/hooks";
7
7
  export { default as theme } from "./themes/light/theme";
8
8
  export { default as darkTheme } from "./themes/dark/theme";
9
+ export {
10
+ sproutLightTheme,
11
+ sproutDarkTheme,
12
+ } from "./themes/extendedThemes/sproutTheme";
9
13
  export { default as Icon } from "./Icon";
10
14
  // DEPRECATED: Alert has been renamed to Banner
11
15
  export { default as Alert } from "./Banner";
@@ -0,0 +1,43 @@
1
+ // @flow strict-local
2
+ import clone from "just-clone";
3
+ import type { TypeTheme } from "../../../../types/theme.flow.js";
4
+
5
+ const darkTheme = (theme: TypeTheme) => {
6
+ const sproutDarkTheme = clone(theme);
7
+
8
+ sproutDarkTheme.colors = {
9
+ ...sproutDarkTheme.colors,
10
+ navigation: {
11
+ main: {
12
+ background: {
13
+ base: theme.colors.neutral[1000],
14
+ gradient: theme.colors.neutral[1100],
15
+ },
16
+ },
17
+ secondary: {
18
+ background: {
19
+ base: theme.colors.neutral[900],
20
+ },
21
+ },
22
+ text: {
23
+ base: theme.colors.neutral[0],
24
+ hover: theme.colors.neutral[0],
25
+ },
26
+ icon: {
27
+ base: theme.colors.neutral[0],
28
+ hover: theme.colors.neutral[0],
29
+ },
30
+ item: {
31
+ background: {
32
+ base: theme.colors.neutral[1000],
33
+ hover: theme.colors.neutral[1100],
34
+ active: theme.colors.neutral[700],
35
+ },
36
+ },
37
+ },
38
+ };
39
+
40
+ return sproutDarkTheme;
41
+ };
42
+
43
+ export default darkTheme;
@@ -0,0 +1,2 @@
1
+ export { default as sproutLightTheme } from "./light/theme";
2
+ export { default as sproutDarkTheme } from "./dark/theme";
@@ -0,0 +1,53 @@
1
+ // @flow strict-local
2
+ import clone from "just-clone";
3
+ import type { TypeTheme } from "../../../../types/theme.flow.js";
4
+
5
+ const lightTheme = (theme: TypeTheme) => {
6
+ const sproutLightTheme = clone(theme);
7
+ // copy theme that's passed in
8
+ // get all non color theme values
9
+ // get light theme changes
10
+
11
+ sproutLightTheme.colors = {
12
+ ...sproutLightTheme.colors,
13
+ navigation: {
14
+ main: {
15
+ background: {
16
+ base: theme.colors.neutral[900],
17
+ overflowGradient: theme.colors.neutral[1000],
18
+ },
19
+ },
20
+ secondary: {
21
+ background: {
22
+ base: theme.colors.neutral[800],
23
+ },
24
+ },
25
+ text: {
26
+ base: theme.colors.neutral[0],
27
+ hover: theme.colors.neutral[0],
28
+ },
29
+ icon: {
30
+ base: theme.colors.neutral[0],
31
+ hover: theme.colors.neutral[0],
32
+ },
33
+ listItem: {
34
+ background: {
35
+ base: theme.colors.neutral[800],
36
+ hover: theme.colors.neutral[1000],
37
+ selected: theme.colors.neutral[700],
38
+ },
39
+ },
40
+ },
41
+ icon: {
42
+ sentiment: {
43
+ positive_sentiment: theme.colors.blue[500],
44
+ negative_sentiment: theme.colors.red[500],
45
+ neutral_sentiment: theme.colors.neutral[300],
46
+ },
47
+ },
48
+ };
49
+
50
+ return sproutLightTheme;
51
+ };
52
+
53
+ export default lightTheme;
@@ -0,0 +1,6 @@
1
+ // @flow strict-local
2
+ import clone from 'just-clone';
3
+
4
+ const nonColorThemeValues = (theme) => {
5
+ const sproutTheme = clone(theme);
6
+ }
@@ -14,6 +14,7 @@ import {
14
14
  import type { TypeColors } from "./theme.colors.flow.js";
15
15
  import type { TypeFontFamilyString } from "../themes/light/theme";
16
16
 
17
+ export type TypeThemeMode = "light" | "dark";
17
18
  export type TypeBreakpoint = typeof breakpoints;
18
19
  export type TypeTypography = typeof typography;
19
20
  export type TypeFontWeight = typeof fontWeights;
@@ -28,6 +29,7 @@ export type TypeEasing = typeof easing;
28
29
  export type TypeDuration = typeof duration;
29
30
 
30
31
  export type TypeTheme = {
32
+ mode: TypeThemeMode,
31
33
  breakpoints: TypeBreakpoint,
32
34
  colors: TypeColor,
33
35
  typography: TypeTypography,
package/commonjs/index.js CHANGED
@@ -61,6 +61,8 @@ var _exportNames = {
61
61
  Menu: true,
62
62
  Listbox: true,
63
63
  OverflowList: true,
64
+ sproutLightTheme: true,
65
+ sproutDarkTheme: true,
64
66
  toast: true,
65
67
  MenuButton: true,
66
68
  MenuButtonContext: true,
@@ -70,7 +72,7 @@ var _exportNames = {
70
72
  DateRangePicker: true,
71
73
  VisuallyHidden: true
72
74
  };
73
- exports.VisuallyHidden = exports.DateRangePicker = exports.SingleDatePicker = exports.ListboxButton = exports.MenuItemContainer = exports.MenuButtonContext = exports.MenuButton = exports.toast = exports.OverflowList = exports.Listbox = exports.Menu = exports.ToastContainer = exports.Skeleton = exports.Breadcrumb = exports.Avatar = exports.Stack = exports.Message = exports.Fieldset = exports.FormField = exports.EmptyState = exports.SegmentedControl = exports.Collapsible = exports.Numeral = exports.LoaderButton = exports.Drawer = exports.Tooltip = exports.ThemeProvider = exports.Popout = exports.Modal = exports.Tabs = exports.TokenInput = exports.Token = exports.Switch = exports.Link = exports.Button = exports.Select = exports.Input = exports.Label = exports.Box = exports.TableRowAccordion = exports.TableHeaderCell = exports.TableCell = exports.Table = exports.ChartLegend = exports.KeyboardKey = exports.Image = exports.Text = exports.Loader = exports.ToggleHint = exports.Textarea = exports.Radio = exports.Checkbox = exports.CharacterCounter = exports.Card = exports.Indicator = exports.Badge = exports.Banner = exports.Alert = exports.Icon = exports.darkTheme = exports.theme = exports.useTextContent = exports.useMultiselect = exports.useSelect = exports.disabled = exports.focusRing = exports.visuallyHidden = void 0;
75
+ exports.VisuallyHidden = exports.DateRangePicker = exports.SingleDatePicker = exports.ListboxButton = exports.MenuItemContainer = exports.MenuButtonContext = exports.MenuButton = exports.toast = exports.sproutDarkTheme = exports.sproutLightTheme = exports.OverflowList = exports.Listbox = exports.Menu = exports.ToastContainer = exports.Skeleton = exports.Breadcrumb = exports.Avatar = exports.Stack = exports.Message = exports.Fieldset = exports.FormField = exports.EmptyState = exports.SegmentedControl = exports.Collapsible = exports.Numeral = exports.LoaderButton = exports.Drawer = exports.Tooltip = exports.ThemeProvider = exports.Popout = exports.Modal = exports.Tabs = exports.TokenInput = exports.Token = exports.Switch = exports.Link = exports.Button = exports.Select = exports.Input = exports.Label = exports.Box = exports.TableRowAccordion = exports.TableHeaderCell = exports.TableCell = exports.Table = exports.ChartLegend = exports.KeyboardKey = exports.Image = exports.Text = exports.Loader = exports.ToggleHint = exports.Textarea = exports.Radio = exports.Checkbox = exports.CharacterCounter = exports.Card = exports.Indicator = exports.Badge = exports.Banner = exports.Alert = exports.Icon = exports.darkTheme = exports.theme = exports.useTextContent = exports.useMultiselect = exports.useSelect = exports.disabled = exports.focusRing = exports.visuallyHidden = void 0;
74
76
 
75
77
  var _systemProps = require("./systemProps");
76
78
 
@@ -101,6 +103,11 @@ var _theme2 = _interopRequireDefault(require("./themes/dark/theme"));
101
103
 
102
104
  exports.darkTheme = _theme2.default;
103
105
 
106
+ var _sproutTheme = require("./themes/extendedThemes/sproutTheme");
107
+
108
+ exports.sproutLightTheme = _sproutTheme.sproutLightTheme;
109
+ exports.sproutDarkTheme = _sproutTheme.sproutDarkTheme;
110
+
104
111
  var _Icon = _interopRequireDefault(require("./Icon"));
105
112
 
106
113
  exports.Icon = _Icon.default;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _justClone = _interopRequireDefault(require("just-clone"));
7
+
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+
10
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
11
+
12
+ var darkTheme = function darkTheme(theme) {
13
+ var sproutDarkTheme = (0, _justClone.default)(theme);
14
+ sproutDarkTheme.colors = _extends({}, sproutDarkTheme.colors, {
15
+ navigation: {
16
+ main: {
17
+ background: {
18
+ base: theme.colors.neutral[1000],
19
+ gradient: theme.colors.neutral[1100]
20
+ }
21
+ },
22
+ secondary: {
23
+ background: {
24
+ base: theme.colors.neutral[900]
25
+ }
26
+ },
27
+ text: {
28
+ base: theme.colors.neutral[0],
29
+ hover: theme.colors.neutral[0]
30
+ },
31
+ icon: {
32
+ base: theme.colors.neutral[0],
33
+ hover: theme.colors.neutral[0]
34
+ },
35
+ item: {
36
+ background: {
37
+ base: theme.colors.neutral[1000],
38
+ hover: theme.colors.neutral[1100],
39
+ active: theme.colors.neutral[700]
40
+ }
41
+ }
42
+ }
43
+ });
44
+ return sproutDarkTheme;
45
+ };
46
+
47
+ var _default = darkTheme;
48
+ exports.default = _default;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.sproutDarkTheme = exports.sproutLightTheme = void 0;
5
+
6
+ var _theme = _interopRequireDefault(require("./light/theme"));
7
+
8
+ exports.sproutLightTheme = _theme.default;
9
+
10
+ var _theme2 = _interopRequireDefault(require("./dark/theme"));
11
+
12
+ exports.sproutDarkTheme = _theme2.default;
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+
6
+ var _justClone = _interopRequireDefault(require("just-clone"));
7
+
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+
10
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
11
+
12
+ var lightTheme = function lightTheme(theme) {
13
+ var sproutLightTheme = (0, _justClone.default)(theme); // copy theme that's passed in
14
+ // get all non color theme values
15
+ // get light theme changes
16
+
17
+ sproutLightTheme.colors = _extends({}, sproutLightTheme.colors, {
18
+ navigation: {
19
+ main: {
20
+ background: {
21
+ base: theme.colors.neutral[900],
22
+ overflowGradient: theme.colors.neutral[1000]
23
+ }
24
+ },
25
+ secondary: {
26
+ background: {
27
+ base: theme.colors.neutral[800]
28
+ }
29
+ },
30
+ text: {
31
+ base: theme.colors.neutral[0],
32
+ hover: theme.colors.neutral[0]
33
+ },
34
+ icon: {
35
+ base: theme.colors.neutral[0],
36
+ hover: theme.colors.neutral[0]
37
+ },
38
+ listItem: {
39
+ background: {
40
+ base: theme.colors.neutral[800],
41
+ hover: theme.colors.neutral[1000],
42
+ selected: theme.colors.neutral[700]
43
+ }
44
+ }
45
+ },
46
+ icon: {
47
+ sentiment: {
48
+ positive_sentiment: theme.colors.blue[500],
49
+ negative_sentiment: theme.colors.red[500],
50
+ neutral_sentiment: theme.colors.neutral[300]
51
+ }
52
+ }
53
+ });
54
+ return sproutLightTheme;
55
+ };
56
+
57
+ var _default = lightTheme;
58
+ exports.default = _default;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ var _justClone = _interopRequireDefault(require("just-clone"));
4
+
5
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
+
7
+ var nonColorThemeValues = function nonColorThemeValues(theme) {
8
+ var sproutTheme = (0, _justClone.default)(theme);
9
+ };
package/lib/index.js CHANGED
@@ -3,6 +3,7 @@ export { visuallyHidden, focusRing, disabled } from "./utils/mixins";
3
3
  export { useSelect, useMultiselect, useTextContent } from "./utils/hooks";
4
4
  export { default as theme } from "./themes/light/theme";
5
5
  export { default as darkTheme } from "./themes/dark/theme";
6
+ export { sproutLightTheme, sproutDarkTheme } from "./themes/extendedThemes/sproutTheme";
6
7
  export { default as Icon } from "./Icon"; // DEPRECATED: Alert has been renamed to Banner
7
8
 
8
9
  export { default as Alert } from "./Banner";
@@ -0,0 +1,40 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import clone from "just-clone";
4
+
5
+ var darkTheme = function darkTheme(theme) {
6
+ var sproutDarkTheme = clone(theme);
7
+ sproutDarkTheme.colors = _extends({}, sproutDarkTheme.colors, {
8
+ navigation: {
9
+ main: {
10
+ background: {
11
+ base: theme.colors.neutral[1000],
12
+ gradient: theme.colors.neutral[1100]
13
+ }
14
+ },
15
+ secondary: {
16
+ background: {
17
+ base: theme.colors.neutral[900]
18
+ }
19
+ },
20
+ text: {
21
+ base: theme.colors.neutral[0],
22
+ hover: theme.colors.neutral[0]
23
+ },
24
+ icon: {
25
+ base: theme.colors.neutral[0],
26
+ hover: theme.colors.neutral[0]
27
+ },
28
+ item: {
29
+ background: {
30
+ base: theme.colors.neutral[1000],
31
+ hover: theme.colors.neutral[1100],
32
+ active: theme.colors.neutral[700]
33
+ }
34
+ }
35
+ }
36
+ });
37
+ return sproutDarkTheme;
38
+ };
39
+
40
+ export default darkTheme;
@@ -0,0 +1,2 @@
1
+ export { default as sproutLightTheme } from "./light/theme";
2
+ export { default as sproutDarkTheme } from "./dark/theme";
@@ -0,0 +1,50 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import clone from "just-clone";
4
+
5
+ var lightTheme = function lightTheme(theme) {
6
+ var sproutLightTheme = clone(theme); // copy theme that's passed in
7
+ // get all non color theme values
8
+ // get light theme changes
9
+
10
+ sproutLightTheme.colors = _extends({}, sproutLightTheme.colors, {
11
+ navigation: {
12
+ main: {
13
+ background: {
14
+ base: theme.colors.neutral[900],
15
+ overflowGradient: theme.colors.neutral[1000]
16
+ }
17
+ },
18
+ secondary: {
19
+ background: {
20
+ base: theme.colors.neutral[800]
21
+ }
22
+ },
23
+ text: {
24
+ base: theme.colors.neutral[0],
25
+ hover: theme.colors.neutral[0]
26
+ },
27
+ icon: {
28
+ base: theme.colors.neutral[0],
29
+ hover: theme.colors.neutral[0]
30
+ },
31
+ listItem: {
32
+ background: {
33
+ base: theme.colors.neutral[800],
34
+ hover: theme.colors.neutral[1000],
35
+ selected: theme.colors.neutral[700]
36
+ }
37
+ }
38
+ },
39
+ icon: {
40
+ sentiment: {
41
+ positive_sentiment: theme.colors.blue[500],
42
+ negative_sentiment: theme.colors.red[500],
43
+ neutral_sentiment: theme.colors.neutral[300]
44
+ }
45
+ }
46
+ });
47
+ return sproutLightTheme;
48
+ };
49
+
50
+ export default lightTheme;
@@ -0,0 +1,5 @@
1
+ import clone from 'just-clone';
2
+
3
+ var nonColorThemeValues = function nonColorThemeValues(theme) {
4
+ var sproutTheme = clone(theme);
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "11.2.4-linkupdate.0",
3
+ "version": "11.2.5-sproutTheme-beta.1",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "__flow__",
@@ -66,6 +66,7 @@
66
66
  "dependencies": {
67
67
  "@styled-system/theme-get": "^5.1.2",
68
68
  "classnames": "^2.2.6",
69
+ "just-clone": "^5.0.1",
69
70
  "lodash.curry": "^4.1.1",
70
71
  "lodash.uniqueid": "^4.0.1",
71
72
  "lru-memoize": "^1.1.0",
package/bin/buildNpm.js DELETED
@@ -1,58 +0,0 @@
1
- /**
2
- * This file handles the generation of an .npmrc with Jfrog credentials during the CI process.
3
- * It replicates the local configuration requirements of a developer running `yarn` on their machine
4
- * If run locally please do not commit your auth credentials
5
- */
6
- const fs = require("fs");
7
- const https = require("https");
8
- const { exit } = require("process");
9
-
10
- const { ARTIFACTORY_KEY, CI } = process.env;
11
-
12
- // Check if we're in CI context, otherwise skip the process
13
- if (!CI) {
14
- exit();
15
- }
16
-
17
- const options = {
18
- hostname: "sproutsocial.jfrog.io",
19
- path: "/artifactory/api/npm/auth",
20
- method: "GET",
21
- headers: {
22
- "X-JFrog-Art-Api": ARTIFACTORY_KEY,
23
- },
24
- };
25
-
26
- const req = https.request(options, (res) => {
27
- console.log(`statusCode: ${res.statusCode}`);
28
-
29
- // Call our auth endpoint with environment credentials
30
- res.on("data", (data) => {
31
- // Writes out an .npmrc file with the response
32
- fs.writeFile(".npmrc", data, (err) => {
33
- if (err) console.log(err);
34
- else {
35
- console.log(".npmrc generated successfully!");
36
- }
37
- });
38
-
39
- // Once the file is created we append the registry info
40
- fs.appendFile(
41
- ".npmrc",
42
- "registry=https://sproutsocial.jfrog.io/artifactory/api/npm/npm_virtual",
43
- function (err) {
44
- if (err) throw err;
45
- console.log("Registry Config Added!");
46
- }
47
- );
48
-
49
- // Finally, we set permissions for the file so that netlify recognizes it
50
- fs.chmodSync(".npmrc", "0600");
51
- });
52
- });
53
-
54
- req.on("error", (error) => {
55
- console.error(error);
56
- });
57
-
58
- req.end();