Skip to content

Commit

Permalink
rebuild using new version with duplicates removal
Browse files Browse the repository at this point in the history
  • Loading branch information
callmephilip committed Feb 3, 2025
1 parent d296f96 commit 8c93f20
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 36 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jurassic/jurassic",
"version": "0.1.45",
"version": "0.1.46",
"license": "MIT",
"tasks": {
"build": "deno run -A --reload jsr:@jurassic/jurassic/export . && deno task runnbs && deno check . && deno lint && deno fmt && deno task clean && deno test --allow-all --env-file",
Expand Down
4 changes: 2 additions & 2 deletions jurassic/clean.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: clean.ipynb

import type { RawCell } from "jurassic/notebooks.ts";
import { loadNb, saveNb } from "jurassic/notebooks.ts";
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: clean.ipynb

const reprIdRegex = /(<.*?)( at 0x[0-9a-fA-F]+)(>)/;

const skipOrSub = (x: string): string =>
Expand Down
4 changes: 2 additions & 2 deletions jurassic/clean.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: clean.ipynb

import type { RawCell } from "jurassic/notebooks.ts";
import { loadNb, saveNb } from "jurassic/notebooks.ts";
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: clean.ipynb

const reprIdRegex = /(<.*?)( at 0x[0-9a-fA-F]+)(>)/;

const skipOrSub = (x: string): string =>
Expand Down
4 changes: 2 additions & 2 deletions jurassic/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: config.ipynb

import { z } from "zod";
import path from "node:path";
import { getNotebooksToProcess } from "jurassic/utils.ts";
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: config.ipynb

const configSchema: z.Schema = z.object({
configPath: z.string(),
nbsPath: z.string().default("."),
Expand Down
6 changes: 3 additions & 3 deletions jurassic/docs.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: docs.ipynb

import path from "node:path";
import type { Config } from "jurassic/config.ts";
import { getExportedDefinitions } from "jurassic/utils.ts";
import { getCellOutput, getNbTitle, loadNb } from "jurassic/notebooks.ts";
import type { Cell, Nb } from "jurassic/notebooks.ts";
import { getCellOutput, getNbTitle, loadNb } from "jurassic/notebooks.ts";
import { copySync } from "@std/fs";
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: docs.ipynb

const wrapCode = (code: string): string => "```typescript\n" + code + "\n```\n";

const processCell = (cell: Cell): string => {
Expand Down
6 changes: 3 additions & 3 deletions jurassic/docs.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: docs.ipynb

import path from "node:path";
import type { Config } from "jurassic/config.ts";
import { getExportedDefinitions } from "jurassic/utils.ts";
import { getCellOutput, getNbTitle, loadNb } from "jurassic/notebooks.ts";
import type { Cell, Nb } from "jurassic/notebooks.ts";
import { getCellOutput, getNbTitle, loadNb } from "jurassic/notebooks.ts";
import { copySync } from "@std/fs";
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: docs.ipynb

const wrapCode = (code: string): string => "```typescript\n" + code + "\n```\n";

const processCell = (cell: Cell): string => {
Expand Down
5 changes: 3 additions & 2 deletions jurassic/export.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: export.ipynb

import path from "node:path";
import { isDirective, loadNb } from "jurassic/notebooks.ts";
import {
getNotebooksToProcess,
removeDuplicateImports,
} from "jurassic/utils.ts";
import type { Config } from "jurassic/config.ts";
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: export.ipynb

const moduleHeader = (moduleName: string): string =>
`// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: ${moduleName}\n\n`;

Expand Down Expand Up @@ -37,6 +37,7 @@ const processNb = async (
: "",
];
};

export const exportNb = async (
notebookPath: string,
config: Config,
Expand Down
5 changes: 3 additions & 2 deletions jurassic/export.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: export.ipynb

import path from "node:path";
import { isDirective, loadNb } from "jurassic/notebooks.ts";
import {
getNotebooksToProcess,
removeDuplicateImports,
} from "jurassic/utils.ts";
import type { Config } from "jurassic/config.ts";
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: export.ipynb

const moduleHeader = (moduleName: string): string =>
`// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: ${moduleName}\n\n`;

Expand Down Expand Up @@ -37,6 +37,7 @@ const processNb = async (
: "",
];
};

export const exportNb = async (
notebookPath: string,
config: Config,
Expand Down
3 changes: 1 addition & 2 deletions jurassic/jdawg.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: jdawg.ipynb

import { loadNb } from "jurassic/notebooks.ts";
import { loadEnv, md } from "jurassic/utils.ts";
import Anthropic from "@anthropic-ai/sdk";
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: jdawg.ipynb

interface Message {
role: "assistant" | "user";
Expand Down
4 changes: 2 additions & 2 deletions jurassic/notebooks.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: notebooks.ipynb

import path from "node:path";
import { z } from "zod";
import { findDenoTests } from "jurassic/utils.ts";
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: notebooks.ipynb

const cellOutputSchema = z.object({
data: z.record(z.any()).optional(),
text: z.union([z.string(), z.array(z.string())]).optional(),
Expand Down
4 changes: 2 additions & 2 deletions jurassic/notebooks.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: notebooks.ipynb

import path from "node:path";
import { z } from "zod";
import { findDenoTests } from "jurassic/utils.ts";
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: notebooks.ipynb

const cellOutputSchema = z.object({
data: z.record(z.any()).optional(),
text: z.union([z.string(), z.array(z.string())]).optional(),
Expand Down
4 changes: 2 additions & 2 deletions jurassic/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: utils.ipynb

import path from "node:path";
import * as ts from "typescript";
import { loadSync } from "@std/dotenv";
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: utils.ipynb

export const md = async (content: string) => {
await Deno.jupyter.display({ "text/markdown": content }, { raw: true });
};
Expand Down
4 changes: 2 additions & 2 deletions jurassic/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: utils.ipynb

import path from "node:path";
import * as ts from "typescript";
import { loadSync } from "@std/dotenv";
// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: utils.ipynb

export const md = async (content: string) => {
await Deno.jupyter.display({ "text/markdown": content }, { raw: true });
};
Expand Down
22 changes: 13 additions & 9 deletions nbs/export.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"import path from 'node:path';\n",
"import { isDirective, loadNb } from 'jurassic/notebooks.ts';\n",
"import { getNotebooksToProcess, removeDuplicateImports } from 'jurassic/utils.ts';\n",
"import { Config } from 'jurassic/config.ts';\n",
"import type { Config } from 'jurassic/config.ts';\n",
"// 🦕 AUTOGENERATED! DO NOT EDIT! File to edit: export.ipynb\n",
"\n",
"\n",
Expand All @@ -167,19 +167,21 @@
" // get rid of directives, we want code only\n",
" (acc, cell) =>\n",
" acc + cell.source.filter((s) => !isDirective(s)).join(\"\"),\n",
" moduleHeader(moduleName)\n",
" )\n",
" moduleHeader(moduleName),\n",
" ),\n",
" ),\n",
" testCells.length !== 0\n",
" ? removeDuplicateImports(\n",
" testCells.reduce(\n",
" (acc, cell) => acc + cell.source.join(\"\"),\n",
" moduleHeader(moduleName)\n",
" )\n",
" )\n",
" testCells.reduce(\n",
" (acc, cell) => acc + cell.source.join(\"\"),\n",
" moduleHeader(moduleName),\n",
" ),\n",
" )\n",
" : \"\",\n",
" ];\n",
"};\n",
"\n",
"\n",
"export const exportNb = async (\n",
" notebookPath: string,\n",
" config: Config,\n",
Expand Down Expand Up @@ -251,7 +253,7 @@
"\n",
" Deno.copyFileSync(\n",
" path.resolve(getProjectRoot(), \"nbs/export.ipynb\"),\n",
" `${td}/nbs/export.ipynb`\n",
" `${td}/nbs/export.ipynb`,\n",
" );\n",
"\n",
" await t.step(\"test export\", async () => {\n",
Expand Down Expand Up @@ -284,6 +286,8 @@
"source": [
"// | export\n",
"\n",
"import path from \"node:path\";\n",
"\n",
"export const exportNb = async (\n",
" notebookPath: string,\n",
" config: Config,\n",
Expand Down

0 comments on commit 8c93f20

Please sign in to comment.