Git Product home page Git Product logo

adobeio-cna-starter-project's People

Contributors

macdonst avatar meryllblanchet avatar moritzraho avatar purplecabbage avatar rajarju avatar sandeep-paliwal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adobeio-cna-starter-project's Issues

Action build, parcels installs @babel/core when pointing to a file + package.json in same directory

2 action build modes are supported for now:
a. in manifest.yml point to action file: Minifies action and action's dependencies using parcel
b. in manifest.yml point to the action's directory + package.json file in action's folder: Installs dependencies and zips the action

But if we point to an action file + have a package.json file in the folder, parcel installs unnecessary dev dependencies such as @babel/core which pollutes the action folder with a package-lock.json and node_modules/ and modifies the package.json file.

Expected Behaviour

Best: bundle action with parcel without polluting folder
Middle: don't bundle with parcel, create a zip action instead if there is a package.json file
at least: show an error

Actual Behaviour

Unnecessary installed dependencies in developer's action folder

Steps to Reproduce

  • cd actions/hello
  • npm init
  • press enter to every question
  • cd ../../
  • npm run build:actions

Deploy issue when minifying action

Expected Behaviour

Deploy works

Actual Behaviour

Deploy fails

Steps to Reproduce

Create an action with a dependency on bwip-js, in scripts/build.actions.js verify that minify is set to true.

Sample Code that illustrates the problem

See https://github.com/icaraps/cna-barcode-generator/blob/master/actions/barcode/index.js

Logs taken while reproducing problem

 Returned HTTP 400 (Bad Request) --> 
 ›   "The request content was malformed:
 ›   Unexpected end-of-input at input index 1623 (line 1, position 1624), 
 ›   expected '"':

Test deployment in travis

Currently we are just doing e2e testing in travis on local builds

Testing of deployment is missing, add a remote deployment command to travis and run an e2e test on it.

To solve this we probably need:

  • support for remote target in e2e
  • embedding of ow credentials into travis
  • and then add deployment + remote e2e test to travis build

UI deployment URL problem after PR #27

Expected Behaviour

Deploy UI URL should point to the UI I am working on

Actual Behaviour

https://<namespace>.dev.adobe-runtime.com/adobeio-cna-starter-project-0.1.0/index.html
seems to be always pointing to deployment of cna-demo instead of owner's namespace s3 folder

This is misleading at first and creates CORS issues to access the backend
After making changes to the UI it is clear that the deployment URL is not pointing to the desired deployment

Reproduce Scenario (including but not limited to)

Use a different namespace than cna-demo

  • do some changes in the UI
  • deploy

`require` es6 modules in actions bundled with Parcel does not work

Relates to parcel-bundler/parcel#2581

Steps to Reproduce

  1. npm install node-fetch
  2. replace content actions/hello/index.js with
const fetch = require('node-fetch')
async function main (args) {
  try {
    const content = await fetch('https://jsonplaceholder.typicode.com/todos/1')
    return {
      body: await content.json()
    }
  } catch (e) {
    console.error(e)
    return {
      body: e.message
    }
  }
}
exports.main = main
  1. (optional) In scripts/build.actions.js replace minify: true, with minify:false,
  2. npm run build:actions && npm run deploy:actions
  3. click on the action url
    you should see fetch is not a function

Note 1: node-fetch is exported as an es6 module
Note 2: The same action works fine if deployed as a zip action

Workaround

In the action replace const fetch = require('node-fetch') with const fetch = require('node-fetch').default

'NODE_ENV' not recognized on Windows

When running the command
'npm run dev' I get the following error
'NODE_ENV' is not recognized as an internal or external command

Expected Behaviour

Start the local development server

Actual Behaviour

get the following error
'NODE_ENV' is not recognized as an internal or external command

Steps to Reproduce

Running 'npm run dev' on Windows command line

When using the ZIP action the JavaScript won't be build

  • Take the hello action from the CNA starter
  • Change the manifest.yaml in following way so the ZIP build is executed from scripts/build.action.js
packages:
  __CNA_PACKAGE__:
    license: Apache-2.0
    actions:
      hello:
        function: actions/hello
        web: yes
        runtime: 'nodejs:10'

A ZIP is build, but the JavaScript is never compiled with npm.

Use Jest for unit tests.

Currently the starter project is using Mocha + Chai for unit tests.
Move the unit test setup to Jest, so that all CNA apps use the same testing tools

Can we relax the chrome requirement?

Currently every commit/pr triggers an end to end build, which includes installing google chrome. It's 54MB and our tests on windows are taking 8-10 minutes.

Action built with parcel and requiring @adobe/aio-cli-config cannot be deployed

Behaviour

It seems that aio runtime truncates the code and this results in a malformed request error

✖ Deploy actions
 ›   Error: Command failed: aio runtime deploy -m /Users/mraho/work/adobeio-cna-starter-project/.manifest-dist.yml
 ›     ›   Error: Failed to deploy: the request content was malformed:
 ›     ›   unexpected end-of-input at input index 74845 (line 1, position 74846),
 ›     ›   expected '"':

This also doesn't work with wskdeploy -m .manifest-dist.yml and wsk action create myaction dist/actions/hello.js

Steps to Reproduce

  • $ npm install @adobe/aio-cli-config
  • add const config = require('@adobe/aio-cli-config') to the top of actions/hello/index.js
  • npm run build:actions && npm run deploy:actions or aio cna deploy -av

UI build script should cover sequences in the manifest file

Expected Behaviour

Action sequence should be covered by the UI build script so that it can be called from the UI.

Actual Behaviour

Sequences can not be called from the UI.

Reproduce Scenario (including but not limited to)

Applications that need to invoke a sequence of actions instead of single actions.

Steps to Reproduce

In manifest.yml, add sequences section:

packages:
  __CNA_PACKAGE__:
    license: Apache-2.0
    actions:
      hello:
        function: actions/hello/index.js
        web: yes
        runtime: 'nodejs:10'
      hello2:
        function: actions/hello/index.js
        web: yes
        runtime: 'nodejs:10'
    sequences:
      hello-sequence:
        actions: hello, hello2

Platform and Version

Sample Code that illustrates the problem

Please see Steps to reproduce.

Logs taken while reproducing problem

Cannot deploy action that requires`openwhisk` dependency and that was built with parcel

Action deployment hangs forever when having a dependency to openwhisk module + parcel minification on build

Actual Behaviour/Reproduce Scenario (including but not limited to)

  1. npm install openwhisk
  2. add const openwhisk = require('openwhisk') on top of actions/hello/index.js
    All of those hang:
    npm run deploy:actions
    aio cna deploy -av
    aio runtime create hello dist/actions/hello.js
    Weird error message, cluttered output with wsk
    wsk action create hello dist/actions/hello.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.