@isrd-isi-edu/ermrestjs 2.9.0 → 2.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/js/hatrac.js CHANGED
@@ -171,8 +171,8 @@ export function Upload(file, otherInfo) {
171
171
  if (!this.file) throw new Error('No file provided while creating hatrac file object');
172
172
 
173
173
  this.storedFilename = file.name; // the name that will be used for content-disposition and filename column
174
- // eslint-disable-next-line @typescript-eslint/no-require-imports, no-undef
175
- if (ENV_IS_NODE) this.file.buffer = require('fs').readFileSync(file.path);
174
+ /* In Node (unit tests) the caller provides `file.buffer`; the browser path reads via FileReader.
175
+ We avoid importing `fs` here so the browser bundle has no Node built-ins to stub. */
176
176
 
177
177
  this.column = otherInfo.column;
178
178
  if (!this.column) throw new Error('No column provided while creating hatrac file object');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@isrd-isi-edu/ermrestjs",
3
3
  "description": "ERMrest client library in JavaScript",
4
- "version": "2.9.0",
4
+ "version": "2.9.1",
5
5
  "license": "Apache-2.0",
6
6
  "engines": {
7
7
  "node": ">= 20.0.0",
@@ -67,7 +67,7 @@
67
67
  "spark-md5": "^3.0.0",
68
68
  "terser": "^5.44.1",
69
69
  "typescript": "~5.9.3",
70
- "vite": "^7.3.2",
70
+ "vite": "^8.0.16",
71
71
  "vite-plugin-compression2": "^2.5.3"
72
72
  },
73
73
  "devDependencies": {
@@ -1688,7 +1688,7 @@ export class Reference {
1688
1688
  /**
1689
1689
  * Returns true if
1690
1690
  * - ermrest supports tcrs, and
1691
- * - table has dynamic acls, and
1691
+ * - table or any of the columns of the table have dynamic acls, and
1692
1692
  * - table has RID column, and
1693
1693
  * - table is not marked non-updatable by annotation
1694
1694
  */
@@ -1698,7 +1698,7 @@ export class Reference {
1698
1698
  this._canUseTCRS =
1699
1699
  this.table.schema.catalog.features[rightKey] === true &&
1700
1700
  // eslint-disable-next-line eqeqeq
1701
- this.table.rights[_ERMrestACLs.UPDATE] == null &&
1701
+ (this.table.rights[_ERMrestACLs.UPDATE] == null || this.table.columns.all().some((col) => col.rights[_ERMrestACLs.UPDATE] == null)) &&
1702
1702
  this.table.columns.has('RID') &&
1703
1703
  this.canUpdate;
1704
1704
  }
package/vite.config.mts CHANGED
@@ -24,7 +24,7 @@ export default defineConfig(async (): Promise<UserConfig> => {
24
24
  // dev related plugins
25
25
  if (isDev) {
26
26
  // visualize the bundle size
27
- const { visualizer } = await import('rollup-plugin-visualizer');
27
+ const { visualizer } = await import(/* @vite-ignore */ 'rollup-plugin-visualizer');
28
28
  plugins.push(
29
29
  visualizer({
30
30
  filename: resolve(__dirname, 'dist', 'stats.html'),
@@ -61,14 +61,12 @@ export default defineConfig(async (): Promise<UserConfig> => {
61
61
  name: 'ERMrest',
62
62
  format: 'umd',
63
63
  entryFileNames: 'ermrest.js',
64
- inlineDynamicImports: true,
65
64
  },
66
65
  // the following is the main build that chaise uses:
67
66
  {
68
67
  name: 'ERMrest',
69
68
  format: 'umd',
70
69
  entryFileNames: 'ermrest.min.js',
71
- inlineDynamicImports: true,
72
70
  },
73
71
  ],
74
72
  },
@@ -84,6 +82,13 @@ export default defineConfig(async (): Promise<UserConfig> => {
84
82
  resolve: {
85
83
  alias: {
86
84
  '@isrd-isi-edu/ermrestjs': resolve(__dirname),
85
+ /**
86
+ * markdown-it imports the deprecated Node `punycode` builtin. In a browser
87
+ * build that gets externalized to a stub and logs a warning. markdown-it only
88
+ * calls it inside try/catch for hostname normalization, so an empty shim is
89
+ * safe (ASCII URLs unaffected) and silences the warning.
90
+ */
91
+ punycode: resolve(__dirname, 'vendor/punycode-shim.js'),
87
92
  },
88
93
  },
89
94
  plugins,