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

chore: add codesandbox examples to the project #10763

Merged
Show file tree
Hide file tree
Changes from 4 commits
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
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ body:
- '@carbon/pictograms'
- '@carbon/pictograms-react'
- '@carbon/react'
- '@carbon/styles'
- '@carbon/themes'
- '@carbon/type'
- '@carbon/upgrade'
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ packages/icons-react/next/**
**/_inlined/**

# Examples
**/examples/**
packages/**/examples/**
!packages/themes/examples/**

# Yarn
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
24 changes: 24 additions & 0 deletions examples/codesandbox-styles/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
15 changes: 15 additions & 0 deletions examples/codesandbox-styles/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions examples/codesandbox-styles/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Carbon Styles Sandbox</title>
</head>
<body>
<button class="cds--btn cds--btn--primary">Hello world</button>
<script type="module" src="/main.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions examples/codesandbox-styles/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './style.scss';
15 changes: 15 additions & 0 deletions examples/codesandbox-styles/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "codesandbox-styles",
"private": true,
"version": "0.0.0",
"scripts": {
"develop": "vite"
},
"devDependencies": {
"vite": "^2.8.0"
},
"dependencies": {
"@carbon/styles": "0.14.0",
"sass": "^1.49.7"
}
}
3 changes: 3 additions & 0 deletions examples/codesandbox-styles/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@use '@carbon/styles' with (
$font-path: '@ibm/plex'
);
24 changes: 24 additions & 0 deletions examples/codesandbox/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
13 changes: 13 additions & 0 deletions examples/codesandbox/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
18 changes: 18 additions & 0 deletions examples/codesandbox/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "codesandbox",
"private": true,
"version": "0.0.0",
"scripts": {
"develop": "vite"
},
"dependencies": {
"@carbon/react": "0.14.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@vitejs/plugin-react": "^1.0.7",
"sass": "^1.49.7",
"vite": "^2.8.0"
}
}
7 changes: 7 additions & 0 deletions examples/codesandbox/src/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Button } from '@carbon/react';

function App() {
return <Button>Hello world</Button>;
}

export default App
15 changes: 15 additions & 0 deletions examples/codesandbox/src/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions examples/codesandbox/src/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@use '@carbon/react' with (
$font-path: '@ibm/plex',
);
12 changes: 12 additions & 0 deletions examples/codesandbox/src/main.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import './index.scss'

import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
)
7 changes: 7 additions & 0 deletions examples/codesandbox/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"workspaces": [
"actions/*",
"config/*",
"examples/*",
"packages/*",
"www"
],
Expand Down
7 changes: 6 additions & 1 deletion packages/cli/src/workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ const WORKSPACE_ROOT = getProjectRoot(__dirname);
const packageJson = fs.readJsonSync(path.join(WORKSPACE_ROOT, 'package.json'));
const packagePaths = Array.isArray(packageJson.workspaces)
? glob
.sync(packageJson.workspaces.map((pattern) => `${pattern}/package.json`))
.sync(
packageJson.workspaces.map((pattern) => `${pattern}/package.json`),
{
cwd: WORKSPACE_ROOT,
}
)
.map((match) => {
const packageJsonPath = path.join(WORKSPACE_ROOT, match);
return {
Expand Down
Loading