Skip to content

Commit

Permalink
Merge pull request #7 from glossarist/rt-fix-compile
Browse files Browse the repository at this point in the history
Fix GHA and `compile-all`
  • Loading branch information
ribose-jeffreylau authored Dec 18, 2023
2 parents b5053f6 + 66fc909 commit 92d3b0a
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 19 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
environment:
name: production
steps:
- uses: actions/checkout@v4

- name: Use Node
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '18.x'

- uses: actions/checkout@v4
node-version: 18
cache: 'yarn'

- name: Enable Yarn Berry
run: |
corepack enable
corepack prepare yarn@stable --activate
# - name: Compile all packages
# # TODO: Get rid of, the esbuild step should be sufficient.
# # However, currently some packages rely on `compiled/` paths,
# # which are created by running `compile` commands.
# run: |
# yarn compile-all
- name: Compile all packages
# TODO: Get rid of, the esbuild step should be sufficient.
# However, currently some packages rely on `compiled/` paths,
# which are created by running `compile` commands.
run: |
yarn compile-all
# Deployment job
deploy:
Expand Down
21 changes: 21 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
6 changes: 4 additions & 2 deletions packages/cli/src/fs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import fs from 'node:fs/promises';
import type { File } from 'common';
import path from 'node:path';
import type { File, } from 'common';


/**
Expand All @@ -9,7 +10,8 @@ export async function * fsPathToFiles(absPath: string) {
for (const filepath of await fs.readdir(absPath)) {
const file: File = {
blob: Uint8Array.from(await fs.readFile(filepath)),
name: filepath,
name: path.basename(filepath),
fullPath: filepath,
};
yield file;
}
Expand Down
3 changes: 3 additions & 0 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"compile": "tsc --outdir compiled",
"clean": "rm -r compiled"
},
"dependencies": {
"@lukeed/uuid": "^2"
},
"devDependencies": {
"@riboseinc/paneron-extension-glossarist": "^2.0.11",
"@riboseinc/paneron-registry-kit": "2.2.2",
Expand Down
3 changes: 2 additions & 1 deletion packages/common/src/convertors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type {
CommonStreamProcessingOptions,
RegisterItemsByClassID,
} from './base.js';
import { v4 as generateUUID } from '@lukeed/uuid/secure';

export type { Convertor, FileConvertor, File } from './base.js';

Expand All @@ -23,7 +24,7 @@ export async function asProposal<R extends RegisterConfiguration>(
itemPayloads: Record<string, RegisterItem<any>>,
}> {
const now = new Date();
const id = crypto.randomUUID();
const id = generateUUID();
const proposalDraft: ProposalDraft = {
...proposalOptions,
id,
Expand Down
6 changes: 3 additions & 3 deletions packages/common/src/glossary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { RegisterItem, RegisterConfiguration, ItemClassConfiguration } from
import type { ConceptData } from '@riboseinc/paneron-extension-glossarist/classes/concept.js';
import type { LocalizedConceptData } from '@riboseinc/paneron-extension-glossarist/classes/localizedConcept/LocalizedConceptData.js';
import type { Designation } from '@riboseinc/paneron-extension-glossarist/models/concepts.js';

import { v4 as generateUUID } from '@lukeed/uuid/secure';
import { teeAsync } from './util.js';

import type {
Expand Down Expand Up @@ -43,8 +43,8 @@ export async function * asRegisterItemsWithInferredUniversal(
const designation = conceptData.terms[0]!.designation;
const identifier = /* opts?.conceptIDMaker?.(idx, conceptData) ?? */ `${idx + 1}`;
opts?.onProgress?.(`Outputting as register items: #${idx + 1} (${designation}) (using ID “${identifier}”)`);
const universalUUID = crypto.randomUUID();
const localizedUUID = crypto.randomUUID();
const universalUUID = generateUUID();
const localizedUUID = generateUUID();
const universalConcept: RegisterItem<ConceptData> = {
id: universalUUID,
data: {
Expand Down
1 change: 1 addition & 0 deletions packages/gr-sheet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"read-excel-file": "^5.6.1"
},
"devDependencies": {
"@lukeed/uuid": "^2",
"@riboseinc/paneron-extension-geodetic-registry": "^1.0.19",
"@riboseinc/paneron-registry-kit": "2.2.2",
"common": "workspace:^",
Expand Down
3 changes: 2 additions & 1 deletion packages/gr-sheet/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import type { UoMData } from '@riboseinc/paneron-extension-geodetic-registry/cla
import type { NonCompoundCRSData } from '@riboseinc/paneron-extension-geodetic-registry/classes/crs.js';

import xlsx, { readSheetNames, type Row } from 'read-excel-file';
import { v4 as generateUUID } from '@lukeed/uuid/secure';

import type { FileConvertor } from '../../common/src/convertors/index.js';
import { teeAsync } from '../../common/src/util.js';
Expand Down Expand Up @@ -210,7 +211,7 @@ async function * generateGRItems(parsedSheetItems, opts) {
const classID = processor.getClassID(
rowParsed as Record<Exclude<(typeof processor)["fields"][number], null>, string>
);
const itemID = crypto.randomUUID();
const itemID = generateUUID();
const itemRef = { classID, itemID };
const identifier = availableID;
availableID = availableID - 1;
Expand Down
18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,22 @@ __metadata:
languageName: node
linkType: hard

"@lukeed/csprng@npm:^1.1.0":
version: 1.1.0
resolution: "@lukeed/csprng@npm:1.1.0"
checksum: 926f5f7fc629470ca9a8af355bfcd0271d34535f7be3890f69902432bddc3262029bb5dbe9025542cf6c9883d878692eef2815fc2f3ba5b92e9da1f9eba2e51b
languageName: node
linkType: hard

"@lukeed/uuid@npm:^2":
version: 2.0.1
resolution: "@lukeed/uuid@npm:2.0.1"
dependencies:
"@lukeed/csprng": ^1.1.0
checksum: f5e71e4da852dbff49b93cad27d5a2f61c2241e307bbe89b3b54b889ecb7927f2487246467f90ebb6cbdb7e0ac2a213e2e58b1182cb7990cef6e049aa7c39e7b
languageName: node
linkType: hard

"@npmcli/fs@npm:^3.1.0":
version: 3.1.0
resolution: "@npmcli/fs@npm:3.1.0"
Expand Down Expand Up @@ -419,6 +435,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@riboseinc/parse-gr-sheet@workspace:packages/gr-sheet"
dependencies:
"@lukeed/uuid": ^2
"@riboseinc/paneron-extension-geodetic-registry": ^1.0.19
"@riboseinc/paneron-registry-kit": 2.2.2
common: "workspace:^"
Expand Down Expand Up @@ -801,6 +818,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "common@workspace:packages/common"
dependencies:
"@lukeed/uuid": ^2
"@riboseinc/paneron-extension-glossarist": ^2.0.11
"@riboseinc/paneron-registry-kit": 2.2.2
"@types/node": ^18
Expand Down

0 comments on commit 92d3b0a

Please sign in to comment.