Repository navigation
chore: release - #350
Merged
Merged
chore: release#350
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@_linked/cli@2.0.0
Major Changes
#349
b9a65cbThanks @flyon! -linked.app.jsonholds every setting of an app;linked.config.jsis no longer read.Breaking.
linked.config.js(orlincd.config.js) is refused when its server starts (linked start,linked serve-app, a compiled server) and when it is built (linked build-app); the error shows the JSON to move its settings into. Move them intolinked.app.jsonand delete the file.cssMode(tailwind|postcss),syncShapesOnBoot,datasetCloneScript,publish(staticAssets,releasePrefix) andserver(rpcExposure,rawQueries,apiOnly,cachePaths,cacheTimeout). Each is checked; an unknown key, also insideserverorpublish, is refused.linked prefixeskeeps them when it adds prefixes.LINKED_RPC_EXPOSURE, when set, wins overserver.rpcExposure; a value other thanwarnorenforceis refused at start.defineConfig(@_linked/cli/defineConfigand the package entry) is removed: nothing reads a settings module any more.ModuleConfig,AdjustedModuleConfig(the old webpack build's) andLinkedServerConfig.multiCoreare removed;LinkedConfigis the configuration the cli givesLinkedServer(cssMode,syncShapesOnBoot,server), and losesdatasetCloneScript. New:AppServerSettings,CssMode,RpcExposureMode,RawQueriesMode.server.loadAppComponentandserver.loadRoutesare set by the cli only.resolveLinkedConfigPathandLINKED_CONFIG_FILES(@_linked/cli/commands/start) are removed;readDatasetCloneScriptis synchronous.Fixed.
linked generate-ontologyreplaces a side-effect import of asrc/ontologies/<name>.register.jsthat no longer exists (a register module deleted by hand) with the import of the ontology index, as it does for the register modules it removes itself.#349
497bb30Thanks @flyon! - One ontology index per package, and an app's own prefix map inlinked.app.json.Ontology modules (breaking).
linked generate-ontologywrites, per package:src/ontologies/<module>.tsfor each generated ontology: only its terms, eachexport const Term = {id: '<namespace>Term'};(the valuecreateNameSpace(namespace)('Term')returns). It imports nothing; usecreateNameSpacefrom@_linked/core/utils/NameSpacewhere code needs a namespace function.src/ontologies/index.ts: imports every ontology module of the package (those with"generated": falsetoo) and registers them all with oneregisterOntologies([{name, namespace, terms, data, suggestedPrefix}], import.meta.url)call.registerOntologiescomes from the package'ssrc/package.ts(linkedPackage(...)), so it needs the@_linked/coremajor that provides it.src/index.ts[x]) imports./ontologies/index.js; side-effect imports of a removed<module>.register.jsbecome an import of the index.<module>.data.tsand<module>.register.tsare no longer generated: the command removes the ones it wrote before. Their exports (ns,dataFiles,loadData,_ontologyResource) are gone; importcreateNameSpacefrom core instead ofns.linked build's ontology check also fails when the entry does not import the index or such a file is left. Runlinked generate-ontologyand commit the result."generated": false) no longer registers itself: the index does.create-package --kind ontologyandcreate-ontologywrite this layout; the package template'ssrc/package.tsexportsregisterOntologiesinstead oflinkedOntology.ontologies/index.js(orsrc/ontologies/index.tsbefore it is built).@_linked/cli/utils/ontologyModules:generateOntologyModules(specs, handWritten?)returns every module of a package (terms modules andsrc/ontologies/index.ts); newgenerateOntologyIndexModule;generateOntologyDataModuleandgenerateOntologyRegisterModuleare removed;OntologyModuleSpec.ontologyis removed.generatePackageOntologiesreturns{ontologies, files, edits, remove}.linked.app.json(new). An app's declarative settings at its root:{"$schema": "https://linked.cm/schema/app/1.json", "schemaVersion": 1, "prefixes": {"<prefix>": "<namespace>"}}. The schema ships asschema/app/1.json; an unknownschemaVersionor key is refused; a prefix is^[A-Za-z][A-Za-z0-9_]*$.linked prefixesadds a prefix for every installed ontology whose namespace the map lacks: its suggested prefix (from its vann data), or<prefix>_2,_3, … when taken. It never changes or removes an entry, and creates the file when the app has none.linked generate-ontologyruns it for the app the package belongs to (same git repository).Prefix.load) at server start (linked startand a compiled server) and in the browser bundle (thelinked:app-prefixesVite plugin ofcreateViteConfig; the client entry imports it first). An app with nolinked.app.jsonloads nothing; a core withoutPrefix.loadis warned about and left as it is.linked create-appwriteslinked.app.jsonand fills it after the install; the React Native template's API service has one.Minor Changes
#349
2b915b0Thanks @flyon! -linked worktree add --dataset <name>andlinked branch start <m> --worktree --dataset <name>now print how to fill the new dataset from the app's own clone script instead of fixed script paths:clone-datasetto its rootpackage.jsonthat copies its data into the dataset named by its one argument. The hint is thenClone the data into <name> first (from <root>): npm run clone-dataset -- <name>.datasetCloneScriptinlinked.config.js:defineConfig({datasetCloneScript: 'data:clone'})(new optionalLinkedConfigkey).datasetCloneScriptnames a scriptpackage.jsonlacks), a warning says the dataset starts empty unless it is cloned by hand, and how to add the script.New exports from the worktree command module:
datasetCloneHint,datasetCloneMessages,readDatasetCloneScript,DEFAULT_DATASET_CLONE_SCRIPT,appPort;DEFAULT_APP_PORT(4040) from the start command.Wording:
worktree addwithout--portnames the app's own port (its.envPORT, else 4040) as the main checkout's, andbranch landsays "Restart the app on …". Seedocs/integration-branches-and-worktrees.md, "Cloning a dataset".#349
190a044Thanks @flyon! - AlinkedOntologiesentry names its module and may keep its modules written by hand."module"(optional, the same pattern as a name, default the name) is the modules' file name insrc/ontologies/: a generated ontology's files are<module>.ts,<module>.data.tsand<module>.register.ts, imported as<package>/ontologies/<module>. The registration still uses the name:linkedOntology(terms, ns, '<name>', …). Two entries with one module are refused."generated": false(defaulttrue) declares an ontology whose modules hold more than the generator writes.linked generate-ontologywrites nothing for it andlinked buildskips its staleness check, but its data must carry the same vann triples, and the build refuses it without them:New pure module
@_linked/cli/utils/ontologyConfig:readOntologyConfigs(pkgJson)returns{name, namespace, module, generated, data}per ontology, sorted by name.OntologyConfig,ONTOLOGIES_KEY,ONTOLOGY_NAMESPACEandreadOntologyConfigsmove there from@_linked/cli/utils/generateOntology.OntologyModuleSpec.module(optional) names the generated files.#349
a79ed98Thanks @flyon! - Ontologies are keyed by their name within the package, and their suggested prefix is data.package.json"linkedOntologies"is keyed by the ontology's name (lowercase letters and digits, single-or_between them). The name names the modules (src/ontologies/<name>.ts,.data.ts,.register.ts) and is the third argument of the generatedlinkedOntology(terms, ns, '<name>', loadData, dataFiles). It is no longer a prefix.linked generate-ontologyreads the suggested prefix from thevann:preferredNamespacePrefixof the ontology'sowl:Ontologynode and writesPrefix.add('<that prefix>', '<namespace>')in<name>.data.ts.A package without vann data now fails its build (and
linked generate-ontology): every ontology'sowl:Ontologynode must carry exactly onevann:preferredNamespacePrefixand onevann:preferredNamespaceUriequal to its configurednamespace. The message names the package, the ontology and its files, and shows the triples to add. To fix it, add to one of the ontology's data files (for a published vocabulary shipped unedited, asrc/data/<name>-added.ttllisted in itsdata):Write the prefix the package registers today, so its Turtle output does not change, then run
linked generate-ontology.create-package --kind ontologyandcreate-ontology <name>write both triples (the name as the prefix).API of
@_linked/cli/utils/ontologyModulesandontologyTerms:OntologyModuleSpec.prefixis replaced bynameandsuggestedPrefix;ONTOLOGY_PREFIXbyONTOLOGY_NAME(lowercase only) andSUGGESTED_PREFIX;OntologyConfig.prefixbyname;OntologyNameCollisionError.prefixbyontologyName.ontologyTermsFromQuadsalso returnspreferredPrefixesandpreferredNamespaces; newontologySuggestedPrefix(result, namespace)andOntologyVannError.Patch Changes
#349
d1514ceThanks @flyon! - Comments and the architecture notes namelinked.app.json, not the removedlinked.config.js.#349
48c3c6dThanks @flyon! - Removes a stale commented-out TODO aboutlinked.config.jsonfromdebugInfo.#349
fc6432cThanks @flyon! - Comments and docs describe the host app generically.#349
c810539Thanks @flyon! - One dependency order for release PRs,checkoutandbranch land, with the build tool ordered aslinked build-allorders it: the build tool's own dependencies, then the build tool (@_linked/cli), then everything else. The packages that devDepend on the build tool while it depends on one of them (@_linked/core) formed a cycle, which fell back to name order and could put a package before the build tool.branch landtherefore built such a package with the old build tool. When the build tool fails to build inbranch land, the packages after it are not built (and so not pushed).#349
53d0398Thanks @flyon! -linkedOntologiesnamespaces and the namespaces oflinked.app.jsonprefixes refuse the characters that cannot appear in a SPARQL or Turtle IRI (<,>,",{,},|,^, backtick, backslash, whitespace and control characters).NAMESPACE_IRIis exported fromutils/ontologyConfig.