Watching for file changes."dev": "swc cartridges -d cartridges --only '**/*.ts' --watch"styled-jsxng-annotateng-annotatetsx/api/esmFROM node:22.15.0-slim AS builder
WORKDIR /app
# Install Bun
RUN apt-get update && apt-get install -y curl unzip \
&& curl -fsSL https://bun.sh/install | bash \
&& rm -rf /var/lib/apt/lists/*
ENV PATH="${PATH}:/root/.bun/bin"
# Copy lockfiles and install deps
COPY package*.json bun.lock ./
RUN bun install --frozen-lockfile
# Copy source code
COPY . .
# Build steps
RUN bun run buildFROM oven/bun:latest AS builder
WORKDIR /app
# Copy lockfiles and install deps
COPY package*.json bun.lock ./
RUN bun install --frozen-lockfile
# Copy source code
COPY . .
# Build steps (ERROR HERE)
RUN bun run build$ swc src -d dist
this.publicInterface = publicInterface;
this.taskQueue = options.taskQueue || new task_queue_1.ArrayTaskQueue();
const filename = options.filename ? (0, common_1.maybeFileURLToPath)(options.filename) : null;
this.options = { ...kDefaultOptions, ...options, filename, maxQueue: 0 };
if (this.options.recordTiming) {
this.runTime = (0, node_perf_hooks_1.createHistogram)();
^
error: Not implemented
at new ThreadPool (/app/node_modules/piscina/dist/index.js:95:50)
at new Piscina (/app/node_modules/piscina/dist/index.js:570:53)
at initialCompilation (/app/node_modules/@swc/cli/lib/swc/dir.js:83:25)asyncAsyncToGeneratorvisit_children_withasync_to_generatorPassVisitMutswc_ecma_compat_es2017src/async_to_generator.rsexternalHelpersexternalHelpersexternalHelpersenv.targetsSome(&comments).swcrcswcdesign:paramtypes@swc/jest ● Test suite failed to run
A jest worker process (pid=X) was terminated by another process: signal=SIGBUS, exitCode=null. Operating system logs may contain more information on why this occurred./** @ngInject */
class TestClass {
constructor (private testField) {}
}/** @ngInject */ import { _ as _define_property } from "@swc/helpers/_/_define_property";
class TestClass {
constructor(testField){
_define_property(this, "testField", void 0);
this.testField = testField;
}
}{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false,
"decorators": true
},
"target": "es2015",
"loose": false,
"minify": {
"compress": false,
"mangle": false
},
"transform": {
"decoratorVersion": "2022-03"
},
"preserveAllComments": true,
"externalHelpers": true
},
"module": {
"type": "es6"
},
"minify": false,
"isModule": true
}@import "theme.css";
@import "custom.css";
@import "reset.css";
body {
color: black;
}function decorator() {}
class Foo {
/**
* @param {string} x
*/
@decorator
foo(x) {
return 'foo';
}
} {
"$schema": "https://swc.rs/schema.json",
"module": {
"type": "commonjs"
},
"jsc": {
"target": "es2022",
"parser": {
"syntax": "ecmascript",
"decorators": true
},
"transform": {
"legacyDecorator": true,
"decoratorMetadata": true
},
"externalHelpers": true,
"loose": true,
"keepClassNames": true,
},
"sourceMaps": false
}"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _ts_decorate = require("@swc/helpers/_/_ts_decorate");
const _ts_metadata = require("@swc/helpers/_/_ts_metadata");
function decorator() {}
let Foo = class Foo {
foo(x) {
return 'foo';
}
};
_ts_decorate._([
decorator,
_ts_metadata._("design:type", Function),
_ts_metadata._("design:paramtypes", [
void 0 // <<---- How would I get `String` here?
]),
_ts_metadata._("design:returntype", void 0)
], Foo.prototype, "foo", null);pub fn parse(
file_content: &str,
) -> Result<(Stylesheet, SingleThreadedComments, Lrc<SourceMap>), String> {
let cm: Lrc<SourceMap> = Default::default();
let fm = cm.new_source_file(FileName::Anon.into(), file_content.into());
let comments = SingleThreadedComments::default();
let lexer = Lexer::new(
SourceFileInput::from(&*fm),
Some(&comments),
ParserConfig::default(),
);
let mut parser = Parser::new(lexer, ParserConfig::default());
let stylesheet = match parser.parse_all() {
Ok(s) => s,
Err(_) => {
return Err("Failed to parse CSS".to_string());
}
};
Ok((stylesheet, comments, cm))
}let mut output = String::new();
{
let mut writer = BasicCssWriter::new(&mut output, None, Default::default());
let mut gen = CodeGenerator::new(&mut writer, CodegenConfig { minify: false });
gen.emit(&stylesheet).expect("Failed to generate CSS");
}
Ok(output)let css_code = r#"
@import "reset.css";
/* This file is for your main application CSS */
body { color: black; }
"#;
let new_imports = r#"
@import "theme.css";
@import "reset.css";
@import "custom.css";
"#;
let result = insert_import_to_ast(css_code, new_imports).unwrap();
println!("{}", result);