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

Remove node export conditions #744

Merged
merged 4 commits into from
Mar 13, 2024
Merged
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
8 changes: 1 addition & 7 deletions packages/protobuf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
},
"scripts": {
"clean": "rm -rf ./dist/*",
"build": "npm run build:cjs && npm run build:esm && npm run build:proxy",
"build": "npm run build:cjs && npm run build:esm",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also delete scripts/gen-esm-proxy.mjs ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omg, I swear I removed this. I must not have pushed it.

"build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module ES2015 --verbatimModuleSyntax --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
"build:proxy": "node ../../scripts/gen-esm-proxy.mjs .",
"bootstrap:featureset-defaults": "upstream-inject-feature-defaults src/private/feature-set.ts",
"prebootstrap:wkt": "rm -rf .tmp && mkdir -p .tmp/google/protobuf && cp -rp src/google/protobuf/* .tmp/google/protobuf",
"bootstrap:wkt": "protoc --es_out=src --es_opt=bootstrap_wkt=true,ts_nocheck=false,target=ts --proto_path $(upstream-include wkt) $(upstream-files wkt) && license-header src/google/protobuf",
Expand All @@ -25,11 +24,6 @@
"main": "./dist/cjs/index.js",
"exports": {
".": {
"node": {
"import": "./dist/proxy/index.js",
"require": "./dist/cjs/index.js"
},
"module": "./dist/esm/index.js",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/protobuf/src/create-descriptor-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import type { BinaryReadOptions, BinaryWriteOptions } from "./binary-format.js";
import type { FeatureResolverFn } from "./private/feature-set.js";
import { createFeatureResolver } from "./private/feature-set.js";
import { LongType, ScalarType } from "./scalar.js";
import { isMessage } from "./is-message";
import { isMessage } from "./is-message.js";

/**
* Create a DescriptorSet, a convenient interface for working with a set of
Expand Down
2 changes: 1 addition & 1 deletion packages/protobuf/src/create-registry-from-desc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ import type {
import { createDescriptorSet } from "./create-descriptor-set.js";
import type { Extension } from "./extension.js";
import type { ExtensionFieldSource } from "./private/extensions.js";
import { isMessage } from "./is-message";
import { isMessage } from "./is-message.js";

// well-known message types with specialized JSON representation
const wkMessages = [
Expand Down
2 changes: 1 addition & 1 deletion packages/protobuf/src/private/binary-format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { assert } from "./assert.js";
import { isFieldSet } from "./reflect.js";
import type { ScalarValue } from "../scalar.js";
import { LongType, ScalarType } from "../scalar.js";
import { isMessage } from "../is-message";
import { isMessage } from "../is-message.js";

/* eslint-disable prefer-const,no-case-declarations,@typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-return */

Expand Down
2 changes: 1 addition & 1 deletion packages/protobuf/src/private/field-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Message } from "../message.js";
import type { MessageType } from "../message-type.js";
import type { DescExtension, DescField } from "../descriptor-set.js";
import { ScalarType } from "../scalar.js";
import { isMessage } from "../is-message";
import { isMessage } from "../is-message.js";

/* eslint-disable @typescript-eslint/no-explicit-any -- unknown fields are represented with any */

Expand Down
2 changes: 1 addition & 1 deletion packages/protobuf/src/private/json-format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { scalarZeroValue } from "./scalars.js";
import { isScalarZeroValue } from "./scalars.js";
import type { ScalarValue } from "../scalar.js";
import { LongType, ScalarType } from "../scalar.js";
import { isMessage } from "../is-message";
import { isMessage } from "../is-message.js";

/* eslint-disable no-case-declarations,@typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call */

Expand Down
2 changes: 1 addition & 1 deletion packages/protobuf/src/private/util-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type { MessageType } from "../message-type.js";
import type { Util } from "./util.js";
import { scalarEquals } from "./scalars.js";
import { ScalarType } from "../scalar.js";
import { isMessage } from "../is-message";
import { isMessage } from "../is-message.js";

/* eslint-disable @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-argument,no-case-declarations */

Expand Down
2 changes: 1 addition & 1 deletion packages/protobuf/src/to-plain-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { Message } from "./message.js";
import type { AnyMessage, PlainMessage } from "./message.js";
import { isMessage } from "./is-message";
import { isMessage } from "./is-message.js";

/**
* toPlainMessage returns a new object by stripping
Expand Down
13 changes: 1 addition & 12 deletions packages/protoplugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,20 @@
},
"scripts": {
"clean": "rm -rf ./dist/*",
"build": "npm run build:cjs && npm run build:esm && npm run build:proxy",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module ES2015 --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
"build:proxy": "node ../../scripts/gen-esm-proxy.mjs . ecmascript",
"attw": "attw --pack"
},
"type": "module",
"sideEffects": false,
"main": "./dist/cjs/index.js",
"exports": {
".": {
"node": {
"import": "./dist/proxy/index.js",
"require": "./dist/cjs/index.js"
},
"module": "./dist/esm/index.js",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"./ecmascript": {
"node": {
"import": "./dist/proxy/ecmascript/index.js",
"require": "./dist/cjs/ecmascript/index.js"
},
"module": "./dist/esm/ecmascript/index.js",
"import": "./dist/esm/ecmascript/index.js",
"require": "./dist/cjs/ecmascript/index.js"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/protoplugin/src/ecmascript/generated-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
LiteralString,
RefDescEnum,
RefDescMessage,
} from "./opaque-printables";
} from "./opaque-printables.js";

/**
* All types that can be passed to GeneratedFile.print()
Expand Down
117 changes: 0 additions & 117 deletions scripts/gen-esm-proxy.mjs

This file was deleted.

Loading