Skip to content

Commit

Permalink
fix: deploy storybook to main site. fix links
Browse files Browse the repository at this point in the history
  • Loading branch information
wuweiweiwu committed Jun 14, 2018
1 parent bd0df92 commit 599f2ed
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 100 deletions.
7 changes: 2 additions & 5 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"react-sortable-tree": "link:..",
"react-split-pane": "^0.1.77",
"resolve": "1.6.0",
"serve": "^8.1.1",
"style-loader": "0.19.0",
"sw-precache-webpack-plugin": "0.11.4",
"url-loader": "0.6.2",
Expand All @@ -53,11 +52,9 @@
},
"scripts": {
"start": "node scripts/start.js",
"now-start": "serve --single ./build",
"predeploy": "npm run build && npm run build:storybook --prefix ..",
"predeploy": "npm run build",
"deploy": "surge ./build react-sortable-tree.surge.sh",
"build": "node scripts/build.js",
"postbuild": "rimraf 'build/**/*.map'"
"build": "node scripts/build.js"
},
"jest": {
"collectCoverageFrom": [
Expand Down
5 changes: 4 additions & 1 deletion example/src/Title.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export default class Title extends Component {
>
Docs
</NavItem>
<NavItem eventKey={2} href="/storybook/index.html">
<NavItem
eventKey={2}
href="https://frontend-collective.github.io/react-sortable-tree"
>
Storybook
</NavItem>
<NavItem
Expand Down
97 changes: 8 additions & 89 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
dependencies:
redux "*"

"@zeit/schemas@1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@zeit/schemas/-/schemas-1.2.0.tgz#89e47b2f2bd41cdb52f54ff23038ccd9b1eb30da"

abab@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e"
Expand Down Expand Up @@ -90,7 +86,7 @@ ajv@5.5.2, ajv@^5.0.0, ajv@^5.1.0, ajv@^5.1.5, ajv@^5.2.0:
fast-json-stable-stringify "^2.0.0"
json-schema-traverse "^0.3.0"

ajv@6.5.0, ajv@^6.0.1:
ajv@^6.0.1:
version "6.5.0"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.0.tgz#4c8affdf80887d8f132c9c52ab8a2dc4d0b7b24c"
dependencies:
Expand Down Expand Up @@ -182,10 +178,6 @@ are-we-there-yet@~1.1.2:
delegates "^1.0.0"
readable-stream "^2.0.6"

arg@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/arg/-/arg-2.0.0.tgz#c06e7ff69ab05b3a4a03ebe0407fac4cba657545"

argparse@^1.0.7:
version "1.0.10"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
Expand Down Expand Up @@ -1384,7 +1376,7 @@ chalk@1.1.3, chalk@^1.1.3:
strip-ansi "^3.0.0"
supports-color "^2.0.0"

chalk@2.4.1, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1:
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e"
dependencies:
Expand Down Expand Up @@ -2699,12 +2691,6 @@ fast-levenshtein@~2.0.4:
version "2.0.6"
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"

fast-url-parser@1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/fast-url-parser/-/fast-url-parser-1.1.3.tgz#f4af3ea9f34d8a271cf58ad2b3759f431f0b318d"
dependencies:
punycode "^1.3.2"

fastparse@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8"
Expand Down Expand Up @@ -2997,18 +2983,6 @@ glob-parent@^3.1.0:
is-glob "^3.1.0"
path-dirname "^1.0.0"

glob-slash@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/glob-slash/-/glob-slash-1.0.0.tgz#fe52efa433233f74a2fe64c7abb9bc848202ab95"

glob-slasher@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/glob-slasher/-/glob-slasher-1.0.1.tgz#747a0e5bb222642ee10d3e05443e109493cb0f8e"
dependencies:
glob-slash "^1.0.0"
lodash.isobject "^2.4.1"
toxic "^1.0.0"

glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2:
version "7.1.2"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
Expand Down Expand Up @@ -4320,10 +4294,6 @@ locate-path@^2.0.0:
p-locate "^2.0.0"
path-exists "^3.0.0"

lodash._objecttypes@~2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz#7c0b7f69d98a1f76529f890b0cdb1b4dfec11c11"

lodash._reinterpolate@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
Expand All @@ -4344,12 +4314,6 @@ lodash.isequal@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"

lodash.isobject@^2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/lodash.isobject/-/lodash.isobject-2.4.1.tgz#5a2e47fe69953f1ee631a7eba1fe64d2d06558f5"
dependencies:
lodash._objecttypes "~2.4.1"

lodash.memoize@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
Expand Down Expand Up @@ -4379,10 +4343,6 @@ lodash.uniq@^4.5.0:
version "4.17.10"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"

lodash@^2.4.1:
version "2.4.2"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-2.4.2.tgz#fadd834b9683073da179b3eae6d9c0d15053f73e"

loglevel@^1.4.1:
version "1.6.1"
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa"
Expand Down Expand Up @@ -4555,7 +4515,7 @@ mime-db@~1.33.0:
version "1.33.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db"

mime-types@2.1.18, mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18:
mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18:
version "2.1.18"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8"
dependencies:
Expand Down Expand Up @@ -4587,7 +4547,7 @@ minimatch@3.0.3:
dependencies:
brace-expansion "^1.0.0"

minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4:
minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
dependencies:
Expand Down Expand Up @@ -5091,7 +5051,7 @@ path-is-absolute@^1.0.0, path-is-absolute@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"

path-is-inside@1.0.2, path-is-inside@^1.0.1, path-is-inside@^1.0.2:
path-is-inside@^1.0.1, path-is-inside@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"

Expand All @@ -5107,10 +5067,6 @@ path-to-regexp@0.1.7:
version "0.1.7"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"

path-to-regexp@2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.2.1.tgz#90b617025a16381a879bc82a38d4e8bdeb2bcf45"

path-to-regexp@^1.0.1:
version "1.7.0"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d"
Expand Down Expand Up @@ -5584,7 +5540,7 @@ punycode@1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d"

punycode@^1.2.4, punycode@^1.3.2, punycode@^1.4.1:
punycode@^1.2.4, punycode@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"

Expand Down Expand Up @@ -5970,14 +5926,14 @@ regexpu-core@^2.0.0:
regjsgen "^0.2.0"
regjsparser "^0.1.4"

registry-auth-token@3.3.2, registry-auth-token@^3.0.1:
registry-auth-token@^3.0.1:
version "3.3.2"
resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.2.tgz#851fd49038eecb586911115af845260eec983f20"
dependencies:
rc "^1.1.6"
safe-buffer "^5.0.1"

registry-url@3.1.0, registry-url@^3.0.3:
registry-url@^3.0.3:
version "3.1.0"
resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942"
dependencies:
Expand Down Expand Up @@ -6238,19 +6194,6 @@ send@0.16.2:
range-parser "~1.2.0"
statuses "~1.4.0"

serve-handler@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/serve-handler/-/serve-handler-3.1.0.tgz#00e0712a600ef695e263c40f6d7b3aab9ba1352a"
dependencies:
bytes "3.0.0"
content-disposition "0.5.2"
fast-url-parser "1.1.3"
glob-slasher "1.0.1"
mime-types "2.1.18"
minimatch "3.0.4"
path-is-inside "1.0.2"
path-to-regexp "2.2.1"

serve-index@^1.7.2:
version "1.9.1"
resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239"
Expand All @@ -6272,17 +6215,6 @@ serve-static@1.13.2:
parseurl "~1.3.2"
send "0.16.2"

serve@^8.1.1:
version "8.1.1"
resolved "https://registry.yarnpkg.com/serve/-/serve-8.1.1.tgz#21bf75ffc967c60b8e4c69e81bb82c476543150f"
dependencies:
"@zeit/schemas" "1.2.0"
ajv "6.5.0"
arg "2.0.0"
chalk "2.4.1"
serve-handler "3.1.0"
update-check "1.5.2"

serviceworker-cache-polyfill@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/serviceworker-cache-polyfill/-/serviceworker-cache-polyfill-4.0.0.tgz#de19ee73bef21ab3c0740a37b33db62464babdeb"
Expand Down Expand Up @@ -6844,12 +6776,6 @@ tough-cookie@~2.3.3:
dependencies:
punycode "^1.4.1"

toxic@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/toxic/-/toxic-1.0.0.tgz#f1154d8b6ac21875ac943a9f7408df2dfe164ea2"
dependencies:
lodash "^2.4.1"

tr46@~0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
Expand Down Expand Up @@ -6984,13 +6910,6 @@ upath@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd"

update-check@1.5.2:
version "1.5.2"
resolved "https://registry.yarnpkg.com/update-check/-/update-check-1.5.2.tgz#2fe09f725c543440b3d7dabe8971f2d5caaedc28"
dependencies:
registry-auth-token "3.3.2"
registry-url "3.1.0"

update-notifier@^2.3.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.5.0.tgz#d0744593e13f161e406acb1d9408b72cad08aff6"
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
"scripts": {
"prebuild": "npm run lint",
"build": "npm run clean && NODE_ENV=rollup rollup -c",
"build:storybook": "npm run clean:storybook && build-storybook -o example/build/storybook",
"build:storybook": "npm run clean:storybook && build-storybook -o build",
"clean": "rimraf dist",
"clean:storybook": "rimraf example/build/storybook",
"clean:storybook": "rimraf build",
"lint": "eslint src",
"prettier": "prettier --write \"{src,example/src,stories}/**/*.{js,css,md}\"",
"prepublishOnly": "npm run lint && npm run test && npm run build",
"release": "standard-version",
"test": "cross-env NODE_ENV=test jest",
"test:watch": "cross-env NODE_ENV=test jest --watchAll",
"storybook": "start-storybook -p ${PORT:-3001} -h 0.0.0.0"
"storybook": "start-storybook -p ${PORT:-3001} -h 0.0.0.0",
"deploy": "gh-pages -d build"
},
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
Expand Down
2 changes: 1 addition & 1 deletion stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const wrapWithSource = (node, src) => (
PLAY WITH THIS CODE →
</button>
<a
href={`https://github.com/frontend-collective/react-sortable-tree/blob/master/examples/storybooks/${src}`}
href={`https://github.com/frontend-collective/react-sortable-tree/blob/master/stories/${src}`}
target="_top"
rel="noopener noreferrer"
className="sourceLink"
Expand Down
2 changes: 1 addition & 1 deletion stories/sandbox-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const GIT_URL =
export const SANDBOX_URL = 'https://codesandbox.io/api/v1/sandboxes/define';

// full url for github api call
const getURL = filename => `${GIT_URL}/examples/storybooks/${filename}`;
const getURL = filename => `${GIT_URL}/stories/${filename}`;

// strip ../src from the src
const strip = code =>
Expand Down

0 comments on commit 599f2ed

Please sign in to comment.