diff --git a/README.md b/README.md index 3da62e6..4a15e02 100644 --- a/README.md +++ b/README.md @@ -9,4 +9,3 @@ @MKAbuMattar/react-fluentui-emoji Banner - diff --git a/package.json b/package.json index 8be2ada..9e04b1d 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "fluentui-emoji:jsx": "NODE_OPTIONS=--max-old-space-size=8192 tsx script/jsx.script.ts", "fluentui-emoji:lib": "npm run fluentui-emoji:clean:lib && NODE_OPTIONS=--max-old-space-size=8192 babel build --out-dir lib --copy-files", "fluentui-emoji:pkg": "npm run fluentui-emoji:clean:pkg && tsx script/copy-lib.script.ts", + "build": "npm run fluentui-emoji:clone && npm run fluentui-emoji:svg && npm run svg:optmize && npm run fluentui-emoji:jsx && npm run fluentui-emoji:lib && npm run fluentui-emoji:pkg", "lint": "biome check ./script", "lint:fix": "biome check ./script --fix", "fmt": "biome format ./script", @@ -59,15 +60,17 @@ "@types/node": "22.5.0", "@types/react": "18.3.4", "@types/react-dom": "18.3.0", + "@types/uuid": "10.0.0", "babel-preset-minify": "0.5.2", "fs-extra": "11.2.0", - "jsdom": "24.1.1", + "jsdom": "25.0.0", "react": "18.3.1", "recursive-directory": "1.2.3", "rimraf": "6.0.1", "svg-to-jsx": "1.0.4", "svgo": "3.3.2", - "tsx": "4.17.0", - "typescript": "5.5.4" + "tsx": "4.18.0", + "typescript": "5.5.4", + "uuid": "10.0.0" } } diff --git a/packages/react-fluentui-emoji/README.md b/packages/react-fluentui-emoji/README.md index 3da62e6..4a15e02 100644 --- a/packages/react-fluentui-emoji/README.md +++ b/packages/react-fluentui-emoji/README.md @@ -9,4 +9,3 @@ @MKAbuMattar/react-fluentui-emoji Banner - diff --git a/packages/react-fluentui-emoji/package.json b/packages/react-fluentui-emoji/package.json index 4ce444e..8dadfaa 100644 --- a/packages/react-fluentui-emoji/package.json +++ b/packages/react-fluentui-emoji/package.json @@ -1,6 +1,6 @@ { "name": "react-fluentui-emoji", - "version": "1.0.0", + "version": "1.1.0", "description": "React Fluentui Emoji an npm package contains a number of well-known, cordial, and contemporary emoji, build into @microsoft/fluentui-emoji.", "keywords": [ "fluentui", @@ -30,8 +30,7 @@ "react": "*" }, "dependencies": {}, - "devDependencies": { - }, + "devDependencies": {}, "sideEffects": false, "exports": { ".": { @@ -71,10 +70,7 @@ }, "./package.json": "./package.json" }, - "files": [ - "/lib", - "/index.d.ts" - ], + "files": ["/lib", "/index.d.ts"], "support": { "backing": { "npm-funding": true diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4b7d69e..5f5c0b7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -41,6 +41,9 @@ importers: '@types/react-dom': specifier: 18.3.0 version: 18.3.0 + '@types/uuid': + specifier: 10.0.0 + version: 10.0.0 babel-preset-minify: specifier: 0.5.2 version: 0.5.2 @@ -48,8 +51,8 @@ importers: specifier: 11.2.0 version: 11.2.0 jsdom: - specifier: 24.1.1 - version: 24.1.1 + specifier: 25.0.0 + version: 25.0.0 react: specifier: 18.3.1 version: 18.3.1 @@ -66,11 +69,14 @@ importers: specifier: 3.3.2 version: 3.3.2 tsx: - specifier: 4.17.0 - version: 4.17.0 + specifier: 4.18.0 + version: 4.18.0 typescript: specifier: 5.5.4 version: 5.5.4 + uuid: + specifier: 10.0.0 + version: 10.0.0 packages: @@ -460,6 +466,9 @@ packages: '@types/tough-cookie@4.0.5': resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==} + '@types/uuid@10.0.0': + resolution: {integrity: sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==} + agent-base@7.1.1: resolution: {integrity: sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==} engines: {node: '>= 14'} @@ -890,8 +899,8 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - jsdom@24.1.1: - resolution: {integrity: sha512-5O1wWV99Jhq4DV7rCLIoZ/UIhyQeDR7wHVyZAHAshbrvZsLs+Xzz7gtwnlJTJDjleiTKh54F4dXrX70vJQTyJQ==} + jsdom@25.0.0: + resolution: {integrity: sha512-OhoFVT59T7aEq75TVw9xxEfkXgacpqAhQaYgP9y/fDqWQCMB/b1H66RfmPm/MaeaAIU9nDwMOVTlPN51+ao6CQ==} engines: {node: '>=18'} peerDependencies: canvas: ^2.11.2 @@ -1163,8 +1172,8 @@ packages: resolution: {integrity: sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==} engines: {node: '>=18'} - tsx@4.17.0: - resolution: {integrity: sha512-eN4mnDA5UMKDt4YZixo9tBioibaMBpoxBkD+rIPAjVmYERSG0/dWEY1CEFuV89CgASlKL499q8AhmkMnnjtOJg==} + tsx@4.18.0: + resolution: {integrity: sha512-a1jaKBSVQkd6yEc1/NI7G6yHFfefIcuf3QJST7ZEyn4oQnxLYrZR5uZAM8UrwUa3Ge8suiZHcNS1gNrEvmobqg==} engines: {node: '>=18.0.0'} hasBin: true @@ -1193,6 +1202,10 @@ packages: url-parse@1.5.10: resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==} + uuid@10.0.0: + resolution: {integrity: sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==} + hasBin: true + w3c-xmlserializer@5.0.0: resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==} engines: {node: '>=18'} @@ -1641,6 +1654,8 @@ snapshots: '@types/tough-cookie@4.0.5': {} + '@types/uuid@10.0.0': {} + agent-base@7.1.1: dependencies: debug: 4.3.6 @@ -2112,7 +2127,7 @@ snapshots: js-tokens@4.0.0: {} - jsdom@24.1.1: + jsdom@25.0.0: dependencies: cssstyle: 4.0.1 data-urls: 5.0.0 @@ -2372,7 +2387,7 @@ snapshots: dependencies: punycode: 2.3.1 - tsx@4.17.0: + tsx@4.18.0: dependencies: esbuild: 0.23.1 get-tsconfig: 4.7.6 @@ -2398,6 +2413,8 @@ snapshots: querystringify: 2.2.0 requires-port: 1.0.0 + uuid@10.0.0: {} + w3c-xmlserializer@5.0.0: dependencies: xml-name-validator: 5.0.0 diff --git a/svgo.config.cjs b/svgo.config.cjs index e69de29..76c4d7d 100644 --- a/svgo.config.cjs +++ b/svgo.config.cjs @@ -0,0 +1,27 @@ + const {v4: uuid} = require('uuid'); + + /** @type {import('svgo').Config} */ + const svgoConfig = { + plugins: [ + { + name: 'preset-default', + params: { + overrides: { + removeViewBox: false, + }, + }, + }, + 'convertStyleToAttrs', + 'cleanupIds', + { + name: 'prefixIds', + params: { + delim: '', + prefix: () => `svg-${uuid()}-`, + }, + }, + 'removeDimensions', + ], + }; + + module.exports = svgoConfig; diff --git a/tsconfig.json b/tsconfig.json index 59009e8..d0f501d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,10 +9,10 @@ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ /* Language and Environment */ - "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, "lib": [ "ES2021.String" - ], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + ] /* Specify a set of bundled library declaration files that describe the target runtime environment. */, // "jsx": "preserve", /* Specify what JSX code is generated. */ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ @@ -24,9 +24,9 @@ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */ + "module": "commonjs" /* Specify what module code is generated. */, // "rootDir": "./", /* Specify the root folder within your source files. */ - "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ + "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */, // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ @@ -34,7 +34,7 @@ // "types": [], /* Specify type package names to be included without being referenced in a source file. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - "resolveJsonModule": true, /* Enable importing .json files. */ + "resolveJsonModule": true /* Enable importing .json files. */, // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ /* JavaScript Support */ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ @@ -67,11 +67,11 @@ /* Interop Constraints */ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ + "strict": true /* Enable all strict type-checking options. */, // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ @@ -94,4 +94,4 @@ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ "skipLibCheck": true /* Skip type checking all .d.ts files. */ } -} \ No newline at end of file +}