Skip to content

140 rollup packs #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/next-starter/packages/app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ if (!files.length) {
console.error(new Error('no files'));
process.exit(1);
}
const withTm = require('next-transpile-modules')([...files, '@onr/plugin-antd', '@onr/core']);
/** need to transpile the stuff, when using `next` in package
*/
const withTm = require('next-transpile-modules')([...files, '@onr/core', '@onr/plugin-antd']);

const withPWA = require('next-pwa');
const withAntdLess = require('next-plugin-antd-less');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createNextAuthApi } from '@onr/core/api';
import { createNextAuthApi } from '@onr/core/lib/api';
import { AuthService } from '@onr/plugin-auth';
import { app } from '../../../components/app';

Expand Down
15 changes: 8 additions & 7 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
"license": "ISC",
"main": "lib/index.js",
"source": "src/index.ts",
"exports": {
".": "./lib/index.js",
"./api": "./lib/api/index.js"
},
"directories": {
"lib": "lib",
"test": "__tests__"
Expand All @@ -22,16 +18,16 @@
"api",
"api.js"
],
"types": "types/index.d.ts",
"types": "lib/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/OnrampLab/onr-react-ui.git"
},
"scripts": {
"dev": "yarn build && tsc --watch --preserveWatchOutput",
"dev": "rollup -c ./rollup.config.js -w --environment NODE_ENV:development",
"lint": "prettier -c 'src/**/*'; eslint src --ext .ts,.tsx",
"format": "prettier --write 'src/**/*'; eslint src --fix --ext .ts,.tsx",
"build": "tsc && node ./config/build.js",
"build": "rollup -c --environment NODE_ENV:production",
"test": "jest --coverage --passWithNoTests",
"test:watch": "yarn test --watch",
"prepublishOnly": "yarn build"
Expand Down Expand Up @@ -62,11 +58,16 @@
"@babel/preset-typescript": "^7.12.7",
"@onr/eslint-config": "^0.3.0",
"@onr/prettier-config": "^1.1.1",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-multi-entry": "^4.1.0",
"@rollup/plugin-typescript": "^8.3.0",
"@types/lodash-es": "^4.17.5",
"@types/node": "^14.14.21",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"eslint": "^7.29.0",
"rollup": "^2.62.0",
"rollup-plugin-dts": "^4.1.0",
"typescript": "^4.3.4"
},
"prettier": "@onr/prettier-config",
Expand Down
14 changes: 14 additions & 0 deletions packages/core/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
import { defineConfig } from 'rollup';
export default defineConfig({
input: { index: './src/index.ts', api: './src/api/index.ts' },
output: {
dir: 'lib',
format: 'es',
},
plugins: [typescript({ tsconfig: './tsconfig.json' }), commonjs()],
treeshake: {
correctVarValueBeforeDeclaration: true,
},
});
2 changes: 1 addition & 1 deletion packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.components.json",
"compilerOptions": {
"outDir": "lib",
"declarationDir": "./types",
"declarationDir": "./lib",
"sourceMap": true
},
"include": [
Expand Down
13 changes: 8 additions & 5 deletions packages/logging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
"types",
"src"
],
"types": "types/index.d.ts",
"types": "lib/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/OnrampLab/onr-react-ui.git"
},
"scripts": {
"dev": "tsc --watch --preserveWatchOutput",
"dev": "rollup -c ./rollup.config.js -w --environment NODE_ENV:development",
"lint": "prettier -c 'src/**/*'; eslint src --ext .ts,.tsx",
"format": "prettier --write 'src/**/*'; eslint src --fix --ext .ts,.tsx",
"build": "tsc --build tsconfig.json",
"build": "rollup -c ./rollup.config.js --environment NODE_ENV:production",
"prepublishOnly": "yarn build",
"test": "jest --coverage --passWithNoTests"
},
Expand All @@ -37,22 +37,25 @@
"@livy/contracts": "^1.1.1",
"@livy/http-handler": "^1.0.3",
"@livy/logger": "^1.0.5",
"@livy/util": "^1.0.5"
"@livy/util": "^1.0.5",
"typescript": "^4.3.4"
},
"devDependencies": {
"@babel/preset-typescript": "^7.12.7",
"@onr/eslint-config": "^0.3.0",
"@onr/prettier-config": "^1.1.1",
"@rollup/plugin-typescript": "^8.3.0",
"@types/debug": "^4.1.5",
"@types/luxon": "^1.25.0",
"debug": "^4.3.1",
"eslint": "^7.29.0",
"prettier": "^1.18.2",
"rollup": "^2.62.0",
"typescript": "^4.3.4"
},
"prettier": "@onr/prettier-config",
"publishConfig": {
"access": "public"
},
"type": "module"
}
}
15 changes: 15 additions & 0 deletions packages/logging/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import typescript from '@rollup/plugin-typescript';
import { defineConfig } from 'rollup';
export default defineConfig({
input: ['./src/index.ts', './src/ConsoleHandler.ts'],
output: {
dir: 'lib',
format: 'es',
},
plugins: [typescript({ tsconfig: './tsconfig.json' })],
treeshake: {
correctVarValueBeforeDeclaration: true,
},
});

console.log(process.env.NODE_ENV);
16 changes: 11 additions & 5 deletions packages/logging/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
"extends": "../../tsconfig.components.json",
"compilerOptions": {
"outDir": "lib",
"declarationDir": "./types",
"declarationDir": "./lib",
"sourceMap": true,
"target": "es6"
"target": "es2021",
"module": "ESNext",
"moduleResolution": "Node"
},
"include": ["src/**/*"],
"exclude": ["**/*.spec.tsx?"]
}
"include": [
"src/**/*"
],
"exclude": [
"**/*.spec.tsx?"
]
}
4 changes: 2 additions & 2 deletions packages/tsconfig/tsconfig.components.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "ES2016" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
"target": "ES2018" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
"module": "ESnext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
Expand Down Expand Up @@ -61,4 +61,4 @@
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */,
"resolveJsonModule": true
}
}
}
11 changes: 7 additions & 4 deletions plugins/antd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
"types",
"src"
],
"types": "types/index.d.ts",
"types": "lib/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/OnrampLab/onr-react-ui.git"
},
"scripts": {
"dev": "tsc --watch --preserveWatchOutput",
"dev": "rollup -c ./rollup.config.js -w --environment NODE_ENV:development",
"lint": "prettier -c 'src/**/*'; eslint src --ext .ts,.tsx",
"format": "prettier --write 'src/**/*'; eslint src --fix --ext .ts,.tsx",
"build": "tsc --build tsconfig.json",
"build": "rollup -c --environment NODE_ENV:production",
"test": "jest --coverage --passWithNoTests",
"test:watch": "yarn test --watch",
"prepublishOnly": "yarn build"
Expand Down Expand Up @@ -55,18 +55,21 @@
"@babel/preset-typescript": "^7.12.7",
"@onr/eslint-config": "^0.3.0",
"@onr/prettier-config": "^1.1.1",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-typescript": "^8.3.0",
"@types/antd": "^1.0.0",
"@types/lodash-es": "^4.17.5",
"@types/node": "^14.14.21",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"change-case": "^4.1.2",
"eslint": "^7.29.0",
"rollup": "^2.62.0",
"typescript": "^4.3.4"
},
"prettier": "@onr/prettier-config",
"publishConfig": {
"access": "public"
},
"type": "module"
}
}
14 changes: 14 additions & 0 deletions plugins/antd/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
import { defineConfig } from 'rollup';
export default defineConfig({
input: './src/index.ts',
output: {
dir: 'lib',
format: 'es',
},
plugins: [typescript({ tsconfig: './tsconfig.json' }), commonjs()],
treeshake: {
correctVarValueBeforeDeclaration: true,
},
});
2 changes: 1 addition & 1 deletion plugins/antd/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.components.json",
"compilerOptions": {
"outDir": "lib",
"declarationDir": "./types",
"declarationDir": "./lib",
"sourceMap": true
},
"include": [
Expand Down
3 changes: 2 additions & 1 deletion plugins/user/src/containers/UserListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ const UserListContainer: React.FC = () => {
message.success(`User ${user.name} deleted`);
fetchUserListData();
} catch (e) {
message.error(`Failed to delete user${e.message && `: ${e.message}`}`);
if (e instanceof Error)
message.error(`Failed to delete user${e.message && `: ${e.message}`}`);
}
};

Expand Down
1 change: 0 additions & 1 deletion tsconfig.components.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"extends": "@onr/tsconfig/tsconfig.components.json",
"compilerOptions": {
"importHelpers": true,
"target": "ES2016"
}
}
Loading