issue commenthazuki0x0/YuzuBrowser

Hide ad-blocked elements

Please use ``` to escape code that includes @grant.

FluffyDiscord

comment created time in 7 hours

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

[WIP] Remove emulator + shims from testing samples

  */  // [START functions_storage_integration_test]-const childProcess = require('child_process'); const assert = require('assert');+const delay = require('delay');+const execPromise = require('child-process-promise').exec;+const path = require('path');+const supertest = require('supertest'); const uuid = require('uuid'); -it('helloGCS: should print uploaded message', done => {-  const startTime = new Date(Date.now()).toISOString();+const request = supertest(process.env.BASE_URL || 'http://localhost:8080');+const cwd = path.join(__dirname, '..');++it('helloGCS: should print uploaded message', async () => {   const filename = uuid.v4(); // Use a unique filename to avoid conflicts -  // Mock GCS call, as the emulator doesn't listen to GCS buckets-  const data = JSON.stringify({-    name: filename,-    resourceState: 'exists',-    metageneration: '1',-  });--  childProcess.execSync(`functions-emulator call helloGCS --data '${data}'`);--  // Check the emulator's logs-  const logs = childProcess-    .execSync(`functions-emulator logs read helloGCS --start-time ${startTime}`)-    .toString();-  assert.ok(logs.includes(`File ${filename} uploaded.`));-  done();+  const data = {+    data: {+      name: filename,+      resourceState: 'exists',+      metageneration: '1',+    },+  };++  const proc = execPromise(+    `functions-framework --target=helloGCS --signature-type=event`,+    {timeout: 800, shell: true, cwd: cwd}+  );++  await delay(600);

+1. This may produce flaky tests if kept.

ace-n

comment created time in 7 hours

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

[WIP] Remove emulator + shims from testing samples

  */  // [START functions_pubsub_integration_test]-const childProcess = require('child_process'); const assert = require('assert');+const execPromise = require('child-process-promise').exec;+const delay = require('delay');+const path = require('path');+const supertest = require('supertest'); const uuid = require('uuid'); -it('helloPubSub: should print a name', done => {-  const startTime = new Date(Date.now()).toISOString();+const request = supertest(process.env.BASE_URL || 'http://localhost:8080');+const cwd = path.join(__dirname, '..');++it('helloPubSub: should print a name', async () => {   const name = uuid.v4(); -  // Mock Pub/Sub call, as the emulator doesn't listen to Pub/Sub topics   const encodedName = Buffer.from(name).toString('base64');-  const data = JSON.stringify({data: encodedName});-  childProcess.execSync(`functions call helloPubSub --data ${data}`);--  // Check the emulator's logs-  const logs = childProcess-    .execSync(`functions logs read helloPubSub --start-time ${startTime}`)-    .toString();-  assert.strictEqual(logs.includes(`Hello, ${name}!`), true);-  done();-});--it('helloPubSub: should print hello world', done => {-  const startTime = new Date(Date.now()).toISOString();--  // Mock Pub/Sub call, as the emulator doesn't listen to Pub/Sub topics-  childProcess.execSync('functions call helloPubSub --data {}');--  // Check the emulator's logs-  const logs = childProcess-    .execSync(`functions logs read helloPubSub --start-time ${startTime}`)-    .toString();-  assert.strictEqual(logs.includes('Hello, World!'), true);-  done();-});+  const pubsubMessage = {data: {data: encodedName}};++  const proc = execPromise(+    `functions-framework --target=helloPubSub --signature-type=event`,+    {timeout: 800, shell: true, cwd: cwd}+  );++  await delay(600);++  // Send HTTP request simulating Pub/Sub message+  // (GCF translates Pub/Sub messages to HTTP requests internally)+  await request+    .post('/')+    .send(pubsubMessage)+    .expect(204);++  const {stdout} = await proc;+  assert(stdout.includes(`Hello, ${name}!`));+}).timeout(1000);++it('helloPubSub: should print hello world', async () => {+  const pubsubMessage = {};

This is empty and not modified. Why can't it be inlined?

ace-n

comment created time in 7 hours

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

[WIP] Remove emulator + shims from testing samples

  */  // [START functions_pubsub_integration_test]-const childProcess = require('child_process'); const assert = require('assert');+const execPromise = require('child-process-promise').exec;+const delay = require('delay');+const path = require('path');+const supertest = require('supertest'); const uuid = require('uuid'); -it('helloPubSub: should print a name', done => {-  const startTime = new Date(Date.now()).toISOString();+const request = supertest(process.env.BASE_URL || 'http://localhost:8080');+const cwd = path.join(__dirname, '..');++it('helloPubSub: should print a name', async () => {   const name = uuid.v4(); -  // Mock Pub/Sub call, as the emulator doesn't listen to Pub/Sub topics   const encodedName = Buffer.from(name).toString('base64');-  const data = JSON.stringify({data: encodedName});-  childProcess.execSync(`functions call helloPubSub --data ${data}`);--  // Check the emulator's logs-  const logs = childProcess-    .execSync(`functions logs read helloPubSub --start-time ${startTime}`)-    .toString();-  assert.strictEqual(logs.includes(`Hello, ${name}!`), true);-  done();-});--it('helloPubSub: should print hello world', done => {-  const startTime = new Date(Date.now()).toISOString();--  // Mock Pub/Sub call, as the emulator doesn't listen to Pub/Sub topics-  childProcess.execSync('functions call helloPubSub --data {}');--  // Check the emulator's logs-  const logs = childProcess-    .execSync(`functions logs read helloPubSub --start-time ${startTime}`)-    .toString();-  assert.strictEqual(logs.includes('Hello, World!'), true);-  done();-});+  const pubsubMessage = {data: {data: encodedName}};++  const proc = execPromise(

proc is only used once. Remove it.

const {stdout} = await execPromise(

ace-n

comment created time in 7 hours

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

[WIP] Remove emulator + shims from testing samples

  */  // [START functions_pubsub_integration_test]-const childProcess = require('child_process'); const assert = require('assert');+const execPromise = require('child-process-promise').exec;+const delay = require('delay');+const path = require('path');+const supertest = require('supertest'); const uuid = require('uuid'); -it('helloPubSub: should print a name', done => {-  const startTime = new Date(Date.now()).toISOString();+const request = supertest(process.env.BASE_URL || 'http://localhost:8080');+const cwd = path.join(__dirname, '..');++it('helloPubSub: should print a name', async () => {   const name = uuid.v4(); -  // Mock Pub/Sub call, as the emulator doesn't listen to Pub/Sub topics   const encodedName = Buffer.from(name).toString('base64');-  const data = JSON.stringify({data: encodedName});-  childProcess.execSync(`functions call helloPubSub --data ${data}`);--  // Check the emulator's logs-  const logs = childProcess-    .execSync(`functions logs read helloPubSub --start-time ${startTime}`)-    .toString();-  assert.strictEqual(logs.includes(`Hello, ${name}!`), true);-  done();-});--it('helloPubSub: should print hello world', done => {-  const startTime = new Date(Date.now()).toISOString();--  // Mock Pub/Sub call, as the emulator doesn't listen to Pub/Sub topics-  childProcess.execSync('functions call helloPubSub --data {}');--  // Check the emulator's logs-  const logs = childProcess-    .execSync(`functions logs read helloPubSub --start-time ${startTime}`)-    .toString();-  assert.strictEqual(logs.includes('Hello, World!'), true);-  done();-});+  const pubsubMessage = {data: {data: encodedName}};++  const proc = execPromise(+    `functions-framework --target=helloPubSub --signature-type=event`,+    {timeout: 800, shell: true, cwd: cwd}

cwd

ace-n

comment created time in 7 hours

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

[WIP] Remove emulator + shims from testing samples

  // [START functions_http_integration_test] const assert = require('assert');-const Supertest = require('supertest');-const supertest = Supertest(process.env.BASE_URL);+const delay = require('delay');+const execPromise = require('child-process-promise').exec;+const path = require('path');+const supertest = require('supertest');+const uuid = require('uuid');++const request = supertest(process.env.BASE_URL || 'http://localhost:8080');+const cwd = path.join(__dirname, '..');++let ffProc;++before(async () => {+  ffProc = execPromise(+    `functions-framework --target=helloHttp --signature-type=http`,+    {timeout: 1000, shell: true, cwd: cwd}+  );++  await delay(600);+});++after(async () => {+  await ffProc;+});  it('helloHttp: should print a name', async () => {-  await supertest+  const name = uuid.v4();++  await request     .post('/helloHttp')-    .send({name: 'John'})+    .send({name: name})     .expect(200)     .expect(response => {-      assert.strictEqual(response.text, 'Hello John!');+      assert.strictEqual(response.text, `Hello ${name}!`);     });-});+}).timeout(1000);  it('helloHttp: should print hello world', async () => {-  await supertest+  await request     .get('/helloHttp')     .expect(200)     .expect(response => {       assert.strictEqual(response.text, 'Hello World!');     });-});+}).timeout(1000);

Why do we need a timeout? Please comment here if we can't remove it.

ace-n

comment created time in 7 hours

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

[WIP] Remove emulator + shims from testing samples

  // [START functions_http_integration_test] const assert = require('assert');-const Supertest = require('supertest');-const supertest = Supertest(process.env.BASE_URL);+const delay = require('delay');+const execPromise = require('child-process-promise').exec;+const path = require('path');+const supertest = require('supertest');+const uuid = require('uuid');++const request = supertest(process.env.BASE_URL || 'http://localhost:8080');+const cwd = path.join(__dirname, '..');++let ffProc;++before(async () => {+  ffProc = execPromise(+    `functions-framework --target=helloHttp --signature-type=http`,+    {timeout: 1000, shell: true, cwd: cwd}+  );++  await delay(600);+});++after(async () => {+  await ffProc;+});  it('helloHttp: should print a name', async () => {-  await supertest+  const name = uuid.v4();++  await request     .post('/helloHttp')-    .send({name: 'John'})+    .send({name: name})     .expect(200)     .expect(response => {-      assert.strictEqual(response.text, 'Hello John!');+      assert.strictEqual(response.text, `Hello ${name}!`);     });-});+}).timeout(1000);

Why do we need a timeout? Please comment here if we can't remove it.

ace-n

comment created time in 7 hours

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

[WIP] Remove emulator + shims from testing samples

  // [START functions_http_integration_test] const assert = require('assert');-const Supertest = require('supertest');-const supertest = Supertest(process.env.BASE_URL);+const delay = require('delay');+const execPromise = require('child-process-promise').exec;+const path = require('path');+const supertest = require('supertest');+const uuid = require('uuid');++const request = supertest(process.env.BASE_URL || 'http://localhost:8080');+const cwd = path.join(__dirname, '..');++let ffProc;++before(async () => {+  ffProc = execPromise(+    `functions-framework --target=helloHttp --signature-type=http`,+    {timeout: 1000, shell: true, cwd: cwd}+  );++  await delay(600);+});++after(async () => {+  await ffProc;+});  it('helloHttp: should print a name', async () => {-  await supertest+  const name = uuid.v4();++  await request     .post('/helloHttp')-    .send({name: 'John'})+    .send({name: name})

.send({name})

ace-n

comment created time in 7 hours

push eventgoogle/clasp

Grant Timmerman

commit sha a61a598294c4778a80644fa08fe74eec7f174cc4

Update README.md Updates after scanning the parameters.

view details

push time in 20 hours

issue openedfirebase/firebase-tools

Remove `@google-cloud/functions-emulator`

<!-- DO NOT DELETE validate_template=true template_path=.github/ISSUE_TEMPLATE/bug_report.md -->

Environment info

firebase-tools@6.7.1 has an optional dependency on @google-cloud/functions-emulator. This should be removed and optionally be replaced with @google-cloud/functions-framework.

This should be done by Node 6 EOL: 2019-04-30.

firebase-tools: master: (d67ecfadcc024763ea4efcba87849e6af7064d38)

Platform: All platforms

Steps to reproduce

  • View package.json: https://github.com/firebase/firebase-tools/blob/master/package.json#L139
  • Observe a dependency on @google-cloud/functions-emulator.

Expected behavior

  • There should be no references to @google-cloud/functions-emulator in this codebase on master.
  • Optionally, a replacement could be made, an internal fork of the repo, or other.

Actual behavior

CC: @thechenky

created time in a day

pull request commentgoogle/clasp

added CREATE_SCRIPT_QUESTION

Thanks!

PrzeOr82

comment created time in a day

push eventgoogle/clasp

Przemek

commit sha 9f3b31b7bf40945bf51946334c355ee760f7218a

added CREATE_SCRIPT_QUESTION (#602)

view details

push time in a day

PR merged google/clasp

added CREATE_SCRIPT_QUESTION cla: yes

Fixes #578

  • [] npm run test succeeds.
  • [+] npm run lint succeeds.
  • [ ] Appropriate changes to README are included in PR.
+4 -3

3 comments

3 changed files

PrzeOr82

pr closed time in a day

issue closedgoogle/clasp

No CREATE_SCRIPT_QUESTION, only CLONE_SCRIPT_QUESTION

Expected Behavior

When you create a new script, we shouldn't prompt Clone which script?

Actual Behavior

We display CLONE_SCRIPT_QUESTION.

Solution

Print CREATE_SCRIPT_QUESTION (doesn't exist yet)

closed time in a day

grant

delete branch gsuitedevs/browser-samples

delete branch : grant_picker

delete time in 2 days

push eventgrant/grant.cm

Grant Timmerman

commit sha 89b033f8e11b17e3e10e776fb25b04977d970865

feat: Remove opacity changes

view details

push time in 4 days

issue commentGoogleCloudPlatform/cloud-functions-emulator

ERROR: TypeError: google.discoverAPI is not a function on functions start

The beta 6 update just removes the Node 6 warning so the Firebase CLI won't show the warning either. This was a request by the Firebase CLI team.

davidwallen

comment created time in 5 days

issue openedgrant/dotfiles

Cloud Shell SSH Key

ssh-add ~/.ssh/google_compute_engine

created time in 5 days

push eventgrant/dotfiles

Grant Timmerman

commit sha 3e945616cf4e59069236024c31eeb8b26e78fe40

Add Cloud Shell

view details

push time in 5 days

issue commentGoogleCloudPlatform/functions-framework-nodejs

What is the difference between Functions Framework and Cloud Functions Emulator?

As stated in the README:

The Node.js 10 runtime on Google Cloud Functions is based on the Functions Framework. On Cloud Functions, the Functions Framework is completely optional: if you don't add it to your package.json, it will be installed automatically.

The Emulator tries to mimic this logic but is completely separate from the runtime that is used by Cloud Functions.

mishushakov

comment created time in 5 days

push eventgrant/talks

Grant Timmerman

commit sha 1dce36f19dbba7db4d06d53a3b8bcf58ce6a7009

Update tips.md

view details

push time in 6 days

delete branch grant/docs

delete branch : patch-1

delete time in 6 days

push eventgrant/talks

Grant Timmerman

commit sha 744f739c381c38e20cae57cec4fef6e25467f7b4

Update README.md

view details

push time in 6 days

push eventgrant/talks

Grant Timmerman

commit sha 01dc4d315e8ccbc98fb09fcc9f8de86f59c5b771

Add next talk dates

view details

push time in 6 days

PR opened knative/docs

docs: Remove `--save` from `npm install`

Proposed Changes

  • Remove --save from npm install script.

See https://stackoverflow.com/a/19578808

+1 -1

0 comment

1 changed file

pr created time in 6 days

push eventgrant/docs

Grant Timmerman

commit sha abdbb0d1e1ed2fa5e62f35a8597fb9eb189bc9de

docs: Remove `--save` from `npm install` See https://stackoverflow.com/a/19578808

view details

push time in 6 days

fork grant/docs

User documentation for Knative components

fork in 6 days

pull request commentGoogleCloudPlatform/functions-framework-nodejs

docs(README): Replace --target with --function-target

Please create an issue before a PR.

It looks like we need to publish to npm for the README instructions to be correct.

You're looking at the previous version on npm. master in this repo has instructions.


We should publish the npm package after merging commits @swalkowski.

anishkny

comment created time in 6 days

push eventgrant/functions-framework-java

Grant Timmerman

commit sha 8c4739393ea54009c6a2e2bdfd662da1720136a0

fix: Remove JDK 9

view details

push time in 6 days

create barnchgrant/functions-framework-java

branch : grant_gitignore

created branch time in 6 days

PR opened GoogleCloudPlatform/functions-framework-java

feat: Add Travis

Adds Travis support to this repo. Currently just ensures the repo builds.

+10 -1

0 comment

2 changed files

pr created time in 6 days

create barnchgrant/functions-framework-java

branch : grant_travis

created branch time in 6 days

startedsindresorhus/np

started time in 6 days

fork grant/functions-framework-java

FaaS (Function as a service) framework for writing portable Java functions

fork in 6 days

startedGoogleCloudPlatform/functions-framework-java

started time in 6 days

push eventgoogle/clasp

Grant Timmerman

commit sha cdd2c814f01b8a8020654fc34ce0591d6d77898b

Prettier README for npm install

view details

push time in 7 days

pull request commentgsuitedevs/md2googleslides

Major refactoring -- migrate to TypeScript, reorganize code

This is awesome!

sqrrrl

comment created time in 7 days

MemberEvent

issue commentgsuitedevs/browser-samples

Add Drive Picker samples

See pending PR.

grant

comment created time in 7 days

PR opened gsuitedevs/browser-samples

feat: Add Drive Picker samples (Fixes #9)

Copied from https://developers.google.com/picker/docs/

  • Adds 2 HTML files for Drive Picker (not the Java files)
  • Adds region tags
  • Fixes htmllint issues mentioned below
drive/picker/driveitems.html: line 20, col 5, tag attributes are malformed
drive/picker/helloworld.html: line 20, col 5, tag attributes are malformed
+205 -0

0 comment

2 changed files

pr created time in 7 days

push eventgsuitedevs/browser-samples

Grant Timmerman

commit sha 9d4eeb59adfb6327efe1576cd6f31fe3a84759d5

docs: Update year (2019)

view details

push time in 7 days

create barnchgsuitedevs/browser-samples

branch : grant_picker

created branch time in 7 days

pull request commentgoogle/clasp

Add People API support

Do you want to close this PR until #512 is fixed?

tawAsh1

comment created time in 7 days

issue commentGoogleCloudPlatform/cloud-functions-emulator

ERROR: TypeError: google.discoverAPI is not a function on functions start

1.0.0-beta.6 has been unpublished. Can you try installing the Firebase CLI an trying again for that issue?

Note that this issue still exists with this GitHub repo.

davidwallen

comment created time in 7 days

fork grant/firebase-tools

The Firebase Command Line Tools

fork in 7 days

fork grant/firebase-tools

The Firebase Command Line Tools

fork in 7 days

issue commentGoogleCloudPlatform/cloud-functions-emulator

ERROR: TypeError: google.discoverAPI is not a function on functions start

OK. I was able to reproduce this error by following the quickstart in the README.md. I'm not sure of the issue, but I'm guessing there's a problem with the Google API Client dependency.

https://github.com/GoogleCloudPlatform/cloud-functions-emulator/blob/6dbd88345f6f7d129644d2547d949aaf36897fd0/src/client/rest-client.js#L112

davidwallen

comment created time in 7 days

delete branch GoogleCloudPlatform/functions-framework-nodejs

delete branch : grant_remove_function_prefix

delete time in 7 days

pull request commentGoogleCloudPlatform/cloud-functions-emulator

Update Node.js version warning message

Note: This change has been published.

laurenzlong

comment created time in 8 days

issue closedGoogleCloudPlatform/cloud-functions-emulator

When release 1.0.0-beta.6 ?

Many fixes are already merged into master branch, but these are not released. A firebase-tools requires cloud-functions-emulator, and it always show info logs because #287 is not released...

CHANGELOG.md will be changed as following:

##### 1.0.0-beta.6 - XX XXX 2019

###### Bug fixes
- [#287](https://github.com/GoogleCloudPlatform/cloud-functions-emulator/pull/287) - Update engines requirement
- [#286](https://github.com/GoogleCloudPlatform/cloud-functions-emulator/pull/286) - Add support for Firebase Remote Config events
- [#210](https://github.com/GoogleCloudPlatform/cloud-functions-emulator/issues/210) - "logs" location is not writable if node.js is installed via a package manager
- [#207](https://github.com/GoogleCloudPlatform/cloud-functions-emulator/issues/207) - Hot reloading does not work for subdirectories in Linux
- [#204](https://github.com/GoogleCloudPlatform/cloud-functions-emulator/pull/204) - Inspect fails when the supervisor is running on an unexpected port.
- [#199](https://github.com/GoogleCloudPlatform/cloud-functions-emulator/pull/199) - Handle missing logfiles correctly

###### Other
- Updated dependencies
- Fix documents and help messages

Thanks.

closed time in 8 days

rika-t

created tagGoogleCloudPlatform/cloud-functions-emulator

tag1.0.0-beta.6

A local emulator for deploying, running, and debugging Google Cloud Functions.

created time in 8 days

issue commentGoogleCloudPlatform/cloud-functions-emulator

When release 1.0.0-beta.6 ?

Working on this. I'll track publishing here.

npm version prerelease --preid="beta.6"
rika-t

comment created time in 8 days

push eventGoogleCloudPlatform/cloud-functions-emulator

Goran Gligorin

commit sha 098e253188d8caa706da08350483468d60f0c049

Update Node version warning message for emulator (#315)

view details

push time in 8 days

PR merged GoogleCloudPlatform/cloud-functions-emulator

Reviewers
Update Node version warning message for emulator cla: yes

In addition to https://github.com/GoogleCloudPlatform/cloud-functions-emulator/pull/261 this now fully fixes #292.

  • [ ] Tests and linter pass
  • [ ] Code coverage does not decrease (if any source code was changed)
  • [ ] Appropriate docs were updated (if necessary)
+3 -2

2 comments

1 changed file

gligoran

pr closed time in 8 days

push eventgligoran/cloud-functions-emulator

Grant Timmerman

commit sha 2c36bdc4fa97032f03c4284e0d6ed3f246ed6e52

Update renovate.json (#312)

view details

Myles Borins

commit sha 3cae45bb8c396008413d8c23d5f1a0634fce50c9

doc: update runtime version error (#320) Explicitly state the emulator Node version support.

view details

Grant Timmerman

commit sha 8d613f5e7d173dbb41033e01a1a755b588a2ef98

Merge branch 'master' into patch-1

view details

push time in 8 days

pull request commentGoogleCloudPlatform/cloud-functions-emulator

Update Node version warning message for emulator

This PR has a merge conflict.

gligoran

comment created time in 8 days

issue commentGoogleCloudPlatform/functions-framework-nodejs

nodejs10 runtime doesn't work with .yarnrc yarn-path

You can write bugs for the runtime here: https://cloud.google.com/support/docs/issue-trackers

  • Cloud Functions
  • Cloud SDK

That issue looks like a yarn issue, not related to the functions framework (workspace/bin/yarn-1.13.0/yarn.js').

istarkov

comment created time in 8 days

Pull request review commentGoogleCloudPlatform/functions-framework-nodejs

fix #4: Removes 'function' prefix from CLI arg and env vars

 // limitations under the License.  import * as assert from 'assert';-import * as supertest from 'supertest'; import * as express from 'express';- import * as invoker from '../src/invoker';+import * as supertest from 'supertest';

IDE auto-sorted.

grant

comment created time in 8 days

Pull request review commentGoogleCloudPlatform/functions-framework-nodejs

fix #4: Removes 'function' prefix from CLI arg and env vars

 import * as bodyParser from 'body-parser'; import * as domain from 'domain'; import * as express from 'express';-import * as onFinished from 'on-finished'; import * as http from 'http';+import * as onFinished from 'on-finished';

IDE auto-sorted.

grant

comment created time in 8 days

push eventGoogleCloudPlatform/functions-framework-nodejs

Grant Timmerman

commit sha e4230b700dfa87695b452e197b6705b9f896b9ab

fix: Update FUNCTION_ prefix for env var but not consts

view details

push time in 8 days

Pull request review commentGoogleCloudPlatform/functions-framework-nodejs

fix #4: Removes 'function' prefix from CLI arg and env vars

 //     unmarshalled from an incoming request.  import * as minimist from 'minimist';+ import {   ErrorHandler,   FunctionSignatureType,   getServer,   getUserFunction, } from './invoker'; +// Supported command-line flags+const FLAG = {+  PORT: 'port',+  TARGET: 'target',+  SIGNATURE_TYPE: 'signature-type', // dash+};++// Supported environment variables+const ENV = {+  PORT: 'PORT',+  TARGET: 'TARGET',

Yes. Agreed. Not sure why I changed this. Reverted the FUNCTION_ prefix for these env vars.

grant

comment created time in 8 days

Pull request review commentGoogleCloudPlatform/functions-framework-nodejs

fix #4: Removes 'function' prefix from CLI arg and env vars

 //     unmarshalled from an incoming request.  import * as minimist from 'minimist';+ import {   ErrorHandler,   FunctionSignatureType,   getServer,   getUserFunction, } from './invoker'; +// Supported command-line flags+const FLAG = {+  PORT: 'port',+  TARGET: 'target',+  SIGNATURE_TYPE: 'signature-type', // dash+};++// Supported environment variables+const ENV = {+  PORT: 'PORT',+  TARGET: 'TARGET',+  SIGNATURE_TYPE: 'SIGNATURE_TYPE', // underscore+};+ enum NodeEnv {   PRODUCTION = 'production', }  const argv = minimist(process.argv, {-  string: ['port', 'function-target', 'function-signature-type'],+  string: [FLAG.PORT, FLAG.TARGET, FLAG.SIGNATURE_TYPE], });  const CODE_LOCATION = process.cwd();-const PORT = argv['port'] || process.env.PORT || '8080';-const FUNCTION_TARGET =-  argv['function-target'] || process.env.FUNCTION_TARGET || 'function';+const PORT = argv[FLAG.PORT] || process.env[ENV.PORT] || '8080';+const TARGET = argv[FLAG.TARGET] || process.env[ENV.TARGET] || 'function';  const FUNCTION_SIGNATURE_TYPE_STRING =-  argv['function-signature-type'] ||-  process.env.FUNCTION_SIGNATURE_TYPE ||-  'http';+  argv[FLAG.SIGNATURE_TYPE] || process.env[ENV.SIGNATURE_TYPE] || 'http'; const FUNCTION_SIGNATURE_TYPE =

Done.

grant

comment created time in 8 days

Pull request review commentGoogleCloudPlatform/functions-framework-nodejs

fix #4: Removes 'function' prefix from CLI arg and env vars

 //     unmarshalled from an incoming request.  import * as minimist from 'minimist';+ import {   ErrorHandler,   FunctionSignatureType,   getServer,   getUserFunction, } from './invoker'; +// Supported command-line flags+const FLAG = {+  PORT: 'port',+  TARGET: 'target',+  SIGNATURE_TYPE: 'signature-type', // dash+};++// Supported environment variables+const ENV = {+  PORT: 'PORT',+  TARGET: 'TARGET',+  SIGNATURE_TYPE: 'SIGNATURE_TYPE', // underscore+};+ enum NodeEnv {   PRODUCTION = 'production', }  const argv = minimist(process.argv, {-  string: ['port', 'function-target', 'function-signature-type'],+  string: [FLAG.PORT, FLAG.TARGET, FLAG.SIGNATURE_TYPE], });  const CODE_LOCATION = process.cwd();-const PORT = argv['port'] || process.env.PORT || '8080';-const FUNCTION_TARGET =-  argv['function-target'] || process.env.FUNCTION_TARGET || 'function';+const PORT = argv[FLAG.PORT] || process.env[ENV.PORT] || '8080';+const TARGET = argv[FLAG.TARGET] || process.env[ENV.TARGET] || 'function';  const FUNCTION_SIGNATURE_TYPE_STRING =

This request is getting out of scope, but I've changed it as I agree.

grant

comment created time in 8 days

push eventgrant/grant.cm

Grant Timmerman

commit sha 2b9670d0ce49c6881d27218697c8ab0bf16986a3

Remove G+

view details

push time in 9 days

issue closedgrant/ts2gas

Typescript 3.4 support

(requires change in package.json and additional test cases)

closed time in 9 days

PopGoesTheWza

issue commentgrant/ts2gas

Typescript 3.4 support

See 3.4.3.

PopGoesTheWza

comment created time in 9 days

delete branch grant/ts2gas

delete branch : grant-travis-npm-i

delete time in 9 days

push eventgrant/ts2gas

Grant Timmerman

commit sha 2f4f32a79a2f2929bf2fe41c54fa5c1f4c8dc7cd

Update .travis.yml

view details

Grant Timmerman

commit sha d2afa93d76712d72339dd5ef1f0bd168fbc444eb

Merge pull request #37 from grant/grant-travis-npm-i Update .travis.yml

view details

push time in 9 days

PR merged grant/ts2gas

Update .travis.yml
+1 -1

0 comment

1 changed file

grant

pr closed time in 9 days

PR opened grant/ts2gas

Update .travis.yml
+1 -1

0 comment

1 changed file

pr created time in 9 days

create barnchgrant/ts2gas

branch : grant-travis-npm-i

created branch time in 9 days

release grant/ts2gas

v3.4.3

released time in 9 days

push eventgrant/ts2gas

Grant Timmerman

commit sha af3d7077671628ec2f77bcd459ee9a3b88cb7165

3.4.3

view details

push time in 9 days

created taggrant/ts2gas

tagv3.4.3

A function that transpiles TypeScript to Google Apps Script.

created time in 9 days

push eventgrant/ts2gas

Grant Timmerman

commit sha 7984e92aaa3c818b15288f5a52b176afd993b5da

Bump TypeScript to 3.4.3

view details

push time in 9 days

push eventgrant/ts2gas

Grant Timmerman

commit sha c8164a28c71548af11064544a4ef17c72c4273ed

Remove yarn lock, keep package-lock

view details

push time in 9 days

push eventgrant/ts2gas

PopGoesTheWza

commit sha 7dc7014fed7a72ba3c18b7ddf9fdadc70fb9b77f

Merge pull request #15 from grant/master Merge pull request #34 from PopGoesTheWza/master

view details

PopGoesTheWza

commit sha ad4402d22c0ea808395bf95a38323107a7ad06b7

TS 3.4 support

view details

PopGoesTheWza

commit sha 2493d7a34aaaf3d7f0b028c8ecc786e95db8ff8c

Merge branch 'master' of https://github.com/PopGoesTheWza/ts2gas

view details

PopGoesTheWza

commit sha 3ffd2bba6f93a889069f68cf1b3c115e7cdb0677

comment fix

view details

PopGoesTheWza

commit sha 88d17bd874ab04494b77f1c59aa4a706c67eb437

Commented out parts which crashes ts.transpileModule

view details

PopGoesTheWza

commit sha bf2a8d7f6bfd681732f4fee5926ef10d794e864c

comment on expected ts 3.5 fix

view details

Grant Timmerman

commit sha 12815ea112e295566b2e76a2c01b5911d9a19dda

Merge pull request #36 from PopGoesTheWza/master (WIP) Typescript 3.4 support

view details

push time in 9 days

PR merged grant/ts2gas

(WIP) Typescript 3.4 support

Reference issue #35

Typescript 3.4 introduces new features:

  • Higher order function type inference
  • Improved support for read-only arrays and tuples
  • Const contexts for literal expressions
  • globalThis

package.json needs be either "typescript": "^3.4.0" or "typescript": "^3.*.*"

in test.ts the following test cases (checked if passed)

  • [x] testTypeScript_34x_highOrder Higher order function type inference
  • [x] testTypeScript_34x_improvedReadonly Improved support for read-only arrays and tuples
  • [x] testTypeScript_34x_constContext Const contexts for literal expressions
  • [x] testTypeScript_34x_globalThis globalThis

Detailed test cases input/output:

# testTypeScript_34x_highOrder
v--TS--v
// Higher order function type inference
declare function pipe<A extends any[], B, C>(ab: (...args: A) => B, bc: (b: B) => C): (...args: A) => C;

declare function list<T>(a: T): T[];
declare function box<V>(x: V): { value: V };

const listBox = pipe(list, box);  // <T>(a: T) => { value: T[] }
const boxList = pipe(box, list);  // <V>(x: V) => { value: V }[]

const x1 = listBox(42);  // { value: number[] }
const x2 = boxList('hello');  // { value: string }[]

const flip = <A, B, C>(f: (a: A, b: B) => C) => (b: B, a: A) => f(a, b);
const zip = <T, U>(x: T, y: U): [T, U] => [x, y];
const flipped = flip(zip);  // <T, U>(b: U, a: T) => [T, U]

const t1 = flipped(10, 'hello');  // [string, number]
const t2 = flipped(true, 0);  // [number, boolean]
–––
// Compiled using ts2gas 1.6.2 (TypeScript 3.4.1)
var exports = exports || {};
var module = module || { exports: exports };
var listBox = pipe(list, box); // <T>(a: T) => { value: T[] }
var boxList = pipe(box, list); // <V>(x: V) => { value: V }[]
var x1 = listBox(42); // { value: number[] }
var x2 = boxList('hello'); // { value: string }[]
var flip = function (f) { return function (b, a) { return f(a, b); }; };
var zip = function (x, y) { return [x, y]; };
var flipped = flip(zip); // <T, U>(b: U, a: T) => [T, U]
var t1 = flipped(10, 'hello'); // [string, number]
var t2 = flipped(true, 0); // [number, boolean]
 ^--GS--^
  • Type inference happens within the editor. Test case is to ensure output code is correct.
# testTypeScript_34x_improvedReadonly
v--TS--v
// Improved support for read-only arrays and tuples
function f1(mt: [number, number], rt: readonly [number, number]) {
  mt[0] = 1;  // Ok
  // rt[0] = 1;  // Error, read-only element
}

// function f2(ma: string[], ra: readonly string[], mt: [string, string], rt: readonly [string, string]) {
//   ma = ra;  // Error
//   ma = mt;  // Ok
//   ma = rt;  // Error
//   ra = ma;  // Ok
//   ra = mt;  // Ok
//   ra = rt;  // Ok
//   mt = ma;  // Error
//   mt = ra;  // Error
//   mt = rt;  // Error
//   rt = ma;  // Error
//   rt = ra;  // Error
//   rt = mt;  // Ok
// }

type ReadWrite<T> = { -readonly [P in keyof T] : T[P] };

type T0 = Readonly<string[]>;  // readonly string[]
type T1 = Readonly<[number, number]>;  // readonly [number, number]
type T2 = Partial<Readonly<string[]>>;  // readonly (string | undefined)[]
type T3 = Readonly<Partial<string[]>>;  // readonly (string | undefined)[]
type T4 = ReadWrite<Required<T3>>;  // string[]
–––
// Compiled using ts2gas 1.6.2 (TypeScript 3.4.1)
var exports = exports || {};
var module = module || { exports: exports };
// Improved support for read-only arrays and tuples
function f1(mt, rt) {
    mt[0] = 1; // Ok
    // rt[0] = 1;  // Error, read-only element
}
 ^--GS--^
  • Part of test case has to be commented out in order not to crash. A Typescript has been opened
# testTypeScript_34x_constContext
v--TS--v
// Const contexts for literal expressions
let x = 10 as const;  // Type 10
let y = <const> [10, 20];  // Type readonly [10, 20]
let z = { text: "hello" } as const;  // Type { readonly text: "hello" }
–––
// Compiled using ts2gas 1.6.2 (TypeScript 3.4.1)
var exports = exports || {};
var module = module || { exports: exports };
// Const contexts for literal expressions
var x = 10; // Type 10
var y = [10, 20]; // Type readonly [10, 20]
var z = { text: "hello" }; // Type { readonly text: "hello" }
 ^--GS--^
  • Const context happens within the editor. Test case is to ensure output code is correct.
# testTypeScript_34x_globalThis
v--TS--v
// `globalThis`
// Add globalThis
// @Filename: one.ts
var a = 1;
var b = 2;
// @Filename: two.js
this.c = 3;
const total = globalThis.a + this.b + window.c + this.unknown;
–––
// Compiled using ts2gas 1.6.2 (TypeScript 3.4.1)
var exports = exports || {};
var module = module || { exports: exports };
// `globalThis`
// Add globalThis
// @Filename: one.ts
var a = 1;
var b = 2;
// @Filename: two.js
this.c = 3;
var total = globalThis.a + this.b + window.c + this.unknown;
 ^--GS--^
  • No error when producing output code. Adding polyfill/shim is to be done by the user
+73 -1

2 comments

2 changed files

PopGoesTheWza

pr closed time in 9 days

Pull request review commentGoogleCloudPlatform/functions-framework-nodejs

fix #4: Removes 'function' prefix from CLI arg and env vars

 //     unmarshalled from an incoming request.  import * as minimist from 'minimist';+ import {   ErrorHandler,   FunctionSignatureType,   getServer,   getUserFunction, } from './invoker'; +// Supported command-line flags+const FLAG = {+  PORT: 'port',+  TARGET: 'target',+  SIGNATURE_TYPE: 'signature-type', // dash+};++// Supported environment variables+const ENV_VARIABLE = {+  PORT: 'FUNCTION_PORT',+  TARGET: 'FUNCTION_TARGET',+  SIGNATURE_TYPE: 'FUNCTION_SIGNATURE_TYPE', // underscore+};+ enum NodeEnv {   PRODUCTION = 'production', }  const argv = minimist(process.argv, {-  string: ['port', 'function-target', 'function-signature-type'],+  string: [ENV_VARIABLE.PORT, FLAG.TARGET, FLAG.SIGNATURE_TYPE], });  const CODE_LOCATION = process.cwd();-const PORT = argv['port'] || process.env.PORT || '8080';+const PORT =+  argv[ENV_VARIABLE.PORT] || process.env[ENV_VARIABLE.PORT] || '8080';

Fixed.

grant

comment created time in 9 days

Pull request review commentGoogleCloudPlatform/functions-framework-nodejs

fix #4: Removes 'function' prefix from CLI arg and env vars

 //     unmarshalled from an incoming request.  import * as minimist from 'minimist';+ import {   ErrorHandler,   FunctionSignatureType,   getServer,   getUserFunction, } from './invoker'; +// Supported command-line flags+const FLAG = {+  PORT: 'port',+  TARGET: 'target',+  SIGNATURE_TYPE: 'signature-type', // dash+};++// Supported environment variables+const ENV_VARIABLE = {+  PORT: 'FUNCTION_PORT',+  TARGET: 'FUNCTION_TARGET',+  SIGNATURE_TYPE: 'FUNCTION_SIGNATURE_TYPE', // underscore+};+ enum NodeEnv {   PRODUCTION = 'production', }  const argv = minimist(process.argv, {-  string: ['port', 'function-target', 'function-signature-type'],+  string: [ENV_VARIABLE.PORT, FLAG.TARGET, FLAG.SIGNATURE_TYPE], });  const CODE_LOCATION = process.cwd();-const PORT = argv['port'] || process.env.PORT || '8080';+const PORT =+  argv[ENV_VARIABLE.PORT] || process.env[ENV_VARIABLE.PORT] || '8080'; const FUNCTION_TARGET =

Dropped the FUNCTION_ prefix.

grant

comment created time in 9 days

Pull request review commentGoogleCloudPlatform/functions-framework-nodejs

fix #4: Removes 'function' prefix from CLI arg and env vars

 //     unmarshalled from an incoming request.  import * as minimist from 'minimist';+ import {   ErrorHandler,   FunctionSignatureType,   getServer,   getUserFunction, } from './invoker'; +// Supported command-line flags+const FLAG = {+  PORT: 'port',+  TARGET: 'target',+  SIGNATURE_TYPE: 'signature-type', // dash+};++// Supported environment variables+const ENV_VARIABLE = {+  PORT: 'FUNCTION_PORT',+  TARGET: 'FUNCTION_TARGET',+  SIGNATURE_TYPE: 'FUNCTION_SIGNATURE_TYPE', // underscore+};+ enum NodeEnv {   PRODUCTION = 'production', }  const argv = minimist(process.argv, {-  string: ['port', 'function-target', 'function-signature-type'],+  string: [ENV_VARIABLE.PORT, FLAG.TARGET, FLAG.SIGNATURE_TYPE], });  const CODE_LOCATION = process.cwd();-const PORT = argv['port'] || process.env.PORT || '8080';+const PORT =+  argv[ENV_VARIABLE.PORT] || process.env[ENV_VARIABLE.PORT] || '8080'; const FUNCTION_TARGET =-  argv['function-target'] || process.env.FUNCTION_TARGET || 'function';+  argv[FLAG.TARGET] || process.env[ENV_VARIABLE.TARGET] || 'function';  const FUNCTION_SIGNATURE_TYPE_STRING =-  argv['function-signature-type'] ||-  process.env.FUNCTION_SIGNATURE_TYPE ||-  'http';+  argv[FLAG.SIGNATURE_TYPE] || process.env.FUNCTION_SIGNATURE_TYPE || 'http';

Done.

grant

comment created time in 9 days

Pull request review commentGoogleCloudPlatform/functions-framework-nodejs

fix #4: Removes 'function' prefix from CLI arg and env vars

 //     unmarshalled from an incoming request.  import * as minimist from 'minimist';+ import {   ErrorHandler,   FunctionSignatureType,   getServer,   getUserFunction, } from './invoker'; +// Supported command-line flags+const FLAG = {+  PORT: 'port',+  TARGET: 'target',+  SIGNATURE_TYPE: 'signature-type', // dash+};++// Supported environment variables+const ENV_VARIABLE = {+  PORT: 'FUNCTION_PORT',+  TARGET: 'FUNCTION_TARGET',+  SIGNATURE_TYPE: 'FUNCTION_SIGNATURE_TYPE', // underscore

Done.

grant

comment created time in 9 days

Pull request review commentGoogleCloudPlatform/functions-framework-nodejs

fix #4: Removes 'function' prefix from CLI arg and env vars

 //     unmarshalled from an incoming request.  import * as minimist from 'minimist';+ import {   ErrorHandler,   FunctionSignatureType,   getServer,   getUserFunction, } from './invoker'; +// Supported command-line flags+const FLAG = {+  PORT: 'port',+  TARGET: 'target',+  SIGNATURE_TYPE: 'signature-type', // dash+};++// Supported environment variables+const ENV_VARIABLE = {+  PORT: 'FUNCTION_PORT',

Done.

grant

comment created time in 9 days

push eventGoogleCloudPlatform/functions-framework-nodejs

Grant Timmerman

commit sha 12e978cee01597b4ae950c2420e609fd4896a49d

fix: Fix flag/env setup

view details

Grant Timmerman

commit sha 8c25e1b178e0487c0eaff7929f9241bc4b607fe9

fix: docs comment

view details

Grant Timmerman

commit sha 49e0dd350c9ca894eeb84b59027b5e6446791542

Merge

view details

push time in 9 days

create barnchgrant/functions-framework-nodejs

branch : grant_remove_function_prefix

created branch time in 9 days

Pull request review commentGoogleCloudPlatform/functions-framework-nodejs

fix #4: Removes 'function' prefix from CLI arg and env vars

 //     unmarshalled from an incoming request.  import * as minimist from 'minimist';+ import {   ErrorHandler,   FunctionSignatureType,   getServer,   getUserFunction, } from './invoker'; +// Supported command-line flags+const FLAG = {+  PORT: 'port',+  TARGET: 'target',+  SIGNATURE_TYPE: 'signature-type', // dash+};++// Supported environment variables+const ENV_VARIABLE = {+  PORT: 'FUNCTION_PORT',+  TARGET: 'FUNCTION_TARGET',+  SIGNATURE_TYPE: 'FUNCTION_SIGNATURE_TYPE', // underscore+};+ enum NodeEnv {   PRODUCTION = 'production', }  const argv = minimist(process.argv, {-  string: ['port', 'function-target', 'function-signature-type'],+  string: [ENV_VARIABLE.PORT, FLAG.TARGET, FLAG.SIGNATURE_TYPE],

Done.

grant

comment created time in 9 days

delete branch GoogleCloudPlatform/nodejs-docs-samples

delete branch : grant-functions-cors

delete time in 9 days

push eventGoogleCloudPlatform/nodejs-docs-samples

Grant Timmerman

commit sha 25828a106a4eb407d4efb724e6fb39713e79c57b

refactor: Remove duplicate CORS header (#1242)

view details

push time in 9 days

PR merged GoogleCloudPlatform/nodejs-docs-samples

Reviewers
refactor: Remove duplicate CORS header cla: yes

The following line is duplicate in the sample. The response header is already set on line 247.

res.set('Access-Control-Allow-Origin', '*');

Like the other sample, it should not be in the

if (req.method === 'OPTIONS') {

conditional block.

Doc: https://cloud.google.com/functions/docs/writing/http#handling_cors_requests

+0 -2

0 comment

1 changed file

grant

pr closed time in 9 days

push eventgoogle/clasp

Grant Timmerman

commit sha 9ec97cb01dba87039aa0c23c00ae9b65b6f7b850

Create docs/ README.md

view details

push time in 11 days

pull request commentgoogleapis/google-api-nodejs-client

feat: run the generator

Glad nobody noticed the Cloud Run API last week ;)

JustinBeckwith

comment created time in 12 days

push eventGoogleCloudPlatform/functions-framework-nodejs

Grant Timmerman

commit sha ef41c443b49bcff856ba12ffc03bdd51fd693f99

fix: Re-add 'FUNCTION_' to env var prefix

view details

push time in 12 days

issue commentGoogleCloudPlatform/functions-framework-nodejs

Flags use an unnecessary `function-` prefix

Thanks for the issue. See the pending PR referenced above.

steren

comment created time in 13 days

PR opened GoogleCloudPlatform/functions-framework-nodejs

Reviewers
fix #4: Removes 'function' prefix from CLI arg and env vars

Fixes #4.

  • Removes redundant function from CLI/env vars for target and signature-type
  • Updates docs
  • Moves string literals into constants to reduce renaming multiple pieces of code and clearly define the library interface in 1 place.
+25 -11

0 comment

2 changed files

pr created time in 13 days

issue commentGoogleCloudPlatform/cloud-functions-emulator

Node 8 Runtime support

Hey all, As @r00tat mentioned, we've released the functions framework for Node 10. This is the underlying framework used for both deployed cloud functions in GCF Node 10 and can be used for local development.

The team and I will be working on enhancing the developer experience there for Node. We'd love your issues and questions on local development in that repo.

Thanks for your patience!

r00tat

comment created time in 14 days

issue commentgoogle/clasp

Clasp can't seem to see bound script projects

To be clear, you can clone bound scripts, but just not list them.

Example:

clasp clone "https://script.google.com/d/fWc1OG320D82xo5wYVfqivevzZEItbPP3v7l1eh7XQTEm3vZe3YZpjwuD/edit"

Source for Drive List:

https://github.com/google/clasp/blob/master/src/commands/list.ts#L25

ShowMeBillyJo

comment created time in 15 days

issue commentGoogleCloudPlatform/functions-framework-nodejs

Cloud Run port

The port configuration is documented here:

https://github.com/GoogleCloudPlatform/functions-framework-nodejs#configure-the-functions-framework

Mistic92

comment created time in 15 days

more