Skip to content

Commit

Permalink
Local sandbox (#193)
Browse files Browse the repository at this point in the history
* gatsby-mdx-codesandbox package
  • Loading branch information
benallfree committed Jan 16, 2022
1 parent eb8471d commit 9d38fff
Show file tree
Hide file tree
Showing 145 changed files with 15,617 additions and 566 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.DS_Store
.DS_Store
.parcel-cache
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist
storybook-static
.cache
.cache
.parcel-cache
16 changes: 16 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"printWidth": 100,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"semi": false,
"overrides": [
{
"files": ["*.md", "*.mdx"],
"options": {
"printWidth": 80,
"proseWrap": "always"
}
}
]
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
"prepare": "husky install"
},
"devDependencies": {
"@parcel/packager-ts": "^2.2.0",
"@parcel/transformer-typescript-types": "^2.2.0",
"husky": ">=6",
"lint-staged": ">=10",
"prettier": "^2.5.1",
"prettier-plugin-organize-imports": "^2.3.4"
"prettier-plugin-organize-imports": "^2.3.4",
"typescript": ">=3.0.0"
},
"lint-staged": {
"*.{js,css,md,mdx,jsx,tsx,ts,json}": "prettier --write"
Expand Down
2 changes: 2 additions & 0 deletions packages/gatsby-mdx-codesandbox/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
5 changes: 5 additions & 0 deletions packages/gatsby-mdx-codesandbox/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# gatsby-mdx-codesandbox

`[code:HelloWorld.tsx]` will prettify and inline the code for the file named `HelloWorld.tsx` in the same directory as your `mdx` file.

`[demo:HelloWorld.tsx]` will show a Codesandbox iframe using the template you have specified. When running on localhost, it will also show run the component locally, presumably using local packages.
36 changes: 36 additions & 0 deletions packages/gatsby-mdx-codesandbox/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "gatsby-mdx-codesandbox",
"version": "0.0.1",
"source": "./src/index.ts",
"main": "dist/index.js",
"engines": {
"node": ">12"
},
"types": "dist/index.d.ts",
"license": "MIT",
"scripts": {
"build": "parcel build",
"watch": "chokidar 'src/*' -c 'yarn build'"
},
"dependencies": {
"@s-libs/micro-dash": "12",
"@types/prettier": "^2.4.3",
"codesandbox": "^2.2.3",
"prettier": "^2.5.1",
"remark-codesandbox": "^0.10.0",
"typescript": "^4.5.4",
"unist-util-visit": "2"
},
"peerDependencies": {
"gatsby": "^4.0",
"react-codesandbox-viewer": "*"
},
"devDependencies": {
"@babel/core": "^7.16.7",
"@types/prettier": "^2.4.3",
"babel-loader": "^8.2.3",
"parcel": "^2.2.0",
"type-fest": "^2.9.0",
"typescript": "^4.5.4"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "react-babylonjs-codesandbox",
"name": "@react-babylonjs/codesandbox-demo",
"version": "1.0.0",
"description": "",
"keywords": [],
Expand Down
Loading

0 comments on commit 9d38fff

Please sign in to comment.