Skip to content

Commit d582626

Browse files
committed
chore: npm scripts for release
1 parent 8f03237 commit d582626

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,19 @@
88
"raspberry pi pico",
99
"emulator"
1010
],
11+
"files": [
12+
"dist"
13+
],
1114
"author": "Uri Shaked <[email protected]>",
1215
"license": "MIT",
13-
"main": "index.js",
16+
"main": "./dist/cjs/index.js",
17+
"exports": {
18+
".": "./dist/esm/index.js"
19+
},
20+
"typings": "./dist/esm/index.d.ts",
1421
"scripts": {
22+
"build": "rimraf dist && tsc && tsc -p tsconfig.esm.json",
23+
"prepublish": "npm build",
1524
"start": "ts-node demo/emulator-run.ts",
1625
"start:gdb": "ts-node-dev src/gdbserver.ts",
1726
"test": "jest"
@@ -23,6 +32,7 @@
2332
"jest": "^26.6.3",
2433
"prettier": "^2.2.1",
2534
"pretty-quick": "^3.1.0",
35+
"rimraf": "^3.0.2",
2636
"ts-jest": "^26.4.4",
2737
"ts-node": "^9.1.1",
2838
"ts-node-dev": "^1.1.6",

src/rp2040.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ describe('RP2040', () => {
257257
it('should execute `bl 0x34` instruction', () => {
258258
const rp2040 = new RP2040();
259259
rp2040.PC = 0x10000000;
260-
console.log(opcodeBL(0x34).toString(16));
261260
rp2040.flashView.setUint32(0, opcodeBL(0x34), true);
262261
rp2040.executeInstruction();
263262
expect(rp2040.PC).toEqual(0x10000038);

tsconfig.esm.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"module": "esnext",
5+
"outDir": "./dist/esm"
6+
}
7+
}

tsconfig.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{
22
"compilerOptions": {
3+
"rootDir": "src",
34
"target": "es2015" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
45
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
5-
"outDir": "./dist" /* Redirect output structure to the directory. */,
6+
"outDir": "./dist/cjs" /* Redirect output structure to the directory. */,
67
"strict": true /* Enable all strict type-checking options. */,
8+
"declaration": true,
79
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
810
"skipLibCheck": true /* Skip type checking of declaration files. */,
911
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
10-
}
12+
},
13+
"include": ["src/**/*.ts"],
14+
"exclude": ["src/**/*.spec.ts"]
1115
}

0 commit comments

Comments
 (0)