Skip to content

Commit

Permalink
feat: add ui/scroller & ui/list
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuever committed Dec 8, 2024
1 parent bc7f9a3 commit c5eae1e
Show file tree
Hide file tree
Showing 46 changed files with 602 additions and 401 deletions.
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"@infinite-list/group": ["ui/group/src/index.ts"],
"@infinite-list/list": ["ui/list/src/index.ts"],
"@infinite-list/masonry": ["ui/masonry/src/index.ts"],
"@infinite-list/scroller": ["ui/scroller/src/index.ts"]
"@infinite-list/scroller/react-native": ["ui/scroller/src/react-native"],
"@infinite-list/scroller/web": ["ui/scroller/src/web"],
}
},
"ts-node": {
Expand Down
23 changes: 0 additions & 23 deletions ui/group/.babelrc.js

This file was deleted.

7 changes: 0 additions & 7 deletions ui/group/README.md

This file was deleted.

23 changes: 0 additions & 23 deletions ui/group/eslint.config.js

This file was deleted.

22 changes: 0 additions & 22 deletions ui/group/jest.config.ts

This file was deleted.

8 changes: 0 additions & 8 deletions ui/group/package.json

This file was deleted.

28 changes: 0 additions & 28 deletions ui/group/project.json

This file was deleted.

17 changes: 0 additions & 17 deletions ui/group/rollup.config.js

This file was deleted.

Empty file removed ui/group/src/index.ts
Empty file.
1 change: 0 additions & 1 deletion ui/group/src/test-setup.ts

This file was deleted.

23 changes: 0 additions & 23 deletions ui/group/tsconfig.json

This file was deleted.

14 changes: 0 additions & 14 deletions ui/group/tsconfig.lib.json

This file was deleted.

21 changes: 0 additions & 21 deletions ui/group/tsconfig.spec.json

This file was deleted.

2 changes: 1 addition & 1 deletion ui/list/.babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = function (api) {
'@nx/react/babel',
{
runtime: 'automatic',
useBuiltIns: 'usage',
// useBuiltIns: 'usage',
},
],
],
Expand Down
23 changes: 21 additions & 2 deletions ui/list/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
{
"name": "@infinite-list/list",
"version": "0.0.1",
"version": "1.0.0",
"peerDependencies": {
"react": "18.2.0",
"react-native": "0.74.1"
}
},
"dependencies": {
"@infinite-list/data-model": "workspace:*",
"@infinite-list/scroller": "workspace:*"
},
"exports": {
"./react": {
"types": "./react.esm.d.ts",
"default": "./react.esm.js"
},
"./react-native": {
"types": "./react-native.esm.d.ts",
"import": "./react-native.esm.js"
}
},
"publishConfig": {
"access": "public"
},
"main": "./index.js",
"types": "./index.d.ts"
}
22 changes: 1 addition & 21 deletions ui/list/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,5 @@
"sourceRoot": "ui/list/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/ui/list",
"tsConfig": "ui/list/tsconfig.lib.json",
"project": "ui/list/package.json",
"entryFile": "ui/list/src/index.ts",
"external": ["react/jsx-runtime", "react-native", "react", "react-dom"],
"rollupConfig": "@nx/react/plugins/bundle-rollup",
"assets": [
{
"glob": "ui/list/README.md",
"input": ".",
"output": "."
}
]
}
}
}
"targets": {}
}
29 changes: 28 additions & 1 deletion ui/list/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,41 @@ const { withNx } = require('@nx/rollup/with-nx');

module.exports = withNx(
{
main: './src/index.ts',
// main: './src/index.ts',

// may cause
additionalEntryPoints: [],
outputPath: '../../dist/ui/list',
tsConfig: './tsconfig.lib.json',
compiler: 'babel',
format: ['esm'],
assets: [{ input: '.', output: '.', glob: '*.md' }],
},
{
input: ['./src/react-native', './src/react'],
output: {
entryFileNames: (chunk) => {
if (chunk.facadeModuleId.endsWith('src/react-native/index.ts')) {
return 'react-native.esm.js';
}
if (chunk.facadeModuleId.endsWith('src/react/index.ts')) {
return 'react.esm.js';
}

// if (chunk.facadeModuleId.endsWith('src/react-native')) {
// return 'react-native.esm.js'
// }

// if (chunk.facadeModuleId.endsWith('src/web')) {
// return 'web.esm.js'
// }
// if (chunk.facadeModuleId.includes('/module')) {
// const dir = path.dirname(chunk.facadeModuleId);
// return 'module/' + path.basename(dir) + '.js';
// }
},
},

// Provide additional rollup configuration here. See: https://rollupjs.org/configuration-options
// e.g.
// output: { sourcemap: true },
Expand Down
3 changes: 3 additions & 0 deletions ui/list/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default () => {
//
};
Loading

0 comments on commit c5eae1e

Please sign in to comment.