Skip to content

Commit 24b012b

Browse files
committed
build(all) updated packaging for all module types
1 parent 7bc9b6e commit 24b012b

File tree

15 files changed

+7584
-133
lines changed

15 files changed

+7584
-133
lines changed

demo/package-lock.json

Lines changed: 7367 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "gram-demo",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"serve": "serve ./public/",
6+
"parcel": "parcel ./public/index.html --open",
7+
"build": "npx shx cp '../packages/*/dist/*.umd.development.js' public/dist"
8+
},
9+
"author": "Andreas Kollegger",
10+
"license": "ISC",
11+
"devDependencies": {
12+
"gram-ast": "file:../packages/gram-ast",
13+
"parcel-bundler": "^1.12.4",
14+
"serve": "^11.3.2",
15+
"shx": "^0.3.3"
16+
}
17+
}

demo/public/index.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<html>
2+
<head>
3+
4+
</head>
5+
<body>
6+
<h1>gram-demo</h1>
7+
8+
<p>From gram source:</p>
9+
<pre id="src">(you)-[:GREET {message:"hello"}]->(world)</pre>
10+
11+
<p>To parsed AST:</p>
12+
<pre id="ast">parsed AST should appear here</pre>
13+
14+
<p>Back to a string:</p>
15+
<pre id="stringified">stringified AST should appear here</pre>
16+
17+
<script src="./dist/gram-parse.umd.development.js"></script>
18+
<script src="./dist/gram-stringify.umd.development.js"></script>
19+
20+
<script>
21+
window.onload = function () {
22+
console.log(gram);
23+
var src = document.getElementById('src').textContent;
24+
var ast = gram.parse.toAST(src)
25+
document.getElementById("ast").textContent = JSON.stringify(ast,null,2);
26+
document.getElementById("stringified").textContent = gram.stringify.toGram(ast);
27+
}
28+
</script>
29+
</body>
30+
</html>

lerna.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"version": "0.3.1",
33
"packages": [
4-
"packages/*"
4+
"packages/*",
5+
"demo"
56
],
67
"npmClient": "npm"
78
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"clean:lerna": "lerna clean -y",
77
"clean:dist": "shx rm -rf packages/*/dist",
88
"bootstrap": "lerna bootstrap --ignore-scripts",
9-
"build": "lerna run build",
9+
"build": "run-s build:**",
10+
"build:packages": "lerna run build --scope '@gram-data/*'",
11+
"build:demo": "lerna run build --scope gram-demo",
1012
"test": "lerna run test --concurrency 1",
1113
"prepare": "run-s clean build",
1214
"docs": "typedoc",

packages/gram-ast/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
},
1717
"homepage": "https://gram-data.github.io/gram-js/api/modules/gram-ast",
1818
"main": "dist/index.js",
19+
"browser": "dist/gram-ast.umd.production.min.js",
1920
"unpkg": "dist/gram-ast.umd.production.min.js",
2021
"module": "dist/gram-ast.esm.js",
2122
"typings": "dist/index.d.ts",

packages/gram-builder/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
},
1414
"homepage": "https://gram-data.github.io/gram-js/api/modules/gram-builder",
1515
"main": "dist/index.js",
16+
"browser": "dist/gram-builder.umd.production.min.js",
17+
"unpkg": "dist/gram-builder.umd.production.min.js",
18+
"module": "dist/gram-builder.esm.js",
1619
"typings": "dist/index.d.ts",
1720
"files": [
1821
"dist",
@@ -46,7 +49,6 @@
4649
"trailingComma": "es5"
4750
},
4851
"author": "Andreas Kollegger",
49-
"module": "dist/gram-builder.esm.js",
5052
"devDependencies": {
5153
"@types/chalk": "^2.2.0",
5254
"@types/jest": "^26.0.15",

packages/gram-identity/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
"url": "https://github.com/gram-data/gram-js.git"
1313
},
1414
"homepage": "https://gram-data.github.io/gram-js/api/modules/gram-identity",
15+
"author": "Andreas Kollegger",
1516
"main": "dist/index.js",
17+
"browser": "dist/gram-identity.umd.production.min.js",
18+
"unpkg": "dist/gram-identity.umd.production.min.js",
19+
"module": "dist/gram-identity.esm.js",
1620
"typings": "dist/index.d.ts",
1721
"files": [
1822
"dist",
@@ -45,8 +49,6 @@
4549
"singleQuote": true,
4650
"trailingComma": "es5"
4751
},
48-
"author": "Andreas Kollegger",
49-
"module": "dist/gram-identity.esm.js",
5052
"devDependencies": {
5153
"@gram-data/gram-parse": "^0.3.1",
5254
"@types/jest": "^26.0.15",

packages/gram-ops/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
"url": "https://github.com/gram-data/gram-js.git"
1313
},
1414
"homepage": "https://gram-data.github.io/gram-js/api/modules/gram-ops",
15-
"main": "dist/index.js",
16-
"typings": "dist/index.d.ts",
1715
"files": [
1816
"dist",
1917
"src"
@@ -46,7 +44,6 @@
4644
"trailingComma": "es5"
4745
},
4846
"author": "Andreas Kollegger",
49-
"module": "dist/gram-ops.esm.js",
5047
"devDependencies": {
5148
"@types/jest": "^26.0.15",
5249
"@types/unist": "^2.0.3",

packages/gram-parse/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
},
1616
"homepage": "https://gram-data.github.io/gram-js/api/modules/gram-parse",
1717
"main": "dist/index.js",
18+
"browser": "dist/gram-parse.umd.development.min.js",
1819
"unpkg": "dist/gram-parse.umd.production.min.js",
1920
"module": "dist/gram-parse.esm.js",
2021
"typings": "dist/index.d.ts",

0 commit comments

Comments
 (0)