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

Documentation #581

Merged
merged 1 commit into from
Sep 14, 2023
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
44 changes: 1 addition & 43 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
npm i
fi
- name: Generate new Build to Pages
run: npm run build
run: npm run deploy
- name: Upload deploy-ready build files
uses: actions/upload-artifact@v3
with:
Expand All @@ -128,55 +128,13 @@ jobs:
name: deploy-files
path: ./dist

# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 14.21.3
# cache: 'npm'
# - uses: webfactory/ssh-agent@v0.7.0
# with:
# ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
# - name: Add Know Hosts
# run: |
# ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts
# shell: bash
# - name: Clean install on CI
# run: |
# if [ -e yarn.lock ]; then
# yarn install --frozen-lockfile
# elif [ -e package-lock.json ]; then
# npm ci
# else
# npm i
# fi
# - name: Generate new Build to Pages
# run: npm run build
# - name: Download artifact
# uses: actions/download-artifact@v3
# with:
# name:
# - name: Setup Node
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 14.21.3
# cache: 'npm'
- uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Add Know Hosts
run: |
ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts
shell: bash
# - name: Clean install on CI
# run: |
# if [ -e yarn.lock ]; then
# yarn install --frozen-lockfile
# elif [ -e package-lock.json ]; then
# npm ci
# else
# npm i
# fi

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"ts-compile-check": "tsc -p tsconfig.json",
"prepare": "ts-patch install -s && node ./prepare.js",
"preinstall": "npm install --package-lock-only --ignore-scripts && npx npm-force-resolutions",
"deploy": "gh-pages -d dist"
"deploy": "VITE_REACT_DEPLOY_DOCUMENTATION=DOCUMENTATION vite build"
},
"publishConfig": {
"access": "public"
Expand Down
11 changes: 0 additions & 11 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,4 @@ if (import.meta.env.VITE_REACT_DEPLOY_DOCUMENTATION === 'DOCUMENTATION') {
)
} else {
import('./index')
// ReactDOM.render(
// // <React.StrictMode>
// // <h1>HOLA</h1>
// // </React.StrictMode>,
// // document.getElementById('root')
// <React.StrictMode>
// <h1>HOLA</h1>
// {/* {modulesExports} */}
// </React.StrictMode>,
// document.getElementById('root')
// )
}
27 changes: 1 addition & 26 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import path from 'path'

let myDefineConfig

const buildEnv = process.env.VITE_REACT_DEPLOY_DOCUMENTATION ?? 'PRODUCTION'
const buildEnv = process.env.VITE_REACT_DEPLOY_DOCUMENTATION

// if (import.meta.env.VITE_REACT_DEPLOY_DOCUMENTATION === 'DOCUMENTATION') {
if (buildEnv === 'DOCUMENTATION') {
myDefineConfig = {
plugins: [react(), tsconfigPaths()],
base: '/@eclass-ui-kit/',
build: {
sourcemap: true,
},
Expand Down Expand Up @@ -44,27 +42,4 @@ if (buildEnv === 'DOCUMENTATION') {
}
}

// export default defineConfig({
// plugins: [react(), tsconfigPaths()],
// build: {
// lib: {
// entry: path.resolve(__dirname, 'src/index.ts'),
// name: '@eclass/ui-kit',
// fileName: (format) => `eclass-ui-kit.${format}.js`,
// },
// sourcemap: true,
// rollupOptions: {
// // make sure to externalize deps that shouldn't be bundled
// // into your library
// external: ['react'],
// output: {
// // Provide global variables to use in the UMD build
// // for externalized deps
// globals: {
// react: 'React',
// },
// },
// },
// },
// })
export default defineConfig(myDefineConfig)