-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: should run ets on pkg.egg.declarations = true (#248)
- Loading branch information
Showing
20 changed files
with
148 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,6 @@ | |
"--", | ||
"--inspect-brk" | ||
], | ||
"protocol": "auto", | ||
"port": 9229, | ||
"autoAttachChildProcesses": true | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const { Controller } = require('egg'); | ||
|
||
class HomeController extends Controller { | ||
async index() { | ||
const { ctx } = this; | ||
ctx.body = 'hi, egg'; | ||
} | ||
} | ||
|
||
module.exports = HomeController; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* @param {Egg.Application} app - egg application | ||
*/ | ||
module.exports = app => { | ||
const { router, controller } = app; | ||
router.get('/', controller.home.index); | ||
}; |
28 changes: 28 additions & 0 deletions
28
test/fixtures/example-declarations/config/config.default.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* eslint valid-jsdoc: "off" */ | ||
|
||
/** | ||
* @param {Egg.EggAppInfo} appInfo app info | ||
*/ | ||
module.exports = appInfo => { | ||
/** | ||
* built-in config | ||
* @type {Egg.EggAppConfig} | ||
**/ | ||
const config = exports = {}; | ||
|
||
// use for cookie sign key, should change to your own and keep security | ||
config.keys = appInfo.name + '_1704604037320_6202'; | ||
|
||
// add your middleware config here | ||
config.middleware = []; | ||
|
||
// add your user config here | ||
const userConfig = { | ||
// myAppName: 'egg', | ||
}; | ||
|
||
return { | ||
...config, | ||
...userConfig, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** @type Egg.EggPlugin */ | ||
module.exports = { | ||
// had enabled by egg | ||
// static: { | ||
// enable: true, | ||
// } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"include": [ | ||
"**/*" | ||
] | ||
} |
15 changes: 15 additions & 0 deletions
15
test/fixtures/example-declarations/node_modules/aliyun-egg/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
test/fixtures/example-declarations/node_modules/aliyun-egg/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "example-declarations", | ||
"version": "1.0.0", | ||
"description": "", | ||
"private": true, | ||
"egg": { | ||
"declarations": true, | ||
"framework": "aliyun-egg" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "example-ts-custom-compiler", | ||
"dependencies": { | ||
"ts-node": "10.9.0" | ||
"ts-node": "10.9.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -245,7 +245,7 @@ describe('test/ts.test.ts', () => { | |
}) | ||
// .debug() | ||
.end(); | ||
assert.match(stderr, /ts-node@10\.9\.0/); | ||
assert.match(stderr, /ts-node@10\.\d+\.\d+/); | ||
assert.equal(code, 0); | ||
}); | ||
|
||
|
@@ -257,9 +257,9 @@ describe('test/ts.test.ts', () => { | |
await fs.rm(path.join(cwd, 'node_modules'), { force: true, recursive: true }); | ||
if (process.env.CI) { | ||
// dont use npmmirror.com on CI | ||
await runscript('npx npminstall [email protected].0 --no-save', { cwd }); | ||
await runscript('npx npminstall [email protected].2 --no-save', { cwd }); | ||
} else { | ||
await runscript('npx npminstall -c [email protected].0 --no-save', { cwd }); | ||
await runscript('npx npminstall -c [email protected].2 --no-save', { cwd }); | ||
} | ||
|
||
// copy egg to node_modules | ||
|
@@ -278,7 +278,7 @@ describe('test/ts.test.ts', () => { | |
}) | ||
// .debug() | ||
.end(); | ||
assert.match(stderr, /ts-node@10\.9\.0/); | ||
assert.match(stderr, /ts-node@10\.9\.2/); | ||
assert.equal(code, 0); | ||
}); | ||
|
||
|
@@ -289,9 +289,9 @@ describe('test/ts.test.ts', () => { | |
await fs.rm(path.join(cwd, 'node_modules'), { force: true, recursive: true }); | ||
if (process.env.CI) { | ||
// dont use npmmirror.com on CI | ||
await runscript('npx npminstall [email protected].0 --no-save', { cwd }); | ||
await runscript('npx npminstall [email protected].2 --no-save', { cwd }); | ||
} else { | ||
await runscript('npx npminstall -c [email protected].0 --no-save', { cwd }); | ||
await runscript('npx npminstall -c [email protected].2 --no-save', { cwd }); | ||
} | ||
|
||
// copy egg to node_modules | ||
|
@@ -308,7 +308,7 @@ describe('test/ts.test.ts', () => { | |
}) | ||
// .debug() | ||
.end(); | ||
assert.doesNotMatch(stderr, /ts-node@10\.9\.0/); | ||
assert.doesNotMatch(stderr, /ts-node@10\.9\.2/); | ||
assert.equal(code, 0); | ||
}); | ||
|
||
|
@@ -405,7 +405,7 @@ describe('test/ts.test.ts', () => { | |
}) | ||
// .debug() | ||
.end(); | ||
assert.match(stdout, /ts-node@10\.9\.0/); | ||
assert.match(stdout, /ts-node@10\.\d+\.\d+/); | ||
assert.equal(code, 0); | ||
}); | ||
|
||
|
018801a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
egg-bin – ./
egg-bin-git-master-no-veronica.vercel.app
egg-bin-no-veronica.vercel.app
egg-bin.vercel.app