{"id":21525828,"url":"https://github.com/bkwld/cloak","last_synced_at":"2025-04-09T23:23:18.579Z","repository":{"id":37834096,"uuid":"339634145","full_name":"BKWLD/cloak","owner":"BKWLD","description":"Opinionated Nuxt + Craft boilerplate","archived":false,"fork":false,"pushed_at":"2024-12-24T17:25:18.000Z","size":299,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T01:12:35.713Z","etag":null,"topics":["boilerplate","craftcms","nuxt"],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BKWLD.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-17T06:41:57.000Z","updated_at":"2024-12-24T17:24:33.000Z","dependencies_parsed_at":"2024-09-11T20:53:09.038Z","dependency_job_id":null,"html_url":"https://github.com/BKWLD/cloak","commit_stats":null,"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BKWLD%2Fcloak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BKWLD%2Fcloak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BKWLD%2Fcloak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BKWLD%2Fcloak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BKWLD","download_url":"https://codeload.github.com/BKWLD/cloak/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248126804,"owners_count":21052042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boilerplate","craftcms","nuxt"],"created_at":"2024-11-24T01:38:37.816Z","updated_at":"2025-04-09T23:23:18.551Z","avatar_url":"https://github.com/BKWLD.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloak\n\nOpinionated Nuxt boilerplate with support for Craft and Contentful.\n\n![](https://slack-imgs.com/?c=1\u0026o1=ro\u0026url=https%3A%2F%2Fmedia4.giphy.com%2Fmedia%2Ffs616XzKDb6cyd7TMa%2Fgiphy-downsized.gif%3Fcid%3D6104955e248cc15d4c2aeca08bb88c9fb520d40e9552a715%26rid%3Dgiphy-downsized.gif)\n\n## Install\n\nThe recommended way to use Cloak is to install it with `yarn create cloak-app`.  This command use [`create-cloak-app`](https://github.com/BKWLD/create-cloak-app) and will scaffold a new Nuxt app that uses Cloak.\n\n## Usage\n\nFrom your project's `nuxt.config.coffee`:\n\n```coffee\n# Make boilerplate, setting some options\n{ mergeConfig, makeBoilerplate } = require '@bkwld/cloak'\nboilerplate = makeBoilerplate\n  siteName: 'My Site'\n  cms: 'craft'\n  pageTypes: ['towers_towers_Entry']\n\n# Merge project specific config with cloak boilerplate\nmodule.exports = mergeConfig boilerplate,\n\n  # Append additional internal routes for vue-routing-anchor-parser\n  anchorParser: internalUrls: [\n    /^https?:\\/\\/(www)?\\.domain\\.com/\n  ]\n\n  # Customize routes\n  router: extendRoutes: (routes, resolve) -\u003e\n\n    # Make all path params required in detail routes\n    detailRoutes = ['blog-tag-tag', 'blog-category-article']\n    routes.filter ({ name }) -\u003e name in detailRoutes\n    .forEach (route) -\u003e route.path = route.path.replace /\\?/g, ''\n\n    # Append routes from boilerplate\n    return boilerplate.router.extendRoutes routes, resolve\n```\n\n## Options\n\nThese are options you can pass to `makeBoilerplate`.  See the [source code](config/boilerplate.coffee) for defaults.\n\n#### General\n\n| Property | Description |\n| -------- | ----------- |\n| `siteName` | Name of site gets prepended to the `\u003ctitle\u003e` and used in PWA manifest. |\n| `polyfills` | Array of [polyfill.io](https://polyfill.io/) keywords, for example `URL`. |\n\n#### CMS\n\n| Property | Description |\n| -------- | ----------- |\n| `cms` | May be empty, `craft`, or `contentful`. |\n| `pageTypes` *(if Craft)* | An array of Craft `_typename` values. |\n| `pageTypes` *(if Contentful)* | An array of objects with the following properties: `contentType` (a Contentful contentType string), `routeField` (the field that holds the value you'll use in your route, defaults to `\"slug\"`), and `route` (a function that is passed the value from the `routeField` and which should return a route path). |\n| `generateOnlyRoutes` | *Craft only.* Typically we generate a gql query per `pageType` that fetches the data for all entries, passing their data into the page components as the payload. Set this to `true` to disable this. You would do this on sites with many entries because this query becomes very expensive for Craft to execute. |\n\n#### Visual\n\n| Property | Description |\n| -------- | ----------- |\n| `imgixUrl` | For example, `https://project.imgix.net`. |\n| `srcsetWidths` | Array of integer widths that are used to make the Visual srcSet. |\n| `placeholderColor` | The default placeholder color for Visual. |\n\n## Other Config\n\n#### Contentful\n\nThe following ENV variables are expected to use Contentful\n\n| Property | Description |\n| -------- | ----------- |\n| `CONTENTFUL_SPACE` | The space id. |\n| `CONTENTFUL_ACCESS_TOKEN` | The Delivery API access token. |\n| `CONTENTFUL_PREVIEW_ACCESS_TOKEN` | The Preview API access token. |\n| `CONTENTFUL_PREVIEW` | Set to `true` use the Preview API rather than the Delivery API. Aka, to return draft/changed entries. |\n\n#### Sentry\n\nTo enable Sentry logging, you'll need to set the following ENV variables:\n\n| Property | Description |\n| -------- | ----------- |\n| `SENTRY_DSN` | This will be provided when you create a new project in Sentry. |\n| `SENTRY_AUTH_TOKEN` | Get this from [your user API settings](https://sentry.io/settings/account/api/auth-tokens). You need the `org:read` and `project:releases` permissions for the token (per `authToken` docs from [`sentry-webpack-plugin`](https://github.com/getsentry/sentry-webpack-plugin)). |\n\nYou also need to create a `.sentryclirc` as [described here](https://docs.sentry.io/product/cli/configuration/#config-defaults).  `create-cloak-app` will have already created this.  Example:\n\n```\n[defaults]\norg=bukwild\nproject=my-project\n```\n\n## Libraries\n\nBesides providing a bunch of nuxt.config boilerplate, this project also provides these shared resources:\n\n- [components](./components) - Vue components that are already setup for autodiscovery with no prefixing.\n- [fragments](./fragments) - GraphQL fragments for common objects\n- [mixins](./mixins) - Vue mixins\n- [services](./services) - Libraries of methods that can be imported into your code and which are also injected globally.  For example, `@$craft` and `@$defer` are available in all components.\n\n## Notes\n\n- Using `cjs` module syntax for to make developing via yarn link simpler.  I tried using `esm` package but it ran into issues with imports of imports.\n- Using [a fork](https://github.com/samsarahq/graphql-loader/pull/36) of `webpack-graphql-loader` to work around issues with the loader not being found from the root package. I think because it referenced some old and unecessary deps.\n- Use the `Page View` dataLayer event for firing Page View style tags from GTM\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkwld%2Fcloak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbkwld%2Fcloak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkwld%2Fcloak/lists"}