Skip to content

Commit 11435ec

Browse files
authored
Fixed open in colab issue with netlify functions (#223)
* Fixed open in colab issue with netlify functions * Updates * Updated versions for octokit/core, jszip and uuid * Fixes according to community suggestions * Use previous syntax
1 parent d82a79d commit 11435ec

File tree

6 files changed

+349
-650
lines changed

6 files changed

+349
-650
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ __pycache__
88
.vscode
99
*.tar.gz
1010
dist-tests
11-
package-lock.json
11+
package-lock.json
12+
.netlify

functions/colab.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function pushToGitHub(content, filename) {
4040

4141
// This function is the one Netlify function runs on
4242
// https://docs.netlify.com/functions/build-with-javascript/#synchronous-function-format
43-
export async function handler(event, _) {
43+
exports.handler = async function (event, _) {
4444
// event is a JSON object
4545
const data = JSON.parse(event.body)
4646
const zip = new JSZip()

netlify.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
[build]
2+
publish = "./dist"
3+
command = "npx pnpm i --frozen-lockfile --store=node_modules/.pnpm-store && npx pnpm run build"
4+
15
[build.environment]
26
NODE_VERSION = "18"
37
PYTHON_VERSION = "3.8"
48

5-
[build]
6-
publish = "./dist"
7-
command = "npx pnpm i --frozen-lockfile --store=node_modules/.pnpm-store && npx pnpm run build"
8-
functions = "functions"
9+
[dev]
10+
publish = "dist/"
11+
targetPort = 3000
912

1013
[functions]
14+
directory = "functions"
1115
node_bundler = "esbuild"
12-
external_node_modules = ["uuid", "jszip", "@octokit/core"]

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
"lint": "prettier --check . && bash scripts/run_code_style.sh lint",
1313
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
1414
},
15-
"devDependencies": {
15+
"dependencies": {
1616
"@iconify/iconify": "^2.1.2",
17-
"@octokit/core": "^3.5.1",
17+
"@octokit/core": "^4.2.0",
1818
"@types/ejs": "^3.1.0",
1919
"@types/file-saver": "^2.0.5",
2020
"@types/jest": "^27.4.0",
@@ -26,14 +26,14 @@
2626
"execa": "^6.0.0",
2727
"file-saver": "^2.0.5",
2828
"jest": "^27.5.0",
29-
"jszip": "^3.7.1",
29+
"jszip": "^3.10.1",
3030
"playwright-chromium": "^1.18.1",
3131
"prettier": "^2.5.1",
3232
"prismjs": "^1.26.0",
3333
"prompts": "^2.4.2",
3434
"semver": "^7.3.5",
3535
"start-server-and-test": "^1.15.3",
36-
"uuid": "^8.3.2",
36+
"uuid": "^9.0.0",
3737
"vite": "^2.7.13",
3838
"vue": "^3.2.30",
3939
"vue-router": "^4.0.12"

0 commit comments

Comments
 (0)