Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proof of Concept: [UIAPPS-177] add cra-template packages for starter-kit #127

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions packages/cra-template-apps-starter-kit/package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"name": "@datadog/cra-template-apps-starter-kit",
"version": "1.0.0",
"keywords": [
"react",
"create-react-app",
"template",
"datadog"
],
"description": "Datadog UI Apps Starter Kit",
"repository": {
"type": "git",
"url": "git+https://github.com/DataDog/apps.git",
"directory": "packages/cra-template-apps-starter-kit"
},
"license": "Apache-2.0",
"engines": {
"node": ">=16"
},
"bugs": {
"url": "https://github.com/DataDog/apps/issues"
},
"main": "template.json",
"files": [
"template",
"template.json"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"prepare": "exit 0"
}
"name": "@datadog/cra-template-apps-starter-kit",
"version": "1.0.0",
"keywords": [
"react",
"create-react-app",
"template",
"datadog"
],
"description": "Datadog UI Apps Starter Kit",
"repository": {
"type": "git",
"url": "git+https://github.com/DataDog/apps.git",
"directory": "packages/cra-template-apps-starter-kit"
},
"license": "Apache-2.0",
"engines": {
"node": ">=16"
},
"bugs": {
"url": "https://github.com/DataDog/apps/issues"
},
"main": "template.json",
"files": [
"template",
"template.json"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"prepare": "exit 0"
}
}
42 changes: 18 additions & 24 deletions packages/cra-template-apps-starter-kit/template.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
{
"package": {
"dependencies": {
"@datadog/ui-extensions-react": "0.30.1",
"@datadog/ui-extensions-sdk": "0.30.1",
"milligram": "^1.4.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typeface-roboto": "^1.1.13"
},
"eslintConfig": {
"extends": ["react-app", "react-app/jest"]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"package": {
"dependencies": {
"@datadog/ui-extensions-react": "0.31.0",
"@datadog/ui-extensions-sdk": "0.31.0",
Comment on lines +4 to +5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ question: ‏Can we think through how we might keep these versions in sync with the actual versions in the respective packages? Does CRA have some tooling or a pattern for that?

The way it currently works for the other workspaces is that the version gets bumped whenever we make a release. This works because changesets sees one of these @datadog/ui-extensions-* packages version changes and goes and updates all of the dependencies each workspace. That doesn't need to be the only way we do things, it's just how we've done it so far.

The only other place in the repo that's not always in sync is the packages/create-app/src/template/package.json file. Since packages/create-app/src/template isn't a workspace, it doesn't get the auto-update from changesets. Only reason that is the way it is is neglect: we missed that when adding the template feature. So in that regard, adding the CRA templates is no different than what we have now. But, if we could it'd be nice to figure out a way to make it automatically update.

Barring an automatic update, we could throw a script together that checked these versions matched the expected version and run it as part of yarn test. We do that with other things we can't easily automate away. That way at least we get a failure, even if a human has to get involved.

In any case, more than happy to spit ball some ideas you might have. And this isn't blocking, so don't worry if there isn't really a good story here. Just wanted to bring it up in case there was something.

"milligram": "^1.4.1",
"typeface-roboto": "^1.1.13"
},
"eslintConfig": {
"extends": ["react-app", "react-app/jest"]
},
"browserslist": {
"production": [">0.2%", "not dead", "not op_mini all"],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
}
}
70 changes: 70 additions & 0 deletions packages/cra-template-apps-starter-kit/template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Datadog UI App React Starter Kit

This project was generated via the [Datadog UI Apps Starter Kit](https://github.com/datadog/apps/packages/cra-template-apps-starter-kit) [`create-react-app`](https://create-react-app.dev/) [custom template](https://create-react-app.dev/docs/custom-templates).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can't go back!**

If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `npm run build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
66 changes: 33 additions & 33 deletions packages/cra-template-apps-typescript-starter-kit/package.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
{
"name": "@datadog/cra-template-apps-typescript-starter-kit",
"version": "1.0.0",
"keywords": [
"react",
"create-react-app",
"template",
"typescript",
"datadog"
],
"description": "Datadog UI Apps Starter Kit",
"repository": {
"type": "git",
"url": "git+https://github.com/DataDog/apps.git",
"directory": "packages/cra-template-apps-typescript-starter-kit"
},
"license": "Apache-2.0",
"engines": {
"node": ">=16"
},
"bugs": {
"url": "https://github.com/DataDog/apps/issues"
},
"main": "template.json",
"files": [
"template",
"template.json"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"prepare": "exit 0"
}
"name": "@datadog/cra-template-apps-typescript-starter-kit",
"version": "1.0.0",
"keywords": [
"react",
"create-react-app",
"template",
"typescript",
"datadog"
],
"description": "Datadog UI Apps Starter Kit",
"repository": {
"type": "git",
"url": "git+https://github.com/DataDog/apps.git",
"directory": "packages/cra-template-apps-typescript-starter-kit"
},
"license": "Apache-2.0",
"engines": {
"node": ">=16"
},
"bugs": {
"url": "https://github.com/DataDog/apps/issues"
},
"main": "template.json",
"files": [
"template",
"template.json"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"prepare": "exit 0"
}
}
52 changes: 22 additions & 30 deletions packages/cra-template-apps-typescript-starter-kit/template.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
{
"package": {
"dependencies": {
"@datadog/ui-extensions-react": "0.30.1",
"@datadog/ui-extensions-sdk": "0.30.1",
"milligram": "^1.4.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typeface-roboto": "^1.1.13"
},
"devDependencies": {
"@types/node": "^16.7.13",
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14",
"typescript": "^4.4.2"
},
"eslintConfig": {
"extends": ["react-app", "react-app/jest"]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"package": {
"dependencies": {
"@datadog/ui-extensions-react": "0.31.0",
"@datadog/ui-extensions-sdk": "0.31.0",
"@types/node": "^16.7.13",
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14",
"milligram": "^1.4.1",
"typeface-roboto": "^1.1.13",
"typescript": "^4.4.2"
},
"eslintConfig": {
"extends": ["react-app", "react-app/jest"]
},
"browserslist": {
"production": [">0.2%", "not dead", "not op_mini all"],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Datadog UI App TypeScript+React Starter Kit

This project was generated via the [Datadog UI Apps TypeScript Starter Kit](https://github.com/datadog/apps/packages/cra-template-apps-typescript-starter-kit) [`create-react-app`](https://create-react-app.dev/) [custom template](https://create-react-app.dev/docs/custom-templates).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.\
You may also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can't go back!**

If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.

You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).

### Code Splitting

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `npm run build` fails to minify

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
Loading