Skip to content
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

Rewrite internals for v2 release #83

Merged
merged 36 commits into from
Apr 20, 2023
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a44a80a
wip: better behaved npm
mcous Apr 10, 2023
15f5601
wip: continue figuring out the shape of things
mcous Apr 11, 2023
07bd14c
wip: move on to publish
mcous Apr 11, 2023
36d603f
fixup: still going for it
mcous Apr 12, 2023
a4f2efd
wip: continuing along with tdd refactor
mcous Apr 12, 2023
9662ce0
fixup: switch ci to use new unit test suite
mcous Apr 14, 2023
54cc7a3
wip: almost through the rewrite, CLI left
mcous Apr 17, 2023
c3abcae
wip: let's see how this does
mcous Apr 17, 2023
b30569e
wip: fix up auth settings (thanks e2e tests)
mcous Apr 17, 2023
e7698e7
Test and CI fixes
mcous Apr 17, 2023
8c6f5a2
wip: e2e in matrix
mcous Apr 17, 2023
3eab721
wip: e2e node 16 fixes
mcous Apr 17, 2023
2088119
wip: fix ci
mcous Apr 17, 2023
d9fcce5
wip: fix ci
mcous Apr 17, 2023
865edee
wip: e2e registry login
mcous Apr 17, 2023
18f4a9d
wip: simplify normalized options
mcous Apr 17, 2023
b7b2dc9
fixup: test improvements
mcous Apr 18, 2023
28e9467
wip: revert docs changes for separate PR
mcous Apr 18, 2023
55ed2ee
fixup: build updates
mcous Apr 19, 2023
7b42108
fixup: cli usage typo
mcous Apr 19, 2023
409c72f
fixup: fix package paths with spaces
mcous Apr 19, 2023
7cd2fda
fixup: swap minimist for command-line-args due to windows path bugs
mcous Apr 19, 2023
21f93b9
fixup: revert, it was a powershell bug 🤦
mcous Apr 19, 2023
3b10db5
fixup: update e2e test to use spaces in package name
mcous Apr 19, 2023
87ee5ab
fixup: what if I was better at shell?
mcous Apr 19, 2023
28c3b35
fixup: spawn might be a better choice for windows
mcous Apr 19, 2023
bb42c2d
fixup: more windows work
mcous Apr 19, 2023
7dda521
fixup: keep trying to get these e2e tests to work with spaced package…
mcous Apr 20, 2023
9f02b38
fixup: think I got it this time
mcous Apr 20, 2023
676a76b
fixup: actually run these tests on different os's
mcous Apr 20, 2023
c71a30b
fixup: fix environment test on windows
mcous Apr 20, 2023
8578e2b
fixup: check name tweaks
mcous Apr 20, 2023
255f0da
fixup: error name typo
mcous Apr 20, 2023
2ec381c
fixup: build after typo fixes
mcous Apr 20, 2023
bca9d66
fixup: ci tweaks
mcous Apr 20, 2023
2cb1fd6
fixup: add missing sourcemap
mcous Apr 20, 2023
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
Prev Previous commit
Next Next commit
wip: let's see how this does
  • Loading branch information
mcous committed Apr 17, 2023
commit c3abcae939b58d19a24a4bc468919199d5e509f9
19 changes: 1 addition & 18 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -39,27 +39,10 @@ overrides:
- files: ["**/__tests__/**/*"]
rules:
"@typescript-eslint/no-unsafe-argument": "off"
"@typescript-eslint/no-unsafe-assignment": "off"
sonarjs/no-duplicate-string: "off"
unicorn/no-useless-undefined: "off"

- files: ["src/action/**/*"]
rules:
n/no-unpublished-import: "off"

# temporary rule overrides
# TODO(mc, 2023-04-12): fix problems, remove overrides, and remove --quiet
- files: ["bin/**/*", "src/cli/**/*"]
rules:
n/no-process-exit: "warn"
unicorn/no-process-exit: "warn"
prefer-const: "warn"
unicorn/prevent-abbreviations: "warn"
unicorn/prefer-module: "warn"
unicorn/prefer-top-level-await: "warn"
"@typescript-eslint/no-floating-promises": "warn"
"@typescript-eslint/no-unsafe-call": "warn"
"@typescript-eslint/no-unsafe-member-access": "warn"
"@typescript-eslint/restrict-template-expressions": "warn"
jsdoc/require-jsdoc: "warn"
jsdoc/require-param: "warn"
jsdoc/require-returns: "warn"
13 changes: 8 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -13,16 +13,19 @@ git clone https://github.com/JS-DevTools/npm-publish.git
# Install dependencies*
npm install

# Build the code
npm run build

# Run the tests
npm test
# Run all checks, builds, and unit tests
npm run all
```

There are also various code quality checks and tests you can run:

```shell
# Run builds and typechecking
npm run build

# Run the unit tests in watch mode
npm run test

# Autoformat the code
npm run format

29 changes: 17 additions & 12 deletions action.yml
Original file line number Diff line number Diff line change
@@ -24,13 +24,14 @@ inputs:
required: false

access:
description: Determines whether the published package should be publicly
visible, or restricted to members of your NPM organization. This only
applies to scoped packages.
description: >
Determines whether the published package should be publicly visible,
or restricted to members of your NPM organization.
required: false

strategy:
description: Version check and release strategy.
description: >
Version check and release strategy.
If "all" (default), package will be published if its version is simply not yet published.
If "upgrade", package will be published if its version is higher than the existing tag,
according to semantic versioning.
@@ -43,12 +44,14 @@ inputs:

outputs:
id:
description: The identifier of the published package.
description: >
The identifier of the published package.
If a release was published, format is `${name}@${version}.
If no release occurred, will be an empty string.

type:
description: The type of version change that occurred on the published tag.
description: >
The type of version change that occurred on the published tag.
If release was an upgrade, will be a semver release type ("major", "minor", ...).
If the published tag had no previous version, will be "initial".
If version was change was not an upgrade, will be "different".
@@ -61,7 +64,8 @@ outputs:
description: Version of the package.

old-version:
description: The previous version on the distribution tag.
description: >
The previous version on the distribution tag.
If there was no previous version on the tag, will be an empty string.

registry:
@@ -71,11 +75,12 @@ outputs:
description: The distribution tag used for version checking and publishing.

access:
description: The package access setting used.
If configured by the action or package.json, will be "public" or "protected".
If not configured for a non-scoped package, will be "public".
If not configured for a scoped package, will be "default".
description: >
The package access setting used.
If configured by the action or package.json, will be "public" or "protected".
If not configured for a non-scoped package, will be "public".
If not configured for a scoped package, will be "default".

runs:
using: node16
main: dist/index.js
main: dist/main.js
12 changes: 10 additions & 2 deletions bin/npm-publish.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/usr/bin/env node
/* eslint-disable unicorn/prefer-module, unicorn/prefer-top-level-await */
"use strict";
const { main } = require("../lib/cli");
main(process.argv.slice(2));

const process = require("node:process");
const { version } = require("../package.json");
const { main } = require("../lib/cli/index.js");

main(process.argv.slice(2), version).catch((error) => {
console.log(error);
process.exitCode = 1;
});
7 changes: 0 additions & 7 deletions dist/index.js.map

This file was deleted.

Loading
Oops, something went wrong.