Skip to content

Commit

Permalink
Utils.posix. Version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
breck7 committed Feb 18, 2025
1 parent 118c388 commit c559dcf
Show file tree
Hide file tree
Showing 14 changed files with 1,387 additions and 517 deletions.
7 changes: 2 additions & 5 deletions fusion/Fusion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const { Utils } = require("../products/Utils.js")
const { Particle } = require("../products/Particle.js")
const { HandParsersProgram } = require("../products/Parsers.js")
const parsersParser = require("../products/parsers.nodejs.js")
const { posix } = require("../products/Path.js")

const PARSERS_EXTENSION = ".parsers"
const SCROLL_EXTENSION = ".scroll"
Expand Down Expand Up @@ -264,7 +263,7 @@ class MemoryWriter implements Storage {
if (isUrl(path)) {
return path.substring(0, path.lastIndexOf("/"))
}
return posix.dirname(path)
return Utils.posix.dirname(path)
}

join(...segments: string[]) {
Expand All @@ -273,7 +272,7 @@ class MemoryWriter implements Storage {
const baseUrl = firstSegment.endsWith("/") ? firstSegment : firstSegment + "/"
return new URL(segments.slice(1).join("/"), baseUrl).toString()
}
return posix.join(...segments)
return Utils.posix.join(...segments)
}
}

Expand All @@ -290,8 +289,6 @@ class FusionFile {
constructor(codeAtStart: string, absoluteFilePath = "", fileSystem = new Fusion({})) {
this.fileSystem = fileSystem
this.filePath = absoluteFilePath
this.filename = posix.basename(absoluteFilePath)
this.folderPath = posix.dirname(absoluteFilePath) + "/"
this.codeAtStart = codeAtStart
this.timeIndex = 0
this.timestamp = 0
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scrollsdk",
"version": "101.3.0",
"version": "102.0.0",
"description": "This npm package includes the Particles class, the Parsers compiler-compiler, a Parsers IDE, and more, all implemented in Particles, Parsers, and TypeScript.",
"types": "./built/scrollsdk.node.d.ts",
"main": "./products/Particle.js",
Expand All @@ -20,7 +20,6 @@
"products/ParsersCompiler.js",
"products/Parsers.js",
"products/hakon.nodejs.js",
"products/Path.js",
"products/stamp.nodejs.js",
"products/stump.nodejs.js",
"products/swarm.nodejs.js",
Expand Down
2 changes: 1 addition & 1 deletion particle/Particle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3122,7 +3122,7 @@ class Particle extends AbstractParticle {
return str ? indent + str.replace(/\n/g, indent) : ""
}

static getVersion = () => "101.3.0"
static getVersion = () => "102.0.0"

static fromDisk(path: string): Particle {
const format = this._getFileFormat(path)
Expand Down
6 changes: 2 additions & 4 deletions products/Fusion.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ class MemoryWriter {
if (isUrl(path)) {
return path.substring(0, path.lastIndexOf("/"))
}
return posix.dirname(path)
return Utils.posix.dirname(path)
}
join(...segments) {
const firstSegment = segments[0]
if (isUrl(firstSegment)) {
const baseUrl = firstSegment.endsWith("/") ? firstSegment : firstSegment + "/"
return new URL(segments.slice(1).join("/"), baseUrl).toString()
}
return posix.join(...segments)
return Utils.posix.join(...segments)
}
}
class EmptyScrollParser extends Particle {
Expand All @@ -220,8 +220,6 @@ class FusionFile {
this.defaultParser = EmptyScrollParser
this.fileSystem = fileSystem
this.filePath = absoluteFilePath
this.filename = posix.basename(absoluteFilePath)
this.folderPath = posix.dirname(absoluteFilePath) + "/"
this.codeAtStart = codeAtStart
this.timeIndex = 0
this.timestamp = 0
Expand Down
7 changes: 2 additions & 5 deletions products/Fusion.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const { Utils } = require("../products/Utils.js")
const { Particle } = require("../products/Particle.js")
const { HandParsersProgram } = require("../products/Parsers.js")
const parsersParser = require("../products/parsers.nodejs.js")
const { posix } = require("../products/Path.js")
const PARSERS_EXTENSION = ".parsers"
const SCROLL_EXTENSION = ".scroll"
// Add URL regex pattern
Expand Down Expand Up @@ -203,15 +202,15 @@ class MemoryWriter {
if (isUrl(path)) {
return path.substring(0, path.lastIndexOf("/"))
}
return posix.dirname(path)
return Utils.posix.dirname(path)
}
join(...segments) {
const firstSegment = segments[0]
if (isUrl(firstSegment)) {
const baseUrl = firstSegment.endsWith("/") ? firstSegment : firstSegment + "/"
return new URL(segments.slice(1).join("/"), baseUrl).toString()
}
return posix.join(...segments)
return Utils.posix.join(...segments)
}
}
class EmptyScrollParser extends Particle {
Expand All @@ -228,8 +227,6 @@ class FusionFile {
this.defaultParser = EmptyScrollParser
this.fileSystem = fileSystem
this.filePath = absoluteFilePath
this.filename = posix.basename(absoluteFilePath)
this.folderPath = posix.dirname(absoluteFilePath) + "/"
this.codeAtStart = codeAtStart
this.timeIndex = 0
this.timestamp = 0
Expand Down
2 changes: 1 addition & 1 deletion products/Particle.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2625,7 +2625,7 @@ Particle.iris = `sepal_length,sepal_width,petal_length,petal_width,species
4.9,2.5,4.5,1.7,virginica
5.1,3.5,1.4,0.2,setosa
5,3.4,1.5,0.2,setosa`
Particle.getVersion = () => "101.3.0"
Particle.getVersion = () => "102.0.0"
class AbstractExtendibleParticle extends Particle {
_getFromExtended(cuePath) {
const hit = this._getParticleFromExtended(cuePath)
Expand Down
2 changes: 1 addition & 1 deletion products/Particle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2615,7 +2615,7 @@ Particle.iris = `sepal_length,sepal_width,petal_length,petal_width,species
4.9,2.5,4.5,1.7,virginica
5.1,3.5,1.4,0.2,setosa
5,3.4,1.5,0.2,setosa`
Particle.getVersion = () => "101.3.0"
Particle.getVersion = () => "102.0.0"
class AbstractExtendibleParticle extends Particle {
_getFromExtended(cuePath) {
const hit = this._getParticleFromExtended(cuePath)
Expand Down
Loading

0 comments on commit c559dcf

Please sign in to comment.