Skip to content

Commit d51e344

Browse files
committed
feat: support OIDC trusted publishing
1 parent 96095e2 commit d51e344

File tree

18 files changed

+302
-30
lines changed

18 files changed

+302
-30
lines changed

integration/tsconfig.spec.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"__tests__/**/*.spec.js",
1616
"__tests__/**/*.test.jsx",
1717
"__tests__/**/*.spec.jsx",
18-
"__tests__/**/*.d.ts"
18+
"__tests__/**/*.d.ts",
19+
"../libs/core/src/types.d.ts"
1920
]
2021
}

libs/commands/changed/tsconfig.spec.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@
55
"module": "commonjs",
66
"types": ["jest", "node"]
77
},
8-
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
8+
"include": [
9+
"jest.config.ts",
10+
"src/**/*.test.ts",
11+
"src/**/*.spec.ts",
12+
"src/**/*.d.ts",
13+
"../../core/src/types.d.ts"
14+
]
915
}

libs/commands/diff/tsconfig.spec.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@
55
"module": "commonjs",
66
"types": ["jest", "node"]
77
},
8-
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
8+
"include": [
9+
"jest.config.ts",
10+
"src/**/*.test.ts",
11+
"src/**/*.spec.ts",
12+
"src/**/*.d.ts",
13+
"../../core/src/types.d.ts"
14+
]
915
}

libs/commands/exec/tsconfig.spec.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@
55
"module": "commonjs",
66
"types": ["jest", "node"]
77
},
8-
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
8+
"include": [
9+
"jest.config.ts",
10+
"src/**/*.test.ts",
11+
"src/**/*.spec.ts",
12+
"src/**/*.d.ts",
13+
"../../core/src/types.d.ts"
14+
]
915
}

libs/commands/import/tsconfig.spec.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@
55
"module": "commonjs",
66
"types": ["jest", "node"]
77
},
8-
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
8+
"include": [
9+
"jest.config.ts",
10+
"src/**/*.test.ts",
11+
"src/**/*.spec.ts",
12+
"src/**/*.d.ts",
13+
"../../core/src/types.d.ts"
14+
]
915
}

libs/commands/info/tsconfig.spec.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@
55
"module": "commonjs",
66
"types": ["jest", "node"]
77
},
8-
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
8+
"include": [
9+
"jest.config.ts",
10+
"src/**/*.test.ts",
11+
"src/**/*.spec.ts",
12+
"src/**/*.d.ts",
13+
"../../core/src/types.d.ts"
14+
]
915
}

libs/commands/init/tsconfig.spec.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@
55
"module": "commonjs",
66
"types": ["jest", "node"]
77
},
8-
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
8+
"include": [
9+
"jest.config.ts",
10+
"src/**/*.test.ts",
11+
"src/**/*.spec.ts",
12+
"src/**/*.d.ts",
13+
"../../core/src/types.d.ts"
14+
]
915
}

libs/commands/list/tsconfig.spec.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@
55
"module": "commonjs",
66
"types": ["jest", "node"]
77
},
8-
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
8+
"include": [
9+
"jest.config.ts",
10+
"src/**/*.test.ts",
11+
"src/**/*.spec.ts",
12+
"src/**/*.d.ts",
13+
"../../core/src/types.d.ts"
14+
]
915
}

libs/commands/publish/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -993,8 +993,8 @@ class PublishCommand extends Command {
993993

994994
return pulseTillDone(
995995
queue
996-
? queue.queue(() => npmPublish(pkg, pkg.packed.tarFilePath, pkgOpts, this.otpCache))
997-
: npmPublish(pkg, pkg.packed.tarFilePath, pkgOpts, this.otpCache)
996+
? queue.queue(() => npmPublish(pkg, pkg.packed.tarFilePath, pkgOpts, this.conf, this.otpCache))
997+
: npmPublish(pkg, pkg.packed.tarFilePath, pkgOpts, this.conf, this.otpCache)
998998
)
999999
.then(() => {
10001000
this.publishedPackages.push(pkg);

libs/commands/publish/src/lib/publish-command.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ Map {
260260
expect.objectContaining({ name: "package-1" }),
261261
"/TEMP_DIR/package-1-MOCKED.tgz",
262262
expect.objectContaining({ otp }),
263+
expect.objectContaining({ root: expect.any(Object) }),
263264
expect.objectContaining({ otp })
264265
);
265266
expect(getOneTimePassword).not.toHaveBeenCalled();
@@ -276,6 +277,7 @@ Map {
276277
expect.objectContaining({ name: "package-1" }),
277278
"/TEMP_DIR/package-1-MOCKED.tgz",
278279
expect.objectContaining({ otp: undefined }),
280+
expect.objectContaining({ root: expect.any(Object) }),
279281
expect.objectContaining({ otp: "654321" })
280282
);
281283
expect(getOneTimePassword).toHaveBeenLastCalledWith("Enter OTP:");
@@ -292,6 +294,7 @@ Map {
292294
expect.objectContaining({ name: "package-1" }),
293295
"/TEMP_DIR/package-1-MOCKED.tgz",
294296
expect.objectContaining({ otp: undefined }),
297+
expect.objectContaining({ root: expect.any(Object) }),
295298
expect.objectContaining({ otp: undefined })
296299
);
297300
expect(getOneTimePassword).not.toHaveBeenCalled();
@@ -310,6 +313,7 @@ Map {
310313
expect.objectContaining({ name: "package-1" }),
311314
"/TEMP_DIR/package-1-MOCKED.tgz",
312315
expect.objectContaining({ "auth-type": "legacy", _auth: auth }),
316+
expect.objectContaining({ root: expect.any(Object) }),
313317
expect.objectContaining({ otp: undefined })
314318
);
315319
});
@@ -326,6 +330,7 @@ Map {
326330
expect.objectContaining({ name: "package-1" }),
327331
"/TEMP_DIR/package-1-MOCKED.tgz",
328332
expect.objectContaining({ registry }),
333+
expect.objectContaining({ root: expect.any(Object) }),
329334
expect.objectContaining({ otp: undefined })
330335
);
331336
});
@@ -340,6 +345,7 @@ Map {
340345
expect.objectContaining({ name: "package-1" }),
341346
"/TEMP_DIR/package-1-MOCKED.tgz",
342347
expect.objectContaining({ registry: "https://registry.npmjs.org/" }),
348+
expect.objectContaining({ root: expect.any(Object) }),
343349
expect.objectContaining({ otp: undefined })
344350
);
345351

0 commit comments

Comments
 (0)