Skip to content

Commit

Permalink
Merge pull request #73 from torch2424/torch2424/type-embed-markdown-demo
Browse files Browse the repository at this point in the history
Got the Markdown Demo working with the new type-embeds release
  • Loading branch information
surma committed Mar 22, 2021
2 parents 8ca11a5 + a0b7ec2 commit bfc3cef
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 46 deletions.
2 changes: 1 addition & 1 deletion examples/markdown-parser/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { h, render, Component } from "preact";
import asbind from "../../dist/as-bind.esm";
import * as asbind from "../../dist/as-bind.esm";

// Import our TypeScript equivalent
import { convertMarkdownToHTML } from "../../dist/ts/index";
Expand Down
80 changes: 49 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 6 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,18 @@
"iife": "dist/as-bind.iife.js",
"types": "dist/as-bind.d.ts",
"scripts": {
"build": "run-s lib:wasm:build lib:js:build",
"build": "run-s lib:js:build",
"dev": "run-p lib:watch lib:test:watch",
"serve": "serve dist -p 8080",
"test": "node ./test/test-runner.js",
"lint": "prettier --write **/*.js **/*.ts **/*.json !build/**/* !dist/**/*",
"lint:ci": "prettier --check **/*.js **/*.ts **/*.json !build/**/* !dist/**/*",
"lib:watch": "chokidar --initial \"lib/**/*\" -c \"run-s lib:wasm:build lib:js:build:dev test\"",
"lib:test:watch": "chokidar \"test/**/*.js\" \"test/**/*.ts\" -c \"run-s lib:wasm:build lib:test:build test\"",
"lib:wasm:build": "run-s lib:wasm:build:debug lib:wasm:build:optimized lib:wasm:build:cp",
"lib:wasm:build:debug": "asc lib/assembly/as-bind.ts -b dist/as-bind.debug.wasm -t dist/as-bind.debug.wat --sourceMap --debug --exportRuntime",
"lib:wasm:build:optimized": "asc lib/assembly/as-bind.ts -b dist/as-bind.wasm --sourceMap dist/as-bind.wasm.map -t dist/as-bind.wat -O3 --exportRuntime",
"lib:wasm:build:cp": "cpy 'lib/assembly/**/*' dist",
"lib:watch": "chokidar --initial \"lib/**/*\" -c \"run-s lib:js:build:dev test\"",
"lib:test:watch": "chokidar \"test/**/*.js\" \"test/**/*.ts\" -c \"run-s lib:test:build test\"",
"lib:js:build": "rollup -c --environment LIB,PROD && cpy 'lib/as-bind.d.ts' dist",
"lib:js:build:dev": "rollup -c --environment LIB,DEV",
"lib:test:build": "run-s lib:test:build:entry lib:test:build:no-entry",
"lib:test:build:entry": "asc lib/assembly/as-bind.ts test/assembly/test.ts -b test/assembly/test.wasm --debug --runtime incremental --exportRuntime",
"lib:test:build:entry": "asc test/assembly/test.ts -b test/assembly/test.wasm --debug --runtime incremental --exportRuntime",
"lib:test:build:no-entry": "asc test/assembly/test.ts -b test/assembly/test-no-entry.wasm --debug --runtime incremental --exportRuntime",
"lib:deploy": "npm run build && np",
"md:build": "run-s md:wasm:build md:ts:build md:js:build",
Expand All @@ -31,7 +27,7 @@
"md:wasm:watch": "chokidar --initial \"examples/markdown-parser/assembly/**/*\" -c \"run-s md:wasm:build\"",
"md:ts:watch": "chokidar --initial \"examples/markdown-parser/assembly/**/*\" -c \"run-s md:ts:build\"",
"md:js:watch": "chokidar --initial \"examples/markdown-parser/**/*\" -c \"rollup -c --environment MD,DEV\"",
"md:wasm:build": "asc lib/assembly/as-bind.ts examples/markdown-parser/assembly/index.ts -b dist/examples/markdown-parser/index.wasm -t dist/examples/markdown-parser/index.wat --sourceMap dist/examples/markdown-parser/index.wasm.map --runtime incremental --exportRuntime",
"md:wasm:build": "asc examples/markdown-parser/assembly/index.ts --transform ./transform.js -b dist/examples/markdown-parser/index.wasm -t dist/examples/markdown-parser/index.wat --sourceMap dist/examples/markdown-parser/index.wasm.map --runtime incremental --exportRuntime",
"md:ts:build": "tsc --project examples/markdown-parser/assembly/ --outDir dist/ts/ --module \"es2015\"",
"md:js:build": "rollup -c --environment MD,PROD",
"md:deploy": "run-s build md:build md:deploy:gh-pages",
Expand All @@ -49,7 +45,7 @@
"@babel/plugin-proposal-export-default-from": "^7.12.13",
"@babel/plugin-proposal-object-rest-spread": "^7.13.8",
"@babel/plugin-transform-react-jsx": "^7.12.17",
"@babel/preset-env": "^7.13.10",
"@babel/preset-env": "^7.13.12",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-json": "^4.1.0",
Expand Down
7 changes: 3 additions & 4 deletions rollup.markdown-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ const sourcemapOption = process.env.PROD ? undefined : "inline";

const babelPluginConfig = {
babelHelpers: "bundled",
presets: ["@babel/preset-env"],
plugins: [
"@babel/preset-env",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-export-default-from"[
("@babel/plugin-transform-react-jsx", { pragma: "h" })
]
"@babel/plugin-proposal-export-default-from",
["@babel/plugin-transform-react-jsx", { pragma: "h" }]
]
};

Expand Down

0 comments on commit bfc3cef

Please sign in to comment.