Skip to content

Commit

Permalink
Revert "fix: sync libs and docs versions (#136)"
Browse files Browse the repository at this point in the history
This reverts commit ce1c14a.
  • Loading branch information
Maksim Sitnikov committed Dec 4, 2023
1 parent ce1c14a commit fa46115
Show file tree
Hide file tree
Showing 15 changed files with 7,442 additions and 1,880 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:
run: npm ci
- name: Shape libs-data.json
run: npm run fetch-data
- name: Shape packages-versions.json
run: npm run get-packages-versions
- name: Lint Files
run: npm run lint
- name: Typecheck
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
run: npm run build && npm run export
env:
GITHUB_TOKEN: ${{ github.token }}
UIKIT_TARGET_BRANCH: 'main'
DATE_COMPONENTS_TARGET_BRANCH: 'main'
# Deploy
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ yarn-debug.log*
yarn-error.log*

/src/libs-data.json
/src/packages-versions.json

.env
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@ npm run start
```bash
# .env file

UIKIT_TARGET_BRANCH="your-branch" # default main, target branch for pulling documentation from uikit

COMPONENTS_TARGET_BRANCH="your-branch" # default main, target branch for pulling documentation from components

DATE_COMPONENTS_TARGET_BRANCH="your-branch" # default main, target branch for pulling documentation from date-components

GITHUB_PROFILE="your profile" # default gravity-ui, target profile for pulling documentation from components
```
5 changes: 5 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ const plugins = [
module.exports = withPlugins(plugins, {
reactStrictMode: true,
output: 'export',
env: {
UIKIT_TARGET_BRANCH: process.env.UIKIT_TARGET_BRANCH,
COMPONENTS_TARGET_BRANCH: process.env.COMPONENTS_TARGET_BRANCH,
DATE_COMPONENTS_TARGET_BRANCH: process.env.DATE_COMPONENTS_TARGET_BRANCH,
},
experimental: {
esmExternals: 'loose',
},
Expand Down
9,155 changes: 7,373 additions & 1,782 deletions package-lock.json

Large diffs are not rendered by default.

21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"private": true,
"homepage": "https://gravity-ui.com/",
"dependencies": {
"@doc-tools/transform": "^3.11.0",
"@gravity-ui/components": "2.1.0",
"@gravity-ui/icons": "^2.8.1",
"@gravity-ui/page-constructor": "^4.41.0",
"@gravity-ui/uikit": "5.12.1",
"@doc-tools/transform": "^2.16.0",
"@gravity-ui/components": "^2.1.0",
"@gravity-ui/icons": "^2.3.0",
"@gravity-ui/page-constructor": "^3.9.2",
"@gravity-ui/uikit": "^5.12.1",
"@mdx-js/mdx": "^2.3.0",
"@mdx-js/react": "^2.3.0",
"@testing-library/jest-dom": "^5.16.5",
Expand Down Expand Up @@ -63,19 +63,18 @@
},
"overrides": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react-dom": "^17.0.2",
"@gravity-ui/uikit": "^5.12.1"
},
"scripts": {
"prepare": "husky install",
"start": "next dev",
"build": "next build",
"export": "next export -o build/",
"fetch-data": "node ./scripts/prefetch-data.mjs",
"get-packages-versions": "node ./scripts/get-packages-versions.mjs",
"prepare-metadata": "npm run fetch-data && npm run get-packages-versions",
"prestart": "npm run prepare-metadata",
"prebuild": "npm run prepare-metadata",
"pretest": "npm run prepare-metadata",
"prestart": "npm run fetch-data",
"prebuild": "npm run fetch-data",
"pretest": "npm run fetch-data",
"lint:js": "eslint --ext .js,.jsx,.ts,.tsx .",
"lint:styles": "stylelint '{styles,src}/**/*.scss'",
"lint:prettier": "prettier --check '**/*.md'",
Expand Down
44 changes: 0 additions & 44 deletions scripts/get-packages-versions.mjs

This file was deleted.

6 changes: 0 additions & 6 deletions src/blocks/CustomHeader/CustomHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
$block: '.#{variables.$ns}custom-header';

#{$block} {
margin-top: 76px;

@media (max-width: map-get(pcVariables.$gridBreakpoints, 'sm') - 1) {
margin-top: 32px;
}

&__title {
@include pcStyles.heading1();
max-width: 800px;
Expand Down
8 changes: 8 additions & 0 deletions src/components/Landing/Landing.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@use '~@gravity-ui/page-constructor/styles/variables.scss' as pcVariables;
@use '../../variables.scss';

$block: '.#{variables.$ns}landing';

#{$block} {
margin-top: -20px;
}
31 changes: 19 additions & 12 deletions src/components/Landing/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,29 @@ import {RoadmapBlock} from '../../blocks/RoadmapBlock/RoadmapBlock';
import {CustomBlock} from '../../blocks/constants';
import {landing} from '../../content/landing';
import {useSectionScroll} from '../../hooks/useSectionScroll';
import {block} from '../../utils';

import './Landing.scss';

const b = block('landing');

export const Landing: React.FC = () => {
useSectionScroll();

return (
<PageConstructor
content={landing}
custom={{
blocks: {
[CustomBlock.CustomHeader]: CustomHeader,
[CustomBlock.CustomExtendedFeatures]: CustomExtendedFeatures,
[CustomBlock.CustomBanner]: CustomBanner,
[CustomBlock.Examples]: Examples,
[CustomBlock.Roadmap]: RoadmapBlock,
},
}}
/>
<div className={b()}>
<PageConstructor
content={landing}
custom={{
blocks: {
[CustomBlock.CustomHeader]: CustomHeader,
[CustomBlock.CustomExtendedFeatures]: CustomExtendedFeatures,
[CustomBlock.CustomBanner]: CustomBanner,
[CustomBlock.Examples]: Examples,
[CustomBlock.Roadmap]: RoadmapBlock,
},
}}
/>
</div>
);
};
2 changes: 2 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ export const GA_ID = 'GTM-KHT6KD7';
export const MENU_ID = 'menu';
export const CONTENT_WRAPPER_ID = 'content';

export const TARGET_BRANCH = 'main';

export const TARGET_PROFILE = 'gravity-ui';
20 changes: 11 additions & 9 deletions src/content/components/utils.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import {TARGET_PROFILE} from '../../constants';
import packagesVersions from '../../packages-versions.json';
import {TARGET_BRANCH, TARGET_PROFILE} from '../../constants';
import {Repos} from '../../types/common';

const githubTargetProfile = process.env.GITHUB_PROFILE || TARGET_PROFILE;
const uikitTargetBranch = process.env.UIKIT_TARGET_BRANCH || TARGET_BRANCH;
const componentsTargetBranch = process.env.COMPONENTS_TARGET_BRANCH || TARGET_BRANCH;
const dateComponentsTargetBranch = process.env.DATE_COMPONENTS_TARGET_BRANCH || TARGET_BRANCH;
const githubTargetprofile = process.env.GITHUB_PROFILE || TARGET_PROFILE;

const TARGET_REPOS_VERSIONS = {
[Repos.Uikit]: packagesVersions[Repos.Uikit],
[Repos.Components]: packagesVersions[Repos.Components],
// [Repos.DateComponents]: packagesVersions['@gravity-ui/date-components'],
const TARGET_REPOS_BRANCHES = {
[Repos.Uikit]: uikitTargetBranch,
[Repos.Components]: componentsTargetBranch,
[Repos.DateComponents]: dateComponentsTargetBranch,
};

export type GetterProps = {componentName: string; repoName: Repos};
Expand All @@ -21,7 +23,7 @@ export const mappingOptions = (arr: string[]) =>
}));

export const getReadmeUrl: RepoInfoGetterFunc = ({componentName, repoName}) =>
`https://raw.githubusercontent.com/${githubTargetProfile}/${repoName}/v${TARGET_REPOS_VERSIONS[repoName]}/src/components/${componentName}/README.md`;
`https://raw.githubusercontent.com/${githubTargetprofile}/${repoName}/${TARGET_REPOS_BRANCHES[repoName]}/src/components/${componentName}/README.md`;

export const getGithubUrl: RepoInfoGetterFunc = ({componentName, repoName}) =>
`https://github.com/${githubTargetProfile}/${repoName}/tree/main/src/components/${componentName}`;
`https://github.com/${githubTargetprofile}/${repoName}/tree/main/src/components/${componentName}`;
17 changes: 5 additions & 12 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,15 @@ body,
height: 100%;
}

body.g-root,
.g-root {
body.g-root {
margin: 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

&_theme_dark {
--g-color-base-background: #160d1b;
background-color: var(--g-color-base-background);
}
}

.g-root {
margin: 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

&:not(.sandbox) {
--g-font-family-sans: 'Inter', 'Helvetica Neue', 'Arial', 'Helvetica', sans-serif;
Expand Down Expand Up @@ -136,8 +133,4 @@ body.g-root,
}
}
}

.pc-page-constructor {
background-color: transparent;
}
}
2 changes: 1 addition & 1 deletion src/types/common.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export enum Repos {
Uikit = 'uikit',
Components = 'components',
// DateComponents = 'date-components',
DateComponents = 'date-components',
}

0 comments on commit fa46115

Please sign in to comment.