Skip to content

Commit

Permalink
bumping versions, going back to use jsondiffpatch instead of jsondiff…
Browse files Browse the repository at this point in the history
…patch-rc
  • Loading branch information
tnrich committed Jul 28, 2023
1 parent eb4baa7 commit c557121
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 42 deletions.
5 changes: 4 additions & 1 deletion output.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"options": {
"target": "es2015",
"outputPath": "dist/sequence-utils"
},
"configurations": {}
Expand Down Expand Up @@ -193,7 +194,7 @@
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"options": {
"generatePackageJson": true,
"target": "es2015",
"outputPath": "dist/bio-parsers"
},
"configurations": {}
Expand Down Expand Up @@ -259,6 +260,7 @@
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"options": {
"target": "es2015",
"outputPath": "dist/range-utils"
},
"configurations": {}
Expand Down Expand Up @@ -324,6 +326,7 @@
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"options": {
"target": "es2015",
"outputPath": "dist/file-utils"
},
"configurations": {}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teselagen/source",
"version": "0.0.0",
"version": "0.2.0",
"license": "MIT",
"scripts": {
"prepare": "husky install",
Expand Down
2 changes: 1 addition & 1 deletion packages/bio-parsers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teselagen/bio-parsers",
"version": "0.1.25",
"version": "0.3.2",
"type": "commonjs",
"dependencies": {
"@gmod/gff": "^1.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/bio-parsers/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"options": {
"generatePackageJson": true,
"target": "es2015",
"outputPath": "dist/bio-parsers"
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/bounce-loader/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@teselagen/bounce-loader",
"version": "0.0.13",
"version": "0.3.2",
"main": "./src/index.js"
}
2 changes: 1 addition & 1 deletion packages/file-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teselagen/file-utils",
"version": "0.2.26",
"version": "0.3.2",
"type": "commonjs",
"dependencies": {
"bluebird": "^3.7.2",
Expand Down
1 change: 1 addition & 0 deletions packages/file-utils/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"options": {
"target": "es2015",
"outputPath": "dist/file-utils"
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/ove/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@teselagen/ove",
"version": "0.0.19",
"version": "0.3.2",
"main": "./src/index.js"
}
2 changes: 1 addition & 1 deletion packages/range-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teselagen/range-utils",
"version": "0.1.19",
"version": "0.3.2",
"type": "commonjs",
"dependencies": {
"lodash": "^4.17.21"
Expand Down
1 change: 1 addition & 0 deletions packages/range-utils/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"options": {
"target": "es2015",
"outputPath": "dist/range-utils"
}
},
Expand Down
4 changes: 2 additions & 2 deletions packages/sequence-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@teselagen/sequence-utils",
"version": "0.1.20",
"version": "0.3.2",
"type": "commonjs",
"dependencies": {
"bson-objectid": "^2.0.4",
"escape-string-regexp": "^5.0.0",
"jsondiffpatch-rc": "0.4.2",
"jsondiffpatch": "0.4.1",
"string-splice": "^1.3.0"
}
}
1 change: 1 addition & 0 deletions packages/sequence-utils/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"options": {
"target": "es2015",
"outputPath": "dist/sequence-utils"
}
},
Expand Down
34 changes: 14 additions & 20 deletions packages/sequence-utils/src/diffUtils.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,36 @@
import { cloneDeep, forEach } from 'lodash';
import {
diff,
patch,
reverse,
} from 'jsondiffpatch-rc';

import tidyUpSequenceData from './tidyUpSequenceData';
import { cloneDeep, forEach } from "lodash";
import { diff, patch, reverse } from "jsondiffpatch/dist/jsondiffpatch.umd";

import tidyUpSequenceData from "./tidyUpSequenceData";

const getDiffFromSeqs = (oldData, newData, { ignoreKeys = [] } = {}) => {

oldData = tidyUpSequenceData(oldData, {
annotationsAsObjects: true,
noTranslationData: true,
noTranslationData: true
});
newData = tidyUpSequenceData(newData, {
annotationsAsObjects: true,
noTranslationData: true,
noTranslationData: true
});

[oldData, newData].forEach((d) => {
[
'cutsites',
'orfs',
'filteredFeatures',
'size',
'fromFileUpload',
'description',
'materiallyAvailable',
...ignoreKeys,
"cutsites",
"orfs",
"filteredFeatures",
"size",
"fromFileUpload",
"description",
"materiallyAvailable",
...ignoreKeys
].forEach((prop) => {
delete d[prop];
});
if (d.translations) {
forEach(d.translations, (translation, key) => {
if (
translation.translationType &&
translation.translationType !== 'User Created'
translation.translationType !== "User Created"
) {
delete d.translations[key];
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@teselagen/ui",
"version": "0.0.24",
"version": "0.3.2",
"main": "./src/index.js"
}
2 changes: 1 addition & 1 deletion packages/ui/package_simple.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teselagen/ui",
"version": "0.0.14",
"version": "0.2.0",
"main": "./src/index.js",
"type": "module",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/uploader/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teselagen/uploader",
"version": "0.0.1",
"version": "0.2.0",
"main": "./index.js",
"types": "./index.d.ts",
"type": "commonjs",
Expand Down
1 change: 1 addition & 0 deletions tools/scripts/publish.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ if (!version || version === "undefined") {
try {
json.version = version;
json.type = "commonjs";
json.license = "MIT";
json.dependencies = { ...deps, ...json.dependencies };
writeFileSync(`package.json`, JSON.stringify(json, null, 2));
} catch (e) {
Expand Down
24 changes: 20 additions & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import viteTsConfigPaths from "vite-tsconfig-paths";
import dts from "vite-plugin-dts";
import { joinPathFragments } from "@nx/devkit";
import { camelCase } from "lodash";
import { viteStaticCopy } from "vite-plugin-static-copy";

//vite config for simple iso packages

const conf = ({
name,
Expand All @@ -15,17 +18,29 @@ const conf = ({
name: string;
dir: string;
}) =>
defineConfig({
defineConfig(({ command }) => ({
cacheDir: `../../node_modules/.vite/${name}`,
plugins: [
dts({
entryRoot: "src",
tsconfigPath: joinPathFragments(dir, "tsconfig.json")
}),

viteTsConfigPaths({
root: "../../"
})
}),
...(command === "build"
? [
// noBundlePlugin({ copy: "**/*.css" }),
viteStaticCopy({
targets: [
{
src: "./src",
dest: "."
}
]
})
]
: [])
],
esbuild: {
keepNames: true,
Expand All @@ -47,6 +62,7 @@ const conf = ({
build: {
minify: false,
target: "es2015",
outDir: `../../dist/${name}`,
lib: {
// Could also be a dictionary or array of multiple entry points.
entry: "src/index.js",
Expand Down Expand Up @@ -75,6 +91,6 @@ const conf = ({
"test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"
]
}
});
}));

export default conf;
2 changes: 2 additions & 0 deletions vite.react.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { getPort } from "./getPort";
import { viteStaticCopy } from "vite-plugin-static-copy";
import path from "node:path";

//vite config for react packages

const justSrc = [
/\/src\/.*\.js$/,
/\/src\/.*\.jsx$/,
Expand Down
11 changes: 6 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4895,7 +4895,7 @@ chalk@5.2.0:
resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.2.0.tgz#249623b7d66869c673699fb66d65723e54dfcfb3"
integrity sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==

chalk@^2.0.0:
chalk@^2.0.0, chalk@^2.3.0:
version "2.4.2"
resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
Expand Down Expand Up @@ -8508,11 +8508,12 @@ jsonc-parser@3.2.0, jsonc-parser@^3.2.0:
resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz"
integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==

jsondiffpatch-rc@0.4.2:
version "0.4.2"
resolved "https://registry.npmjs.org/jsondiffpatch-rc/-/jsondiffpatch-rc-0.4.2.tgz"
integrity sha512-Y1qBHcinsSX6E24KvYEAzybrmhnyy/eg2uhablTW76oKrdY0nYeWoXRlMCvTXG0Nv/zlzGwAfb3mxg1JzitLug==
jsondiffpatch@0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/jsondiffpatch/-/jsondiffpatch-0.4.1.tgz#9fb085036767f03534ebd46dcd841df6070c5773"
integrity sha512-t0etAxTUk1w5MYdNOkZBZ8rvYYN5iL+2dHCCx/DpkFm/bW28M6y5nUS83D4XdZiHy35Fpaw6LBb+F88fHZnVCw==
dependencies:
chalk "^2.3.0"
diff-match-patch "^1.0.0"

jsonfile@^4.0.0:
Expand Down

0 comments on commit c557121

Please sign in to comment.