Skip to content

Commit 48e0359

Browse files
feat: initialize iterable project (#9906)
1 parent b3b1282 commit 48e0359

29 files changed

+8307
-0
lines changed

apps/iterable/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# dotenv environment variables file
15+
.env
16+
.env.*
17+
!.env*.example
18+
19+
# misc
20+
.DS_Store
21+
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*

apps/iterable/.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
engine-strict = true
2+
@contentful:registry=https://registry.npmjs.org

apps/iterable/README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
This project was bootstrapped with [Create Contentful App](https://github.com/contentful/create-contentful-app).
2+
3+
## How to use
4+
5+
Execute create-contentful-app with npm, npx or yarn to bootstrap the example:
6+
7+
```bash
8+
# npx
9+
npx create-contentful-app --typescript
10+
11+
# npm
12+
npm init contentful-app -- --typescript
13+
14+
# Yarn
15+
yarn create contentful-app --typescript
16+
```
17+
18+
## Available Scripts
19+
20+
In the project directory, you can run:
21+
22+
#### `npm start`
23+
24+
Creates or updates your app definition in Contentful, and runs the app in development mode.
25+
Open your app to view it in the browser.
26+
27+
The page will reload if you make edits.
28+
You will also see any lint errors in the console.
29+
30+
#### `npm run build`
31+
32+
Builds the app for production to the `build` folder.
33+
It correctly bundles React in production mode and optimizes the build for the best performance.
34+
35+
The build is minified and the filenames include the hashes.
36+
Your app is ready to be deployed!
37+
38+
#### `npm run upload`
39+
40+
Uploads the build folder to contentful and creates a bundle that is automatically activated.
41+
The command guides you through the deployment process and asks for all required arguments.
42+
Read [here](https://www.contentful.com/developers/docs/extensibility/app-framework/create-contentful-app/#deploy-with-contentful) for more information about the deployment process.
43+
44+
#### `npm run upload-ci`
45+
46+
Similar to `npm run upload` it will upload your app to contentful and activate it. The only difference is
47+
that with this command all required arguments are read from the environment variables, for example when you add
48+
the upload command to your CI pipeline.
49+
50+
For this command to work, the following environment variables must be set:
51+
52+
- `CONTENTFUL_ORG_ID` - The ID of your organization
53+
- `CONTENTFUL_APP_DEF_ID` - The ID of the app to which to add the bundle
54+
- `CONTENTFUL_ACCESS_TOKEN` - A personal [access token](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/personal-access-tokens)
55+
56+
## Libraries to use
57+
58+
To make your app look and feel like Contentful use the following libraries:
59+
60+
- [Forma 36](https://f36.contentful.com/) – Contentful's design system
61+
- [Contentful Field Editors](https://www.contentful.com/developers/docs/extensibility/field-editors/) – Contentful's field editor React components
62+
63+
## Using the `contentful-management` SDK
64+
65+
In the default create contentful app output, a contentful management client is
66+
passed into each location. This can be used to interact with Contentful's
67+
management API. For example
68+
69+
```js
70+
// Use the client
71+
cma.locale.getMany({}).then((locales) => console.log(locales));
72+
```
73+
74+
Visit the [`contentful-management` documentation](https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library)
75+
to find out more.
76+
77+
## Learn More
78+
79+
[Read more](https://www.contentful.com/developers/docs/extensibility/app-framework/create-contentful-app/) and check out the video on how to use the CLI.

apps/iterable/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
</head>
7+
<body>
8+
<noscript>You need to enable JavaScript to run this app.</noscript>
9+
<div id="root"></div>
10+
<script type="module" src="/src/index.tsx"></script>
11+
<!--
12+
This HTML file is a template.
13+
If you open it directly in the browser, you will see an empty page.
14+
You can add webfonts, meta tags, or analytics to this file.
15+
The build step will place the bundled scripts into the <body> tag.
16+
To begin the development, run `npm start`.
17+
To create a production bundle, use `npm run build`.
18+
-->
19+
</body>
20+
</html>

0 commit comments

Comments
 (0)