-
Notifications
You must be signed in to change notification settings - Fork 324
chore: Migrated Vite to Rollup, Removed Vite related dependencies #6423
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
Open
yuhengshs
wants to merge
19
commits into
main
Choose a base branch
from
chore/migrate-vite-to-rollup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
6ab49a6
chore: Migrated Vite to Rollup, Removed Vite related dependencies
yuhengshs b206bc4
changed global-spec back to ./src
yuhengshs 029097a
Aligned with already existed configs from other packages. Removed exc…
yuhengshs cff5273
fix Unable to resolve
yuhengshs af871a8
Added role=textbox in base-input.vue
yuhengshs a751e5d
Fix password control component and update base-input with dynamic role
yuhengshs 0b5e3e1
update base-input.vue
yuhengshs 16d4ee3
cleaned up and make e2e tests workable
yuhengshs d5d6842
cleaned up unneccesary add ons
yuhengshs 96d4b2a
update yarn.lock file
yuhengshs 966cab0
resolved conflicts in these 2 files
yuhengshs 19c33b5
updated dependecy files
yuhengshs daf03b0
resolved merge conflicts
yuhengshs b026311
updated snapshots
yuhengshs 2952a87
fixed lint issue
yuhengshs c703b2e
cleaned up rollup configs under vue
yuhengshs d4e5d95
cleaned up rollup configs under vue
yuhengshs 1aeb2f1
Address the comments and remove the excessive imports
yuhengshs 1558a50
resolved conflicts
yuhengshs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,5 +1,11 @@ | ||
import { createApp } from 'vue'; | ||
import App from './App.vue'; | ||
import router from './router'; | ||
import AmplifyUIVue from '@aws-amplify/ui-vue'; | ||
import '@aws-amplify/ui-vue/styles.css'; | ||
|
||
createApp(App).use(router).mount('#app'); | ||
// Create app and register plugins | ||
const app = createApp(App); | ||
app.use(router); | ||
app.use(AmplifyUIVue); | ||
app.mount('#app'); | ||
This file contains hidden or 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 hidden or 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,99 @@ | ||
import { defineConfig } from 'rollup'; | ||
import typescript from 'rollup-plugin-typescript2'; | ||
import externals from 'rollup-plugin-node-externals'; | ||
import vue from 'rollup-plugin-vue'; | ||
import { nodeResolve } from '@rollup/plugin-node-resolve'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import postcss from 'rollup-plugin-postcss'; | ||
import fs from 'fs-extra'; | ||
|
||
// common config settings | ||
const input = ['src/index.ts']; | ||
const sourceMap = false; | ||
const esmOutputDir = 'dist/esm'; | ||
|
||
// Common output options | ||
const cjsOutput = { | ||
dir: 'dist', | ||
entryFileNames: '[name].cjs', | ||
format: 'cjs', | ||
esModule: true, | ||
generatedCode: { reservedNamesAsProps: false }, | ||
interop: 'auto', | ||
exports: 'named' | ||
}; | ||
|
||
// Common plugins | ||
const commonPlugins = [ | ||
externals({ include: [/node_modules/, /^@aws-amplify/] }), | ||
nodeResolve({ extensions: ['.js', '.ts', '.vue', '.css'] }), | ||
commonjs({ include: /node_modules/ }), | ||
postcss({ extract: false, inject: false }), | ||
vue({ | ||
preprocessStyles: true, | ||
template: { | ||
isProduction: true, | ||
compilerOptions: { | ||
whitespace: 'condense', | ||
isCustomElement: tag => /^amplify-/.test(tag) | ||
} | ||
} | ||
}) | ||
]; | ||
|
||
// Ensure styles are copied | ||
const ensureStyles = () => ({ | ||
name: 'ensure-styles', | ||
writeBundle() { | ||
fs.ensureDirSync('dist/components/primitives'); | ||
fs.copyFileSync( | ||
'src/components/primitives/styles.css', | ||
'dist/components/primitives/styles.css' | ||
); | ||
} | ||
}); | ||
|
||
const config = defineConfig([ | ||
// CJS config | ||
{ | ||
input, | ||
output: cjsOutput, | ||
plugins: [ | ||
...commonPlugins, | ||
typescript({ | ||
check: false, | ||
useTsconfigDeclarationDir: true, | ||
tsconfigOverride: { | ||
compilerOptions: { sourceMap, declaration: true, declarationDir: 'dist', rootDir: 'src' }, | ||
include: ['src/**/*'], | ||
exclude: ['node_modules', '**/__tests__/**', '**/*.test.*', 'scripts/**', '*.ts'] | ||
} | ||
}), | ||
ensureStyles() | ||
], | ||
}, | ||
// ESM config | ||
{ | ||
input, | ||
output: { | ||
dir: esmOutputDir, | ||
format: 'es', | ||
entryFileNames: '[name].mjs', | ||
preserveModules: true, | ||
preserveModulesRoot: 'src' | ||
}, | ||
plugins: [ | ||
...commonPlugins, | ||
typescript({ | ||
check: false, | ||
tsconfigOverride: { | ||
compilerOptions: { sourceMap, declaration: false, rootDir: 'src', outDir: esmOutputDir }, | ||
include: ['src/**/*'], | ||
exclude: ['node_modules', '**/__tests__/**', '**/*.test.*', 'scripts/**', '*.ts'] | ||
} | ||
}) | ||
], | ||
}, | ||
]); | ||
|
||
export default config; |
This file contains hidden or 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,9 @@ | ||
import fs from 'fs-extra'; | ||
|
||
// Ensure the directory exists | ||
fs.ensureDirSync('dist'); | ||
|
||
// Copy CSS files from the UI package | ||
fs.copySync('../ui/dist/styles.css', 'dist/style.css', { overwrite: true }); | ||
|
||
console.log('CSS files copied successfully'); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"include": ["src/**/*.ts", "src/**/*.vue"], | ||
"exclude": ["node_modules", "**/__mocks__", "**/__tests__"] | ||
} |
This file contains hidden or 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,12 +1,25 @@ | ||
{ | ||
"extends": "@aws-amplify/typescript-config/tsconfig.vue.json", | ||
"compilerOptions": { | ||
"noImplicitAny": false, | ||
"skipLibCheck": true, | ||
"strictNullChecks": false, | ||
"types": ["node", "jest", "@testing-library/jest-dom", "vite/client"] | ||
}, | ||
"include": [ | ||
"__mocks__", | ||
"__tests__", | ||
"*.ts", | ||
"*.mjs", | ||
"scripts", | ||
"src/**/*.ts", | ||
"src/**/*.tsx", | ||
"src/**/*.vue" | ||
], | ||
"exclude": ["node_modules"] | ||
"exclude": [ | ||
"node_modules", | ||
"**/__tests__/**", | ||
"**/*.test.*", | ||
"scripts/**", | ||
"*.ts" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do these changes equate to the build artifacts having a breaking change?