generated from nl-design-system/example
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Link React npm package (#2608)
- Loading branch information
Showing
22 changed files
with
547 additions
and
257 deletions.
There are no files selected for viewing
This file contains 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 @@ | ||
--- | ||
"@utrecht/link-react": major | ||
--- | ||
|
||
Create npm package for the Link React component. |
This file contains 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 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 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 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 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 was deleted.
Oops, something went wrong.
This file contains 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 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 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,8 @@ | ||
{ | ||
"env": { | ||
"jest/globals": true | ||
}, | ||
"rules": { | ||
"react/react-in-jsx-scope": "off" | ||
} | ||
} |
This file contains 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,12 @@ | ||
module.exports = { | ||
presets: [ | ||
'@babel/preset-env', | ||
[ | ||
'@babel/preset-react', | ||
{ | ||
runtime: 'automatic', | ||
}, | ||
], | ||
'@babel/preset-typescript', | ||
], | ||
}; |
This file contains 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,8 @@ | ||
export default { | ||
moduleDirectories: ['node_modules', '<rootDir>/'], | ||
testEnvironment: 'jest-environment-jsdom', | ||
testPathIgnorePatterns: ['/dist/'], | ||
moduleNameMapper: { | ||
'^@utrecht/(.*)$': '<rootDir>/../$1/src/', | ||
}, | ||
}; |
This file contains 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,68 @@ | ||
{ | ||
"name": "@utrecht/link-react", | ||
"version": "0.0.0", | ||
"author": "Community for NL Design System", | ||
"description": "Link component for the Municipality of Utrecht based on the NL Design System architecture", | ||
"license": "EUPL-1.2", | ||
"main": "./dist/index.cjs.js", | ||
"module": "./dist/index.esm.js", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"dist/", | ||
"src/" | ||
], | ||
"sideEffects": false, | ||
"scripts": { | ||
"clean": "rimraf dist *.tsbuildinfo .rollup.cache coverage", | ||
"build": "rollup --config ./rollup.config.mjs", | ||
"test": "mkdir -p pages && jest --coverage --verbose", | ||
"typecheck": "tsc --noEmit" | ||
}, | ||
"devDependencies": { | ||
"@babel/plugin-transform-runtime": "7.24.7", | ||
"@babel/preset-env": "7.24.7", | ||
"@babel/preset-react": "7.24.7", | ||
"@babel/preset-typescript": "7.24.7", | ||
"@rollup/plugin-babel": "6.0.4", | ||
"@rollup/plugin-commonjs": "26.0.1", | ||
"@rollup/plugin-json": "6.1.0", | ||
"@rollup/plugin-node-resolve": "15.2.3", | ||
"@rollup/plugin-typescript": "12.1.0", | ||
"@testing-library/dom": "8.20.1", | ||
"@testing-library/jest-dom": "6.5.0", | ||
"@testing-library/react": "16.0.1", | ||
"@testing-library/user-event": "14.5.1", | ||
"@types/jest": "29.5.13", | ||
"@types/react": "18.3.3", | ||
"@types/testing-library__jest-dom": "5.14.9", | ||
"@utrecht/link-css": "workspace:*", | ||
"jest": "29.7.0", | ||
"jest-environment-jsdom": "29.7.0", | ||
"react": "18.3.1", | ||
"rollup": "4.23.0", | ||
"rollup-plugin-filesize": "10.0.0", | ||
"rollup-plugin-node-externals": "7.1.2", | ||
"rollup-plugin-peer-deps-external": "2.2.4", | ||
"rollup-plugin-postcss": "4.0.2", | ||
"typescript": "5.6.2" | ||
}, | ||
"keywords": [ | ||
"nl-design-system" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git+ssh", | ||
"url": "[email protected]:nl-design-system/utrecht.git", | ||
"directory": "packages/components-react/link-react" | ||
}, | ||
"peerDependencies": { | ||
"@babel/runtime": "*", | ||
"react": "18", | ||
"react-dom": "18" | ||
}, | ||
"dependencies": { | ||
"clsx": "2.1.1" | ||
} | ||
} |
This file contains 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,87 @@ | ||
import babel from '@rollup/plugin-babel'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import json from '@rollup/plugin-json'; | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import { readFileSync } from 'fs'; | ||
import filesize from 'rollup-plugin-filesize'; | ||
import nodeExternal from 'rollup-plugin-node-externals'; | ||
import peerDepsExternal from 'rollup-plugin-peer-deps-external'; | ||
import postcss from 'rollup-plugin-postcss'; | ||
|
||
const packagePath = new URL('./package.json', import.meta.url).pathname; | ||
const packageJson = JSON.parse(readFileSync(packagePath, 'utf8')); | ||
|
||
/** | ||
* @type {import('rollup').RollupOptions} | ||
*/ | ||
export default [ | ||
{ | ||
input: './src/index.tsx', | ||
output: [ | ||
{ | ||
file: packageJson.main, | ||
format: 'cjs', | ||
sourcemap: true, | ||
}, | ||
{ | ||
file: packageJson.module, | ||
format: 'es', | ||
sourcemap: true, | ||
}, | ||
], | ||
plugins: [ | ||
peerDepsExternal(), | ||
commonjs(), | ||
nodeExternal(), | ||
resolve({ browser: true }), | ||
json(), | ||
typescript({ tsconfig: './tsconfig.build.json' }), | ||
babel({ | ||
presets: ['@babel/preset-react'], | ||
babelHelpers: 'runtime', | ||
exclude: ['node_modules/**', 'dist/**'], | ||
extensions: ['.ts', '.tsx'], | ||
inputSourceMap: true, | ||
plugins: ['@babel/plugin-transform-runtime'], | ||
}), | ||
filesize(), | ||
], | ||
}, | ||
{ | ||
input: './src/css.tsx', | ||
output: [ | ||
{ | ||
file: './dist/css.js', | ||
format: 'cjs', | ||
sourcemap: true, | ||
}, | ||
{ | ||
file: './dist/css.mjs', | ||
format: 'es', | ||
sourcemap: true, | ||
}, | ||
], | ||
plugins: [ | ||
peerDepsExternal(), | ||
commonjs(), | ||
nodeExternal(), | ||
resolve({ browser: true }), | ||
json(), | ||
postcss({ | ||
extensions: ['.css', '.scss'], | ||
minimize: true, | ||
}), | ||
typescript({ tsconfig: './tsconfig.build.json' }), | ||
babel({ | ||
presets: ['@babel/preset-react'], | ||
babelHelpers: 'runtime', | ||
exclude: ['node_modules/**', 'dist/**'], | ||
extensions: ['.ts', '.tsx'], | ||
inputSourceMap: true, | ||
plugins: ['@babel/plugin-transform-runtime'], | ||
}), | ||
filesize(), | ||
], | ||
}, | ||
]; |
This file contains 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 @@ | ||
/** | ||
* @license EUPL-1.2 | ||
* Copyright (c) 2020-2025 Frameless B.V. | ||
* Copyright (c) 2021-2025 Gemeente Utrecht | ||
*/ | ||
|
||
import '@utrecht/link-css/src/index.scss'; | ||
|
||
export * from './index'; |
2 changes: 1 addition & 1 deletion
2
...component-library-react/src/Link.test.tsx → ...nents-react/link-react/src/index.test.tsx
This file contains 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
File renamed without changes.
This file contains 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,6 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"composite": true | ||
} | ||
} |
This file contains 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 @@ | ||
{ | ||
"extends": "../tsconfig.base.json", | ||
"include": ["src/**/*.ts", "src/**/*.tsx"], | ||
"exclude": ["node_modules", "**/*.test.ts", "**/*.test.tsx"], | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
"rootDir": "src" | ||
} | ||
} |
This file contains 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,8 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"include": ["src/**/*.ts", "src/**/*.tsx"], | ||
"exclude": ["node_modules", "dist"], | ||
"compilerOptions": { | ||
"noEmit": true | ||
} | ||
} |
This file contains 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
Oops, something went wrong.