Skip to content
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
14 changes: 7 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
node-version: [ 18, 24 ]
node-version: [ 12, 18, 24 ]

runs-on: ${{ matrix.os }}
steps:
Expand All @@ -99,12 +99,12 @@ jobs:
# node --loader ts-node/esm --experimental-specifier-resolution=node ./src/test/ts/spawn.test.ts
# timeout-minutes: 5
#
# - name: Run smoke:esm tests
# if: matrix.node-version >= 12
# run: npm run test:smoke:esm
#
# - name: Run smoke:cjs tests
# run: npm run test:smoke:cjs
- name: Run smoke:esm tests
if: matrix.node-version >= 12
run: npm run test:smoke:esm

- name: Run smoke:cjs tests
run: npm run test:smoke:cjs

# smoke-bun:
# runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name: "CodeQL Advanced"

on:
push:
branches: ["turn-on-later"]
branches: [ "turn-on-later" ]
# push:
# branches: [ "main" ]
# pull_request:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"test:target": "git diff --exit-code --quiet || (echo 'Uncommitted changes' && exit 1)",
"_test:lint": "eslint -c src/test/lint/.eslintrc.json src",
"test:unit": "c8 -r lcov -r text -o target/coverage -x src/scripts -x src/test -x target node --experimental-specifier-resolution=node src/test/ts/ip.test.ts",
"_test:smoke:esm": "node ./src/test/smoke/invoke.test.mjs",
"_test:smoke:cjs": "node src/test/smoke/invoke.test.cjs",
"test:smoke:esm": "node ./src/test/smoke/ip.test.mjs",
"test:smoke:cjs": "node src/test/smoke/ip.test.cjs",
"test:jsr": "jsr publish --dry-run",
"test:audit": "npm audit",
"_publish:draft": "npm run build && npm publish --no-git-tag-version",
Expand Down
4 changes: 4 additions & 0 deletions src/main/ts/ip.ts
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
export const foo = 'bar'

export const ip = {foo}

export default ip
9 changes: 9 additions & 0 deletions src/test/smoke/ip.test.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const assert = require('assert')
const ip = require('@webpod/ip')

// Smoke CJS test
{
assert.equal(ip.foo, 'bar')
}

console.log('smoke cjs: ok')
9 changes: 9 additions & 0 deletions src/test/smoke/ip.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import assert from 'assert'
import ip from '@webpod/ip'

// Smoke ESM test
{
assert.equal(ip.foo, 'bar')
}

console.log('smoke ems: ok')
9 changes: 7 additions & 2 deletions target/cjs/ip.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ const {
// src/main/ts/ip.ts
var ip_exports = {};
__export(ip_exports, {
foo: () => foo
default: () => ip_default,
foo: () => foo,
ip: () => ip
});
module.exports = __toCommonJS(ip_exports);
var foo = "bar";
var ip = { foo };
var ip_default = ip;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
foo
foo,
ip
});
4 changes: 4 additions & 0 deletions target/dts/ip.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
export declare const foo = "bar";
export declare const ip: {
foo: string;
};
export default ip;
6 changes: 5 additions & 1 deletion target/esm/ip.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// src/main/ts/ip.ts
var foo = "bar";
var ip = { foo };
var ip_default = ip;
export {
foo
ip_default as default,
foo,
ip
};
Loading