gatsby-attainlabs-cms 1.0.4 → 1.0.6
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/README.md +8 -7
- package/gatsby-node.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,10 +18,10 @@ npm install gatsby-attainlabs-cms
|
|
|
18
18
|
|
|
19
19
|
### 1. Add environment variable
|
|
20
20
|
|
|
21
|
-
At the root of your Gatsby site, create a `.env
|
|
21
|
+
At the root of your Gatsby site, create a `.env` file if it doesn’t already exist:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
touch .env
|
|
24
|
+
touch .env
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
Inside the file, add your Azure DevOps Personal Access Token (PAT):
|
|
@@ -53,7 +53,7 @@ require("dotenv").config({
|
|
|
53
53
|
module.exports = {
|
|
54
54
|
plugins: [
|
|
55
55
|
{
|
|
56
|
-
resolve: "gatsby-
|
|
56
|
+
resolve: "gatsby-attainlabs-cms",
|
|
57
57
|
options: {
|
|
58
58
|
brand: "Cash Money", // LendDirect | Cash Money | Heights Finance adding-puck-for-visual-code-editing
|
|
59
59
|
// personalAccessToken: "optional-fallback", // not recommended, but supported
|
|
@@ -67,9 +67,10 @@ module.exports = {
|
|
|
67
67
|
|
|
68
68
|
## Behavior
|
|
69
69
|
|
|
70
|
-
- Downloads brand-specific
|
|
70
|
+
- Downloads brand-specific components into:
|
|
71
71
|
- `src/cms/components/brand/`
|
|
72
72
|
- `src/cms/components/global/`
|
|
73
|
+
- `src/cms/gatsby-plugin-theme-ui/`
|
|
73
74
|
|
|
74
75
|
- Requires an Azure DevOps Personal Access Token (PAT) to authenticate requests.
|
|
75
76
|
|
|
@@ -90,10 +91,10 @@ module.exports = {
|
|
|
90
91
|
If you see:
|
|
91
92
|
|
|
92
93
|
```
|
|
93
|
-
⚠️ [gatsby-
|
|
94
|
+
⚠️ [gatsby-attainlabs-cms] No PERSONAL_ACCESS_TOKEN found...
|
|
94
95
|
```
|
|
95
96
|
|
|
96
|
-
➡️ Double-check that `.env
|
|
97
|
+
➡️ Double-check that `.env` exists and is loaded in `gatsby-config.js`.
|
|
97
98
|
|
|
98
99
|
---
|
|
99
100
|
|
|
@@ -102,7 +103,7 @@ If you see:
|
|
|
102
103
|
If you see:
|
|
103
104
|
|
|
104
105
|
```
|
|
105
|
-
[gatsby-
|
|
106
|
+
[gatsby-attainlabs-cms] Invalid or missing "brand" option.
|
|
106
107
|
You must specify one of: LendDirect, Cash Money, Heights Finance
|
|
107
108
|
```
|
|
108
109
|
|
package/gatsby-node.js
CHANGED
|
@@ -97,10 +97,10 @@ export const onPreInit = async (_, pluginOptions) => {
|
|
|
97
97
|
// Keep only index.tsx files
|
|
98
98
|
const items = (result.value || []).filter(
|
|
99
99
|
(i) =>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
!i.isFolder &&
|
|
101
|
+
i.gitObjectType === "blob" &&
|
|
102
|
+
(posix.basename(i.path) === "index.tsx" ||
|
|
103
|
+
posix.extname(i.path) === ".ts")
|
|
104
104
|
);
|
|
105
105
|
|
|
106
106
|
console.log(`Found ${items.length} files in ${repoPath}`);
|