Skip to content

Commit 145f811

Browse files
hbcarlosfcollonval
andauthored
Notebook metadata (#115)
* Split ymodel.ts into multiple files * Changes notebooks metadata to a YMap * Prevent using metadata before is initialized * Update tests * Lint * Fix license header job * Adds a static method for instantiating standalone documents * Adds tests to workspace * Fixes inheritance * Renames createStandalone to create * Fixes tests Co-authored-by: Frédéric Collonval <[email protected]>
1 parent 83b6d5d commit 145f811

File tree

11 files changed

+974
-859
lines changed

11 files changed

+974
-859
lines changed

.github/workflows/license-header.yml

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,31 @@ jobs:
3030
with:
3131
mode: fix
3232

33+
- name: List files changed
34+
id: files-changed
35+
shell: bash -l {0}
36+
run: |
37+
set -ex
38+
export CHANGES=$(git status --porcelain | tee modified.log | wc -l)
39+
cat modified.log
40+
# Remove the log otherwise it will be committed
41+
rm modified.log
42+
43+
echo "N_CHANGES=${CHANGES}" >> $GITHUB_OUTPUT
44+
45+
git diff
46+
3347
- name: Commit any changes
48+
if: steps.files-changed.outputs.N_CHANGES != '0'
3449
shell: bash -l {0}
3550
run: |
3651
git config user.name "github-actions[bot]"
3752
git config user.email "github-actions[bot]@users.noreply.github.com"
3853
3954
git pull --no-tags
40-
git add *
41-
git commit --allow-empty -m "Automatic application of license header"
42-
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
45-
- name: Get modified files
46-
id: changed-files
47-
uses: tj-actions/[email protected]
48-
with:
49-
base_sha: 'HEAD~1'
50-
sha: 'HEAD'
5155
52-
- name: Push fixes
53-
if: steps.changed-files.outputs.any_changed == 'true'
54-
shell: bash -l {0}
55-
run: |
56-
echo "Changed files"
57-
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
58-
echo " $file"
59-
done
60-
git diff HEAD~1
56+
git add *
57+
git commit -m "Automatic application of license header"
6158
6259
git config push.default upstream
6360
git push

javascript/src/api.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,10 +694,7 @@ export type NotebookChange = DocumentChange & {
694694
/**
695695
* Notebook metadata changes
696696
*/
697-
metadataChange?: {
698-
oldValue: nbformat.INotebookMetadata;
699-
newValue?: nbformat.INotebookMetadata;
700-
};
697+
metadataChange?: MapChanges;
701698
/**
702699
* nbformat version change
703700
*/

javascript/src/index.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,17 @@
88
*/
99

1010
export * from './api.js';
11-
export * from './ymodels.js';
1211
export * from './utils.js';
12+
13+
export * from './ytext.js';
14+
export * from './ydocument.js';
15+
export * from './yfile.js';
16+
export * from './ynotebook.js';
17+
export {
18+
YCellType,
19+
YBaseCell,
20+
YRawCell,
21+
YMarkdownCell,
22+
YCodeCell,
23+
createStandaloneCell
24+
} from './ycell.js';

0 commit comments

Comments
 (0)