-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(service): add typescipt and esmodule support for shuvi.config.js (…
- Loading branch information
Showing
62 changed files
with
355 additions
and
114 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
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
3 changes: 3 additions & 0 deletions
3
packages/service/src/config/__tests__/fixtures/dotenv-esm/.env
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,3 @@ | ||
foo=bar | ||
test=123 | ||
conflictEnv=env |
1 change: 1 addition & 0 deletions
1
packages/service/src/config/__tests__/fixtures/dotenv-esm/.env.development.local
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 @@ | ||
conflictEnv=development.local |
2 changes: 2 additions & 0 deletions
2
packages/service/src/config/__tests__/fixtures/dotenv-esm/.env.local
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,2 @@ | ||
envLocal=true | ||
conflictEnv=local |
10 changes: 10 additions & 0 deletions
10
packages/service/src/config/__tests__/fixtures/dotenv-esm/shuvi.config.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,10 @@ | ||
export default { | ||
ssr: true, | ||
env: { | ||
shouldBe123: process.env.test, | ||
shouldBeBar: process.env.foo, | ||
shouldBeUndefined: process.env.undefined, | ||
envLocalShouldBeTrue: process.env.envLocal, | ||
conflictEnvShouldBeDevelopmentLocal: process.env.conflictEnv | ||
} | ||
}; |
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,3 @@ | ||
foo=bar | ||
test=123 | ||
conflictEnv=env |
1 change: 1 addition & 0 deletions
1
packages/service/src/config/__tests__/fixtures/esm/.env.development.local
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 @@ | ||
conflictEnv=development.local |
2 changes: 2 additions & 0 deletions
2
packages/service/src/config/__tests__/fixtures/esm/.env.local
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,2 @@ | ||
envLocal=true | ||
conflictEnv=local |
4 changes: 4 additions & 0 deletions
4
packages/service/src/config/__tests__/fixtures/esm/otherConfigs.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,4 @@ | ||
import webpack from 'webpack' | ||
export default { | ||
webpack | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/service/src/config/__tests__/fixtures/esm/shuvi.config.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,12 @@ | ||
import otherConfigs from './otherConfigs' | ||
export default { | ||
ssr: true, | ||
env: { | ||
shouldBe123: process.env.test, | ||
shouldBeBar: process.env.foo, | ||
shouldBeUndefined: process.env.undefined, | ||
envLocalShouldBeTrue: process.env.envLocal, | ||
conflictEnvShouldBeDevelopmentLocal: process.env.conflictEnv | ||
}, | ||
...otherConfigs | ||
}; |
3 changes: 3 additions & 0 deletions
3
packages/service/src/config/__tests__/fixtures/typescript-defineConfig/.env
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,3 @@ | ||
foo=bar | ||
test=123 | ||
conflictEnv=env |
1 change: 1 addition & 0 deletions
1
...ages/service/src/config/__tests__/fixtures/typescript-defineConfig/.env.development.local
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 @@ | ||
conflictEnv=development.local |
2 changes: 2 additions & 0 deletions
2
packages/service/src/config/__tests__/fixtures/typescript-defineConfig/.env.local
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,2 @@ | ||
envLocal=true | ||
conflictEnv=local |
11 changes: 11 additions & 0 deletions
11
packages/service/src/config/__tests__/fixtures/typescript-defineConfig/otherConfigs.ts
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,11 @@ | ||
import { defineConfig } from 'shuvi' | ||
export default defineConfig({ | ||
ssr: true, | ||
env: { | ||
shouldBe123: process.env.test, | ||
shouldBeBar: process.env.foo, | ||
shouldBeUndefined: process.env.undefined, | ||
envLocalShouldBeTrue: process.env.envLocal, | ||
conflictEnvShouldBeDevelopmentLocal: process.env.conflictEnv | ||
} | ||
}) |
1 change: 1 addition & 0 deletions
1
packages/service/src/config/__tests__/fixtures/typescript-defineConfig/shuvi.config.ts
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 @@ | ||
export { default } from './otherConfigs' |
3 changes: 3 additions & 0 deletions
3
packages/service/src/config/__tests__/fixtures/typescript/.env
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,3 @@ | ||
foo=bar | ||
test=123 | ||
conflictEnv=env |
1 change: 1 addition & 0 deletions
1
packages/service/src/config/__tests__/fixtures/typescript/.env.development.local
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 @@ | ||
conflictEnv=development.local |
2 changes: 2 additions & 0 deletions
2
packages/service/src/config/__tests__/fixtures/typescript/.env.local
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,2 @@ | ||
envLocal=true | ||
conflictEnv=local |
10 changes: 10 additions & 0 deletions
10
packages/service/src/config/__tests__/fixtures/typescript/otherConfigs.ts
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 @@ | ||
export default { | ||
ssr: true, | ||
env: { | ||
shouldBe123: process.env.test, | ||
shouldBeBar: process.env.foo, | ||
shouldBeUndefined: process.env.undefined, | ||
envLocalShouldBeTrue: process.env.envLocal, | ||
conflictEnvShouldBeDevelopmentLocal: process.env.conflictEnv | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
packages/service/src/config/__tests__/fixtures/typescript/shuvi.config.ts
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 @@ | ||
export { default } from './otherConfigs' |
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
Oops, something went wrong.