Skip to content

Commit

Permalink
chore: setup rollup for build
Browse files Browse the repository at this point in the history
  • Loading branch information
valpinkman committed Jan 26, 2024
1 parent b327cb2 commit 5ba0522
Show file tree
Hide file tree
Showing 10 changed files with 265 additions and 90 deletions.
2 changes: 1 addition & 1 deletion apps/sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"dev": "next dev --turbo",
"build": "next build",
"start": "next start",
"lint": "next lint"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"jest": "^29.7.0",
"lint-staged": "^15.2.0",
"prettier": "^3.1.1",
"rollup": "^4.9.6",
"turbo": "^1.11.2",
"typescript": "^5.3.3",
"zx": "^7.2.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/config/eslint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = {
},
},
{
files: ["**/scripts/*.mjs"],
files: ["**/*.mjs"],
env: {
es6: true,
node: true,
Expand Down
4 changes: 2 additions & 2 deletions packages/config/typescript/sdk.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"experimentalDecorators": true,
"stripInternal": true,
"emitDecoratorMetadata": true,
"moduleResolution": "NodeNext",
"module": "NodeNext"
"moduleResolution": "bundler",
"module": "esnext"
},
"exclude": ["node_modules"]
}
9 changes: 5 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"./lib"
],
"scripts": {
"build": "rm -rf lib && tsc && tsc-alias",
"dev": "tsc && (concurrently \"tsc -w\" \"tsc-alias -w\")",
"build": "rm -rf lib && rollup -c",
"dev": "rollup -c -w",
"lint": "eslint --cache --ext .ts \"src\"",
"lint:fix": "eslint --cache --fix --ext .ts \"src\"",
"test": "jest src",
Expand All @@ -28,8 +28,9 @@
"@ledgerhq/eslint-config-dsdk": "workspace:*",
"@ledgerhq/jest-config-dsdk": "workspace:*",
"@ledgerhq/tsconfig-dsdk": "workspace:*",
"concurrently": "^8.2.2",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-typescript": "^11.1.6",
"ts-node": "^10.9.2",
"tsc-alias": "^1.8.8"
"tslib": "^2.6.2"
}
}
12 changes: 12 additions & 0 deletions packages/core/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import typescript from "@rollup/plugin-typescript";
import commonJs from "@rollup/plugin-commonjs";

export default {
input: "src/index.ts",
output: {
dir: "lib",
format: "esm",
sourcemap: true,
},
plugins: [commonJs(), typescript({ tsconfig: "./tsconfig.json" })],
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import {
import { Config } from "@internal/config/model/Config";
import { LocalConfigDataSource } from "./ConfigDataSource";

// TODO: Remove fs and path as they are node apis
// const version = {
// name: "DeviceSDK",
// version: "0.0.0-local.1",
// };

/**
*
* class FileLocalConfigDataSource
Expand Down
2 changes: 1 addition & 1 deletion packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"@internal/*": ["src/internal/*"]
}
},
"include": ["src/**/*", "jest.config.ts", "jest.setup.ts"],
"include": ["src/**/*"],
"exclude": ["src/**/*.test.ts"]
}
2 changes: 1 addition & 1 deletion packages/core/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"@internal/*": ["src/internal/*"]
}
},
"include": ["src/**/*.test.ts"]
"include": ["src/**/*.test.ts", "jest.config.ts", "jest.setup.ts"]
}
Loading

0 comments on commit 5ba0522

Please sign in to comment.