From b1675cc930668c5ff7d6a7c94d41c6476898fbc3 Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Mon, 9 Dec 2024 22:13:12 +0300 Subject: [PATCH 1/4] ci: reattach js to semrel --- .github/workflows/jsr-publish.yml | 19 ---- .gitignore | 171 +++++++++++++++++++++++++++++- jsr.json | 6 -- 3 files changed, 169 insertions(+), 27 deletions(-) delete mode 100644 .github/workflows/jsr-publish.yml delete mode 100644 jsr.json diff --git a/.github/workflows/jsr-publish.yml b/.github/workflows/jsr-publish.yml deleted file mode 100644 index ad5781d..0000000 --- a/.github/workflows/jsr-publish.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Publish -on: - push: - branches: - - main - -jobs: - publish: - runs-on: ubuntu-latest - - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@v4 - - - name: Publish package - run: npx jsr publish diff --git a/.gitignore b/.gitignore index 4ef133f..5a13bd3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,169 @@ -/node_modules/ -package-lock.json +# IDEs +.idea + +# Credentials +**/*.asc +**/*.key +**/*.pem +**/*.cert +**/.npmrc +**/.yarnrc + +# Bundles +bundle +build +buildstamp.json +dist +docs +flow-typed +lib +target/* +!target/cjs/ +!target/esm/ +!target/dts/ +typings +jsr.json + +# Temp assets +.temp +temp + +# Codeclimate +codeclimate.* +cc-reporter +cc-reporter.* + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +coverage.* +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo +.tsbuildinfo +buildcache +.buildcache + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* diff --git a/jsr.json b/jsr.json deleted file mode 100644 index 8bbd945..0000000 --- a/jsr.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "@webpod/zurk", - "version": "0.9.0", - "license": "MIT", - "exports": "./mod.ts" -} From f477716cf58781b60627eff132dba31532e23268 Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Mon, 9 Dec 2024 23:25:16 +0300 Subject: [PATCH 2/4] fix: relax `isTemplateLiteral` check for tslib compat https://github.com/microsoft/tslib/pull/277 --- package-lock.json | 10 ++++++---- package.json | 1 + src/main/ts/util.ts | 2 +- src/test/ts/util.test.ts | 2 ++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 95f42f7..89ca96a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "jsr": "^0.13.2", "minimist": "^1.2.8", "ts-node": "^10.9.2", + "tslib": "^2.8.1", "typedoc": "^0.27.2", "typescript": "^5.7.2" } @@ -8176,10 +8177,11 @@ } }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" }, "node_modules/type-check": { "version": "0.4.0", diff --git a/package.json b/package.json index 138278c..87f776f 100644 --- a/package.json +++ b/package.json @@ -87,6 +87,7 @@ "jsr": "^0.13.2", "minimist": "^1.2.8", "ts-node": "^10.9.2", + "tslib": "^2.8.1", "typedoc": "^0.27.2", "typescript": "^5.7.2" } diff --git a/src/main/ts/util.ts b/src/main/ts/util.ts index 77efc97..1c698e5 100644 --- a/src/main/ts/util.ts +++ b/src/main/ts/util.ts @@ -38,7 +38,7 @@ export const isStringLiteral = ( ): pieces is TemplateStringsArray => pieces?.length > 0 && pieces.raw?.length === pieces.length && - Object.isFrozen(pieces) && + // Object.isFrozen(pieces) && rest.length + 1 === pieces.length export const assign = (target: T, ...extras: E[]): T => diff --git a/src/test/ts/util.test.ts b/src/test/ts/util.test.ts index 94df44d..177e7a1 100644 --- a/src/test/ts/util.test.ts +++ b/src/test/ts/util.test.ts @@ -1,6 +1,7 @@ import * as assert from 'node:assert' import {describe, it, test} from 'node:test' import { assign, isStringLiteral } from '../../main/ts/util.js' +import tslib from 'tslib' describe('util', () => { it('assign()', () => { @@ -13,6 +14,7 @@ describe('util', () => { assert.ok(isStringLiteral``) assert.ok(isStringLiteral`foo`) assert.ok(isStringLiteral`foo ${bar}`) + assert.ok(isStringLiteral(tslib.__makeTemplateObject(["git pull --tags --force ", " ", ""], ["git pull --tags --force ", " ", ""]), 'foo', 'bar')) assert.ok(!isStringLiteral('')) assert.ok(!isStringLiteral('foo')) From 6b45f0b65a2f80b8e1d257a913d971b35672ae3e Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Mon, 9 Dec 2024 23:29:18 +0300 Subject: [PATCH 3/4] chore: update npmignore --- .gitignore | 164 +---------------------------------------------------- 1 file changed, 1 insertion(+), 163 deletions(-) diff --git a/.gitignore b/.gitignore index 5a13bd3..cf203ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,169 +1,7 @@ -# IDEs -.idea - -# Credentials -**/*.asc -**/*.key -**/*.pem -**/*.cert -**/.npmrc -**/.yarnrc - -# Bundles -bundle -build -buildstamp.json -dist -docs -flow-typed -lib target/* !target/cjs/ !target/esm/ !target/dts/ -typings jsr.json - -# Temp assets -.temp -temp - -# Codeclimate -codeclimate.* -cc-reporter -cc-reporter.* - -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -coverage.* -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo -.tsbuildinfo -buildcache -.buildcache - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional stylelint cache -.stylelintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variable files -.env -.env.development.local -.env.test.local -.env.production.local -.env.local - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# vuepress v2.x temp and cache directory -.temp -.cache - -# Docusaurus cache and generated files -.docusaurus - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* +buildstamp.json From 6ab003348586432b8d7f76d30ee4b50a33a37c04 Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Mon, 9 Dec 2024 23:31:49 +0300 Subject: [PATCH 4/4] chore: update target --- target/cjs/util.cjs | 3 ++- target/esm/util.mjs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target/cjs/util.cjs b/target/cjs/util.cjs index 487ca61..34490dc 100644 --- a/target/cjs/util.cjs +++ b/target/cjs/util.cjs @@ -50,7 +50,8 @@ var makeDeferred = () => { var isPromiseLike = (value) => typeof (value == null ? void 0 : value.then) === "function"; var isStringLiteral = (pieces, ...rest) => { var _a; - return (pieces == null ? void 0 : pieces.length) > 0 && ((_a = pieces.raw) == null ? void 0 : _a.length) === pieces.length && Object.isFrozen(pieces) && rest.length + 1 === pieces.length; + return (pieces == null ? void 0 : pieces.length) > 0 && ((_a = pieces.raw) == null ? void 0 : _a.length) === pieces.length && // Object.isFrozen(pieces) && + rest.length + 1 === pieces.length; }; var assign = (target, ...extras) => Object.defineProperties(target, extras.reduce((m, extra) => __spreadValues(__spreadValues({}, m), Object.fromEntries(Object.entries(Object.getOwnPropertyDescriptors(extra)).filter(([, v]) => !Object.prototype.hasOwnProperty.call(v, "value") || v.value !== void 0))), {})); var quote = (arg) => { diff --git a/target/esm/util.mjs b/target/esm/util.mjs index d3c1ab6..d991a4d 100644 --- a/target/esm/util.mjs +++ b/target/esm/util.mjs @@ -22,7 +22,8 @@ var makeDeferred = () => { var isPromiseLike = (value) => typeof (value == null ? void 0 : value.then) === "function"; var isStringLiteral = (pieces, ...rest) => { var _a; - return (pieces == null ? void 0 : pieces.length) > 0 && ((_a = pieces.raw) == null ? void 0 : _a.length) === pieces.length && Object.isFrozen(pieces) && rest.length + 1 === pieces.length; + return (pieces == null ? void 0 : pieces.length) > 0 && ((_a = pieces.raw) == null ? void 0 : _a.length) === pieces.length && // Object.isFrozen(pieces) && + rest.length + 1 === pieces.length; }; var assign = (target, ...extras) => Object.defineProperties(target, extras.reduce((m, extra) => ({ ...m, ...Object.fromEntries(Object.entries(Object.getOwnPropertyDescriptors(extra)).filter(([, v]) => !Object.prototype.hasOwnProperty.call(v, "value") || v.value !== void 0)) }), {})); var quote = (arg) => {