Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
{
"env": {
"commonjs": true,
"es2021": true,
"node": true
},
"extends": [
"standard"
],
"extends": "@adobe/eslint-config-aio-lib-config",
"parserOptions": {
"ecmaVersion": 12
"ecmaVersion": "latest"
},
"rules": {
"node/no-unpublished-require": 0,
"jsdoc/tag-lines": [
// The Error level should be `error`, `warn`, or `off` (or 2, 1, or 0)
"error",
"never",
{
"startLines": null
}
]
},
"settings": {
"jsdoc": {
"ignorePrivate": true
}
}
}
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
45 changes: 45 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->

## Related Issue

<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--- Please link to the issue here: -->

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

## Screenshots (if appropriate):

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] I have signed the [Adobe Open Source CLA](http://opensource.adobe.com/cla.html).
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the **CONTRIBUTING** document.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
11 changes: 11 additions & 0 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Daily - Do npm install and run all unit tests

on:
schedule:
# run daily at midnight
- cron: "0 0 * * *"

jobs:
build:
uses: adobe/aio-reusable-workflows/.github/workflows/daily.yml@main

14 changes: 14 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [main] # Change this if not your default branch
pull_request:
branches: [main] # Change this if not your default branch

jobs:
build:
uses: adobe/aio-reusable-workflows/.github/workflows/node.js.yml@main
23 changes: 23 additions & 0 deletions .github/workflows/on-push-publish-to-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: on-push-publish-to-npm

on:
push:
branches:
- main # Change this if not your default branch
paths:
- "package.json"

jobs:
publish:
if: github.repository == 'adobe/aio-cli-plugin-app-dev'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 18
- run: npm install
- run: npm test
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: publish-prerelease

on:
workflow_dispatch:
inputs:
pre-release-tag:
description: "The pre-release tag use in the version"
required: false
default: "pre"
dist-tag:
description: "The dist-tag use"
required: false
default: "next"
dependencies-to-update:
description: "csv of dependencies to update with the dist-tag"
required: false
default: "@adobe/aio-cli-lib-app-config,@adobe/aio-cli-lib-console,@adobe/aio-lib-core-config,@adobe/aio-lib-core-logging,@adobe/aio-lib-core-networking,@adobe/aio-lib-env,@adobe/aio-lib-ims,@adobe/aio-lib-runtime,@adobe/aio-lib-web,@adobe/generator-aio-app"

jobs:
checkout:
uses: adobe/aio-reusable-workflows/.github/workflows/prerelease.yml@main
12 changes: 12 additions & 0 deletions .github/workflows/release-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# this is meant for pull-requests who have a base branch as a release branch (prefix release-) and will run the unit-tests npm script

name: Release Branch CI

on:
pull_request:
branches: ["release-*", "branch-prerelease"]

jobs:
build:
uses: adobe/aio-reusable-workflows/.github/workflows/release-branch.yml@main
17 changes: 17 additions & 0 deletions .github/workflows/version-bump-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: version-bump-publish

on:
workflow_dispatch:
inputs:
level:
description: "<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease"
required: true
default: "patch"
tag:
description: "The tag to publish to."
required: false
default: "latest"

jobs:
checkout:
uses: adobe/aio-reusable-workflows/.github/workflows/version-bump-publish.yml@main
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package-lock=false
tag-version-prefix=""
preid="next"
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
# aio-cli-plugin-app-dev

[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![Version](https://img.shields.io/npm/v/@adobe/aio-cli-plugin-app-dev.svg)](https://npmjs.org/package/@adobe/aio-cli-plugin-app-dev)
[![Downloads/week](https://img.shields.io/npm/dw/@adobe/aio-cli-plugin-app-dev.svg)](https://npmjs.org/package/@adobe/aio-cli-plugin-app-dev)
![Node.js CI](https://github.com/adobe/aio-cli-plugin-app-dev/workflows/Node.js%20CI/badge.svg)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Codecov Coverage](https://img.shields.io/codecov/c/github/adobe/aio-cli-plugin-app-dev/master.svg?style=flat-square)](https://codecov.io/gh/adobe/aio-cli-plugin-app-dev/)

This command is a new way of looking at local development.
This uses the approach of a simulator, rather than an emulator.

## Legacy Openwhisk Debugger

The openwhisk debugger had some heavy requirements, and several serious issues that could not be resolved

- requires Java to be installed on the developer's machine to run the jar
- requires Docker desktop to be installed, up and running
- does not function on all hardware combinations, ex. Apple silicon ...
Expand All @@ -23,18 +33,16 @@ The openwhisk debugger had some heavy requirements, and several serious issues t
- the solution is complex with many moving parts, and many points of failure
- it is slow, it takes time to setup and teardown

### Gaps

### Gaps:
- When modifying code, and re-calling the action, the latest code is used because we clear node module cache entries, however, if your action code imports/requires another file, this cache is not cleared so changes are not reflected.
- File Storage needs to use our cdn urls, and not AZURE_STORAGE_DOMAIN


<!-- toc -->

<!-- tocstop -->


# Commands
## Commands
<!-- commands -->

<!-- commandsstop -->
Expand Down
10 changes: 7 additions & 3 deletions bin/run
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
#!/usr/bin/env node

/*
Copyright 2020 Adobe. All rights reserved.
Copyright 2024 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

require('@oclif/command').run()
.catch(require('@oclif/errors/handle'))
const oclif = require('@oclif/core')

oclif.run()
.then(require('@oclif/core/flush'))
.catch(require('@oclif/core/handle'))
2 changes: 1 addition & 1 deletion bin/run.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off

rem Copyright 2020 Adobe. All rights reserved.
rem Copyright 2024 Adobe. All rights reserved.
rem This file is licensed to you under the Apache License, Version 2.0 (the "License");
rem you may not use this file except in compliance with the License. You may obtain a copy
rem of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
5 changes: 4 additions & 1 deletion e2e/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ const chalk = require('chalk')
const { stdout } = require('stdout-stderr')
const fs = require('fs')

stdout.print = true
beforeEach(() => {
stdout.start()
stdout.print = true
})

test('boilerplate help test', async () => {
const packagejson = JSON.parse(fs.readFileSync('package.json').toString())
Expand Down
31 changes: 23 additions & 8 deletions jest.setup.js → jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2020 Adobe. All rights reserved.
Copyright 2024 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand All @@ -10,10 +10,25 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/

const { stdout, stderr } = require('stdout-stderr')

jest.setTimeout(30000)

// trap console log
beforeEach(() => { stdout.start(); stderr.start() })
afterEach(() => { stdout.stop(); stderr.stop() })
module.exports = {
testEnvironment: 'node',
verbose: true,
setupFilesAfterEnv: ['./test/jest.setup.js'],
collectCoverage: true,
testPathIgnorePatterns: [
'<rootDir>/src/*'
],
collectCoverageFrom: [
'src/commands/**/*.js',
'src/lib/*.js',
'src/*.js'
],
coverageThreshold: {
global: {
functions: 100,
branches: 100,
lines: 100,
statements: 100
}
}
}
Loading