Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename app-scripts to aio-lib-web #286

Merged
merged 3 commits into from
Sep 11, 2020
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"author": "Adobe Inc.",
"bugs": "https://github.com/adobe/aio-cli-plugin-app/issues",
"dependencies": {
"@adobe/aio-app-scripts": "purplecabbage/aio-app-scripts#remove-web-config-writing",
"@adobe/aio-lib-core-config": "^2.0.0",
"@adobe/aio-lib-core-logging": "^1.1.0",
"@adobe/aio-lib-ims": "^4.1.0",
"@adobe/aio-lib-runtime": "purplecabbage/aio-lib-runtime#build-deploy-actions",
"@adobe/aio-lib-runtime": "^1.0.0-0",
"@adobe/aio-lib-web": "^3.0.0",
"@adobe/generator-aio-app": "^1.7.0",
"@adobe/generator-aio-console": "^1.1.1",
"@oclif/command": "^1.5.11",
Expand Down
6 changes: 3 additions & 3 deletions src/commands/app/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const fs = require('fs-extra')
const { cli } = require('cli-ux')

const BaseCommand = require('../../BaseCommand')
const AppScripts = require('@adobe/aio-app-scripts')
const webLib = require('@adobe/aio-lib-web')
const { flags } = require('@oclif/command')
const { runPackageScript, wrapError, writeConfig } = require('../../lib/app-helper')
const rtLib = require('@adobe/aio-lib-runtime')
Expand Down Expand Up @@ -65,7 +65,7 @@ class Deploy extends BaseCommand {
await writeConfig(config.web.injectedConfig, urls)
}
spinner.start('Building web assets')
await AppScripts.buildWeb(config, onProgress)
await webLib.buildWeb(config, onProgress)
spinner.succeed(chalk.green('Building web assets'))
} else {
this.log('no web-src, skipping web-src build')
Expand Down Expand Up @@ -107,7 +107,7 @@ class Deploy extends BaseCommand {
if (!flags['skip-static']) {
if (fs.existsSync('web-src/')) {
spinner.start('Deploying web assets')
deployedFrontendUrl = await AppScripts.deployWeb(config, onProgress)
deployedFrontendUrl = await webLib.deployWeb(config, onProgress)
spinner.succeed(chalk.green('Deploying web assets'))
} else {
this.log('no web-src, skipping web-src deploy')
Expand Down
1 change: 0 additions & 1 deletion src/commands/app/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const { flags } = require('@oclif/command')
const coreConfig = require('@adobe/aio-lib-core-config')

const BaseCommand = require('../../BaseCommand')
// const AppScripts = require('@adobe/aio-app-scripts')
const runDev = require('../../lib/runDev')
const { runPackageScript, wrapError } = require('../../lib/app-helper')

Expand Down
4 changes: 2 additions & 2 deletions src/commands/app/undeploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const fs = require('fs-extra')
const { flags } = require('@oclif/command')

const BaseCommand = require('../../BaseCommand')
const AppScripts = require('@adobe/aio-app-scripts')
const webLib = require('@adobe/aio-lib-web')
const { wrapError } = require('../../lib/app-helper')
const rtLib = require('@adobe/aio-lib-runtime')

Expand Down Expand Up @@ -47,7 +47,7 @@ class Undeploy extends BaseCommand {
}
if (!flags['skip-static']) {
if (fs.existsSync('web-src/')) {
await AppScripts.undeployWeb(config, onProgress)
await webLib.undeployWeb(config, onProgress)
} else {
this.log('no web-src, skipping web-src undeploy')
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/owlocal.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ governing permissions and limitations under the License.
*/

const path = require('path')
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-app-scripts:owlocal', { provider: 'debug' })
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-app:owlocal', { provider: 'debug' })
const execa = require('execa')

const OW_LOCAL_DOCKER_PORT = 3233
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/

const mockScripts = {
const mockLibWeb = {
buildWeb: jest.fn(),
deployWeb: jest.fn(),
undeployWeb: jest.fn()
}

mockScripts.mockReset = (script) => {
mockScripts[script].mockReset()
mockScripts[script].mockImplementation()
mockLibWeb.mockReset = (script) => {
mockLibWeb[script].mockReset()
mockLibWeb[script].mockImplementation()
}

mockScripts.mockResolvedValue = (script, value) => {
mockScripts[script].mockImplementation(async () => { return value })
mockLibWeb.mockResolvedValue = (script, value) => {
mockLibWeb[script].mockImplementation(async () => { return value })
}

mockScripts.mockRejectedValue = (script, value) => {
mockScripts[script].mockImplementation(async () => { throw value })
mockLibWeb.mockRejectedValue = (script, value) => {
mockLibWeb[script].mockImplementation(async () => { throw value })
}

module.exports = mockScripts
module.exports = mockLibWeb
3 changes: 0 additions & 3 deletions test/__mocks__/parcel-bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/

// need to manually mock because parcel seems to fs read
// /Users/mraho/work/aio-app-scripts/node_modules/grapheme-breaker/src/classes.trie which conflicts with fs mocking

const mockBundle = jest.fn()
const mockMiddleware = jest.fn()
const mockConstructor = jest.fn()
Expand Down
Loading