From 70a605e436e522551a312dce2a8fcd96a39cc6bd Mon Sep 17 00:00:00 2001 From: anuradha9712 Date: Sun, 24 Nov 2024 01:36:09 +0400 Subject: [PATCH 1/6] chore: update brotli and gzip build config --- package-lock.json | 83 +++++++++++++++++++++++++---------------------- package.json | 1 - rollup.config.js | 18 ++++++++-- 3 files changed, 59 insertions(+), 43 deletions(-) diff --git a/package-lock.json b/package-lock.json index 324f09a2d..2eb753327 100644 --- a/package-lock.json +++ b/package-lock.json @@ -86,7 +86,6 @@ "lint-staged": "^10.5.4", "lz-string": "^1.4.4", "node-notifier": ">=8.0.1", - "postcss": "^8.4.49", "postcss-color-mod-function": "^3.0.3", "prettier": "^2.3.2", "react": "^16.12.0", @@ -2331,9 +2330,9 @@ } }, "node_modules/@commitlint/load/node_modules/typescript": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", - "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, "peer": true, "bin": { @@ -16119,9 +16118,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.9.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.1.tgz", - "integrity": "sha512-p8Yy/8sw1caA8CdRIQBG5tiLHmxtQKObCijiAa9Ez+d4+PRffM4054xbju0msf+cvhJpnFEeNjxmVT/0ipktrg==", + "version": "22.9.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.3.tgz", + "integrity": "sha512-F3u1fs/fce3FFk+DAxbxc78DF8x0cY09RRL8GnXLmkJ1jvx3TtPdWoTT5/NiYfI5ASqXBmfqJi9dZ3gxMx4lzw==", "dev": true, "dependencies": { "undici-types": "~6.19.8" @@ -23699,9 +23698,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.5.63", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.63.tgz", - "integrity": "sha512-ddeXKuY9BHo/mw145axlyWjlJ1UBt4WK3AlvkT7W2AbqfRQoacVoRUCF6wL3uIx/8wT9oLKXzI+rFqHHscByaA==", + "version": "1.5.64", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.64.tgz", + "integrity": "sha512-IXEuxU+5ClW2IGEYFC2T7szbyVgehupCWQe5GNh+H065CD6U6IFN0s4KeAMFGNmQolRU4IV7zGBWSYMmZ8uuqQ==", "dev": true }, "node_modules/element-resize-detector": { @@ -29252,12 +29251,15 @@ } }, "node_modules/is-finalizationregistry": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz", - "integrity": "sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.0.tgz", + "integrity": "sha512-qfMdqbAQEwBw78ZyReKnlA8ezmPdb9BemzIIip/JkjaZUhitfXDkkr+3QTboW0JrSXT1QWyYShpvnNHGZ4c4yA==", "dev": true, "dependencies": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -37920,6 +37922,7 @@ "url": "https://github.com/sponsors/ai" } ], + "peer": true, "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.1.1", @@ -39088,9 +39091,9 @@ "dev": true }, "node_modules/psl": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.11.0.tgz", - "integrity": "sha512-pjFdcBXT4g061k/SQkzNCRnav+1RdIOgrcX8hs5eL3CEQcFZP9qT8T1RWYxGKT11rH1DdIW+kJRfCYykBJuerQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.13.0.tgz", + "integrity": "sha512-BFwmFXiJoFqlUpZ5Qssolv15DMyc84gTBds1BjsV1BfXEo1UyyD7GsmN67n7J77uRhoSNW1AXtXKPLcBFQn9Aw==", "dev": true, "dependencies": { "punycode": "^2.3.1" @@ -40023,18 +40026,18 @@ "dev": true }, "node_modules/reflect.getprototypeof": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz", - "integrity": "sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.7.tgz", + "integrity": "sha512-bMvFGIUKlc/eSfXNX+aZ+EL95/EgZzuwA0OBPTbZZDEJw/0AkentjMuM1oiRfwHrshqk4RzdgiTg5CcDalXN5g==", "dev": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", - "es-abstract": "^1.23.1", + "es-abstract": "^1.23.5", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.4", - "globalthis": "^1.0.3", - "which-builtin-type": "^1.1.3" + "gopd": "^1.0.1", + "which-builtin-type": "^1.1.4" }, "engines": { "node": ">= 0.4" @@ -40156,15 +40159,15 @@ } }, "node_modules/regexpu-core": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.1.1.tgz", - "integrity": "sha512-k67Nb9jvwJcJmVpw0jPttR1/zVfnKf8Km0IPatrU/zJ5XeG3+Slx0xLXs9HByJSzXzrlz5EDvN6yLNMDc2qdnw==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.2.0.tgz", + "integrity": "sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA==", "dev": true, "dependencies": { "regenerate": "^1.4.2", "regenerate-unicode-properties": "^10.2.0", "regjsgen": "^0.8.0", - "regjsparser": "^0.11.0", + "regjsparser": "^0.12.0", "unicode-match-property-ecmascript": "^2.0.0", "unicode-match-property-value-ecmascript": "^2.1.0" }, @@ -40179,9 +40182,9 @@ "dev": true }, "node_modules/regjsparser": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.11.2.tgz", - "integrity": "sha512-3OGZZ4HoLJkkAZx/48mTXJNlmqTGOzc0o9OWQPuWpkOlXXPbyN6OafCcoXUnBqE2D3f/T5L+pWc1kdEmnfnRsA==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.12.0.tgz", + "integrity": "sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ==", "dev": true, "dependencies": { "jsesc": "~3.0.2" @@ -42137,6 +42140,7 @@ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, + "peer": true, "engines": { "node": ">=0.10.0" } @@ -44620,9 +44624,9 @@ } }, "node_modules/typed-array-byte-offset": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", - "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.3.tgz", + "integrity": "sha512-GsvTyUHTriq6o/bHcTd0vM7OQ9JEdlvluu9YISaA7+KzDzPaIzEeDFNkTfhdE3MYcNhNi0vq/LlegYgIs5yPAw==", "dev": true, "dependencies": { "available-typed-arrays": "^1.0.7", @@ -44630,7 +44634,8 @@ "for-each": "^0.3.3", "gopd": "^1.0.1", "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13" + "is-typed-array": "^1.1.13", + "reflect.getprototypeof": "^1.0.6" }, "engines": { "node": ">= 0.4" @@ -44640,17 +44645,17 @@ } }, "node_modules/typed-array-length": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", - "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", "dev": true, "dependencies": { "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-proto": "^1.0.3", "is-typed-array": "^1.1.13", - "possible-typed-array-names": "^1.0.0" + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" }, "engines": { "node": ">= 0.4" diff --git a/package.json b/package.json index 8de8faa30..4b435ce44 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,6 @@ "lint-staged": "^10.5.4", "lz-string": "^1.4.4", "node-notifier": ">=8.0.1", - "postcss": "^8.4.49", "postcss-color-mod-function": "^3.0.3", "prettier": "^2.3.2", "react": "^16.12.0", diff --git a/rollup.config.js b/rollup.config.js index 6b8bcdc6c..c6b98b540 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -184,7 +184,7 @@ const tsConfig = { }), ], output: { - dir: 'dist', + dir: 'dist/ts', format: 'umd', name: `inno`, globals: globals(), @@ -203,14 +203,26 @@ const brotliConfig = { ...commonJsPlugins, ], - output: jsUmdOutputConfig, + output: { + file: 'dist/brotli/index.js', + format: 'umd', + name: `InnovaccerDesignSystem`, + globals: globals(), + banner: banner(), + }, }; const gzipConfig = { ...baseConfig, plugins: [gzipPlugin(), ...commonJsPlugins], - output: jsUmdOutputConfig, + output: { + file: 'dist/gzip/index.js', + format: 'umd', + name: `InnovaccerDesignSystem`, + globals: globals(), + banner: banner(), + }, }; export default [jsUmdConfig, jsCjsConfig, jsEsmConfig, tsConfig, brotliConfig, gzipConfig]; From 3dcee2ec8e23162bc6e12b35f11051ebfc82b2d7 Mon Sep 17 00:00:00 2001 From: anuradha9712 Date: Sun, 24 Nov 2024 02:18:43 +0400 Subject: [PATCH 2/6] chore: add package version in css module classes --- rollup.config.js | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index c6b98b540..a93a90f2e 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -13,9 +13,8 @@ import { compress } from 'brotli'; import image from '@rollup/plugin-image'; import postcss from 'rollup-plugin-postcss'; +const { version, name, license, homepage } = packageJSON; const banner = () => { - const { version, name, license, homepage } = packageJSON; - const banner = ` /** * Generated on: ${new Date().toISOString()} @@ -50,6 +49,16 @@ const baseConfig = { external: ['react', 'react-dom'], }; +function generateHash(str) { + let hash = 0; + for (let i = 0; i < str.length; i++) { + const char = str.charCodeAt(i); + hash = (hash << 5) - hash + char; + hash |= 0; // Convert to 32bit integer + } + return hash.toString(36).substring(0, 5); +} + const commonJsPlugins = [ alias({ entries: aliasEntries, @@ -72,7 +81,12 @@ const commonJsPlugins = [ 'process.env.NODE_ENV': JSON.stringify('production'), }), postcss({ - modules: true, // Enable CSS Modules + modules: { + generateScopedName: (name, fileName) => { + const hash = generateHash(fileName + name); + return `${name}__v${version}___${hash}`; + }, + }, extensions: ['.css', '.scss', '.sass'], }), uglify(), @@ -179,7 +193,12 @@ const tsConfig = { // Compile TypeScript/JavaScript files babel({ extensions, include: ['core/**/*'] }), postcss({ - modules: true, // Enable CSS Modules + modules: { + generateScopedName: (name, fileName) => { + const hash = generateHash(fileName + name); + return `${name}__v${version}___${hash}`; + }, + }, extensions: ['.css', '.scss', '.sass'], }), ], From dfc1be48fad33bd393a835bc76db3f6e70a6a9d0 Mon Sep 17 00:00:00 2001 From: anuradha9712 Date: Sun, 24 Nov 2024 02:36:01 +0400 Subject: [PATCH 3/6] chore: add pre-major release flow --- .github/workflows/main.yml | 2 +- .github/workflows/next.yml | 59 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/next.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 437bcfdbf..96cc1b56d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,7 @@ on: - master jobs: release: - # uncomment next line as soon as visual tesing starts working + # uncomment next line as soon as visual testing starts working # needs: visual_test name: Release tag runs-on: ubuntu-latest diff --git a/.github/workflows/next.yml b/.github/workflows/next.yml new file mode 100644 index 000000000..fe3db7cc7 --- /dev/null +++ b/.github/workflows/next.yml @@ -0,0 +1,59 @@ +name: "Release next" +on: + push: + branches: + - v4.x +jobs: + release: + name: Release tag + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + with: + node-version: '20.x' + + - name: npm install + run: npm ci + + - name: setup git + run: git checkout -b preparing-module-for-npm-publish && git config --global user.email "release-bot@innovaccer.com" && git config --global user.name "release-bot" + + - name: bump module version + run: npm version --no-commit-hooks prerelease -m "Released %s [skip ci]" + + - name: generate .npmrc + run: cp .npmrc.stub .npmrc + + - name: Publish to npm js + run: npm publish --access public --tag=next + env: + NPM_TOKEN: ${{secrets.NPM_TOKEN}} + + - name: remove .npmrc + run: rm -rf .npmrc + + - name: push tag to github + run: git push https://${{ secrets.GH_TOKEN }}@github.com/$GITHUB_REPOSITORY.git $(node ./getVersion.js) + + - name: remove css/dist dist/ from commit + run: | + git reset HEAD~1 + git add package.json + git commit -m "Released $(node ./getVersion.js) [skip ci]" --no-verify + + - name: push version to github + run: git push https://${{ secrets.GH_TOKEN }}@github.com/$GITHUB_REPOSITORY.git HEAD:next + + - name: deploy storybook + run: npm run deploy-storybook -- --bucket-path=webui-mds-sb-next --aws-profile=NONE --ci + env: + AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_KEY }} + AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_KEY_ID }} + AWS_REGION: ${{ secrets.DOCS_REGION }} + + - name: notify release + uses: /innovaccer/design-system/actions/notify-release@next + env: + GCHAT_PATH: ${{ secrets.GCHAT_PATH }} From 29f31d9e8946a14f7ce06909291d62085881d65b Mon Sep 17 00:00:00 2001 From: anuradha9712 Date: Sun, 24 Nov 2024 15:17:00 +0400 Subject: [PATCH 4/6] chore: remove lint check flow from workflow --- .github/workflows/pull_request.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 8d398ecba..e34ab864a 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -16,9 +16,6 @@ jobs: - name: npm install run: npm ci - - name: lint - run: npm run lint:check - - name: test run: npm run test From 731d812b3c843b92819d48001fe9214f24464456 Mon Sep 17 00:00:00 2001 From: anuradha9712 Date: Sun, 24 Nov 2024 15:26:16 +0400 Subject: [PATCH 5/6] chore: update popover snapshots --- .../__snapshots__/Avatar.test.tsx.snap | 80 +- .../__snapshots__/AvatarImage.test.tsx.snap | 2 +- .../__snapshots__/AvatarGroup.test.tsx.snap | 16 +- .../AvatarSelection.test.tsx.snap | 110 +- .../__snapshots__/Dropdown.test.tsx.snap | 54 +- .../__snapshots__/Dialog.test.tsx.snap | 26 +- .../EditableDropdown.test.tsx.snap | 2 +- .../__snapshots__/Fullscreen.test.tsx.snap | 12 +- .../__snapshots__/Modal.test.tsx.snap | 24 +- .../__snapshots__/Popover.test.tsx.snap | 20 +- .../__snapshots__/Sidesheet.test.tsx.snap | 4 +- .../__snapshots__/Tooltip.test.tsx.snap | 16 +- .../__snapshots__/Combobox.test.tsx.snap | 12 +- .../__snapshots__/DatePicker.test.tsx.snap | 2 +- .../DateRangePicker.test.tsx.snap | 24 +- .../__snapshots__/Menu.test.tsx.snap | 14 +- .../__snapshots__/Select.test.tsx.snap | 148 +- .../__snapshots__/Table.test.tsx.snap | 3092 ++++++++--------- .../TimePickerWithSearch.test.tsx.snap | 16 +- .../__snapshots__/VerticalNav.test.tsx.snap | 12 +- .../__tests__/__snapshots__/TS.test.tsx.snap | 8 +- 21 files changed, 1847 insertions(+), 1847 deletions(-) diff --git a/core/components/atoms/avatar/__tests__/__snapshots__/Avatar.test.tsx.snap b/core/components/atoms/avatar/__tests__/__snapshots__/Avatar.test.tsx.snap index c61690820..ad594aca0 100644 --- a/core/components/atoms/avatar/__tests__/__snapshots__/Avatar.test.tsx.snap +++ b/core/components/atoms/avatar/__tests__/__snapshots__/Avatar.test.tsx.snap @@ -9,7 +9,7 @@ Object {